@lodestar/beacon-node 2.1.0-dev.a243bacf81 → 2.1.0-dev.a2ac365b3e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +1 -3
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/errors.d.ts +7 -0
- package/lib/api/impl/errors.d.ts.map +1 -1
- package/lib/api/impl/errors.js +9 -0
- package/lib/api/impl/errors.js.map +1 -1
- package/lib/api/rest/base.d.ts.map +1 -1
- package/lib/api/rest/base.js +5 -2
- package/lib/api/rest/base.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +3 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +3 -1
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +3 -0
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +3 -1
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/chain.d.ts +2 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +5 -1
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +7 -0
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +1 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +1 -2
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -1
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +0 -2
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/seenCache/index.d.ts +1 -0
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +1 -0
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.d.ts +3 -0
- package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.js +6 -2
- package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
- package/lib/chain/seenCache/seenDataColumnSidecars.d.ts +17 -0
- package/lib/chain/seenCache/seenDataColumnSidecars.d.ts.map +1 -0
- package/lib/chain/seenCache/seenDataColumnSidecars.js +61 -0
- package/lib/chain/seenCache/seenDataColumnSidecars.js.map +1 -0
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +12 -2
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +1 -1
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +2 -2
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +1 -3
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +1 -3
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/network.d.ts +1 -6
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +16 -40
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts +0 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +0 -1
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/discover.d.ts +1 -0
- package/lib/network/peers/discover.d.ts.map +1 -1
- package/lib/network/peers/discover.js +44 -48
- package/lib/network/peers/discover.js.map +1 -1
- package/lib/network/peers/score/store.d.ts.map +1 -1
- package/lib/network/peers/score/store.js +1 -2
- package/lib/network/peers/score/store.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +61 -3
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/util/dataColumns.d.ts +2 -1
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +7 -2
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +2 -1
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +7 -2
- package/lib/util/execution.js.map +1 -1
- package/package.json +18 -18
- package/src/api/impl/beacon/blocks/index.ts +1 -5
- package/src/api/impl/errors.ts +10 -0
- package/src/api/rest/base.ts +4 -2
- package/src/chain/ColumnReconstructionTracker.ts +5 -1
- package/src/chain/GetBlobsTracker.ts +5 -0
- package/src/chain/chain.ts +5 -0
- package/src/chain/errors/dataColumnSidecarError.ts +8 -0
- package/src/chain/forkChoice/index.ts +1 -3
- package/src/chain/interface.ts +2 -0
- package/src/chain/options.ts +0 -2
- package/src/chain/seenCache/index.ts +1 -0
- package/src/chain/seenCache/seenBlockProposers.ts +12 -2
- package/src/chain/seenCache/seenDataColumnSidecars.ts +69 -0
- package/src/chain/validation/block.ts +11 -2
- package/src/chain/validation/dataColumnSidecar.ts +1 -1
- package/src/chain/validation/voluntaryExit.ts +2 -2
- package/src/index.ts +1 -0
- package/src/network/core/networkCore.ts +1 -3
- package/src/network/network.ts +20 -44
- package/src/network/options.ts +0 -2
- package/src/network/peers/discover.ts +42 -52
- package/src/network/peers/score/store.ts +1 -2
- package/src/network/processor/gossipHandlers.ts +107 -3
- package/src/util/dataColumns.ts +13 -1
- package/src/util/execution.ts +16 -1
package/lib/util/execution.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { IBlockInput } from "../chain/blocks/blockInput/types.js";
|
|
|
5
5
|
import { PayloadEnvelopeInput } from "../chain/blocks/payloadEnvelopeInput/index.js";
|
|
6
6
|
import { ChainEventEmitter } from "../chain/emitter.js";
|
|
7
7
|
import { EnvelopeReconstructionError } from "../chain/errors/envelopeReconstructionError.js";
|
|
8
|
+
import { SeenDataColumnSidecars } from "../chain/seenCache/seenDataColumnSidecars.js";
|
|
8
9
|
import { IBeaconDb } from "../db/index.js";
|
|
9
10
|
import { IExecutionEngine } from "../execution/index.js";
|
|
10
11
|
import { Metrics } from "../metrics/index.js";
|
|
@@ -23,7 +24,7 @@ export declare enum DataColumnEngineResult {
|
|
|
23
24
|
* Post fulu, whenever we see either beacon_block or data_column_sidecar gossip message and data isn't complete.
|
|
24
25
|
* Post gloas, immediately when beacon block is successfully imported and PayloadEnvelopeInput is created.
|
|
25
26
|
*/
|
|
26
|
-
export declare function getDataColumnSidecarsFromExecution(config: ChainForkConfig, executionEngine: Pick<IExecutionEngine, "getBlobs">, emitter: ChainEventEmitter, input: IBlockInput | PayloadEnvelopeInput, metrics: Metrics | null, blobAndProofBuffers?: Uint8Array[]): Promise<DataColumnEngineResult>;
|
|
27
|
+
export declare function getDataColumnSidecarsFromExecution(config: ChainForkConfig, executionEngine: Pick<IExecutionEngine, "getBlobs">, emitter: ChainEventEmitter, seenDataColumnSidecars: SeenDataColumnSidecars, input: IBlockInput | PayloadEnvelopeInput, metrics: Metrics | null, blobAndProofBuffers?: Uint8Array[]): Promise<DataColumnEngineResult>;
|
|
27
28
|
/** engine_getPayloadBodiesByHashV2: every EL must accept requests of up to 32 hashes, larger ones may fail with -38004 */
|
|
28
29
|
export declare const MAX_BODIES_PER_REQUEST = 32;
|
|
29
30
|
type SlotEnvelopeBytes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/util/execution.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAuC,IAAI,EAAE,KAAK,EAAgC,MAAM,iBAAiB,CAAC;AACjH,OAAO,EAAC,MAAM,EAA4B,MAAM,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ChE,EAAE,EAAE,SAAS,EACb,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,EACnE,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,GACZ,aAAa,CAAC,iBAAiB,CAAC,CAclC;AAyCD;;;;GAIG;AACH,wBAAsB,oCAAoC,CACxD,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,EACnE,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,eAAe,EAAE,KAAK,CAAC,oCAAoC,EAAE,GAC5D,OAAO,CAAC,CAAC,KAAK,CAAC,8BAA8B,GAAG,WAAW,CAAC,EAAE,CAAC,CAYjE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,8BAA8B,GAAG,WAAW,GAAG,MAAM,IAAI,WAAW,CAE/G"}
|
package/lib/util/execution.js
CHANGED
|
@@ -30,7 +30,7 @@ export var DataColumnEngineResult;
|
|
|
30
30
|
* Post fulu, whenever we see either beacon_block or data_column_sidecar gossip message and data isn't complete.
|
|
31
31
|
* Post gloas, immediately when beacon block is successfully imported and PayloadEnvelopeInput is created.
|
|
32
32
|
*/
|
|
33
|
-
export async function getDataColumnSidecarsFromExecution(config, executionEngine, emitter, input, metrics, blobAndProofBuffers) {
|
|
33
|
+
export async function getDataColumnSidecarsFromExecution(config, executionEngine, emitter, seenDataColumnSidecars, input, metrics, blobAndProofBuffers) {
|
|
34
34
|
const isPayloadInput = input instanceof PayloadEnvelopeInput;
|
|
35
35
|
// Pre gloas, ensure it's a column block input
|
|
36
36
|
if (!isPayloadInput && !isBlockInputColumns(input)) {
|
|
@@ -80,8 +80,10 @@ export async function getDataColumnSidecarsFromExecution(config, executionEngine
|
|
|
80
80
|
// Publish columns if and only if subscribed to them
|
|
81
81
|
const previouslyMissingColumns = input.getMissingSampledColumnMeta().missing;
|
|
82
82
|
const sampledColumns = previouslyMissingColumns.map((columnIndex) => dataColumnSidecars[columnIndex]);
|
|
83
|
+
const columnsToPublish = sampledColumns.filter((columnSidecar) => isGloasDataColumnSidecar(columnSidecar) ||
|
|
84
|
+
!seenDataColumnSidecars.isRepeatProposal(columnSidecar.signedBlockHeader.message.slot, columnSidecar.signedBlockHeader.message.proposerIndex, columnSidecar.index, input.blockRootHex));
|
|
83
85
|
// for columns we have already seen, publishDataColumnSidecar() catches PublishError.Duplicate and marks alreadyPublished=true
|
|
84
|
-
emitter.emit(ChainEvent.publishDataColumns,
|
|
86
|
+
emitter.emit(ChainEvent.publishDataColumns, columnsToPublish);
|
|
85
87
|
// TODO: Can we record dataColumns.sentPeersPerSubnet metric here somehow
|
|
86
88
|
// add all sampled columns to the input, even if we didn't sample them
|
|
87
89
|
const seenTimestampSec = Date.now() / 1000;
|
|
@@ -112,6 +114,9 @@ export async function getDataColumnSidecarsFromExecution(config, executionEngine
|
|
|
112
114
|
source: BlockInputSource.engine,
|
|
113
115
|
seenTimestampSec,
|
|
114
116
|
});
|
|
117
|
+
// Columns from the execution layer count as received via gossip for the repeat proposal check
|
|
118
|
+
const { slot, proposerIndex } = columnSidecar.signedBlockHeader.message;
|
|
119
|
+
seenDataColumnSidecars.add(slot, proposerIndex, columnSidecar.index, input.blockRootHex);
|
|
115
120
|
}
|
|
116
121
|
if (emitter.listenerCount(routes.events.EventType.dataColumnSidecar)) {
|
|
117
122
|
emitter.emit(routes.events.EventType.dataColumnSidecar, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/util/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAGrC,OAAO,EAAoD,wBAAwB,EAAE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACjH,OAAO,EAAS,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAC,mB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github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "2.1.0-dev.
|
|
14
|
+
"version": "2.1.0-dev.a2ac365b3e",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
"@chainsafe/enr": "^6.0.2",
|
|
104
104
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
105
105
|
"@chainsafe/libp2p-quic": "^2.1.6",
|
|
106
|
-
"@chainsafe/persistent-merkle-tree": "^1.3.
|
|
106
|
+
"@chainsafe/persistent-merkle-tree": "^1.3.2",
|
|
107
107
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
108
108
|
"@chainsafe/snappy-wasm": "^0.5.2",
|
|
109
|
-
"@chainsafe/ssz": "^1.9.
|
|
109
|
+
"@chainsafe/ssz": "^1.9.3",
|
|
110
110
|
"@chainsafe/threads": "^1.11.3",
|
|
111
111
|
"@crate-crypto/node-eth-kzg": "0.9.1",
|
|
112
112
|
"@fastify/bearer-auth": "^10.0.1",
|
|
@@ -124,18 +124,18 @@
|
|
|
124
124
|
"@libp2p/prometheus-metrics": "^5.0.31",
|
|
125
125
|
"@libp2p/tcp": "^11.0.30",
|
|
126
126
|
"@libp2p/utils": "^7.4.6",
|
|
127
|
-
"@lodestar/api": "^2.1.0-dev.
|
|
128
|
-
"@lodestar/config": "^2.1.0-dev.
|
|
129
|
-
"@lodestar/db": "^2.1.0-dev.
|
|
130
|
-
"@lodestar/fork-choice": "^2.1.0-dev.
|
|
131
|
-
"@lodestar/logger": "^2.1.0-dev.
|
|
132
|
-
"@lodestar/native": "^2.1.0-dev.
|
|
133
|
-
"@lodestar/params": "^2.1.0-dev.
|
|
134
|
-
"@lodestar/reqresp": "^2.1.0-dev.
|
|
135
|
-
"@lodestar/state-transition": "^2.1.0-dev.
|
|
136
|
-
"@lodestar/types": "^2.1.0-dev.
|
|
137
|
-
"@lodestar/utils": "^2.1.0-dev.
|
|
138
|
-
"@lodestar/validator": "^2.1.0-dev.
|
|
127
|
+
"@lodestar/api": "^2.1.0-dev.a2ac365b3e",
|
|
128
|
+
"@lodestar/config": "^2.1.0-dev.a2ac365b3e",
|
|
129
|
+
"@lodestar/db": "^2.1.0-dev.a2ac365b3e",
|
|
130
|
+
"@lodestar/fork-choice": "^2.1.0-dev.a2ac365b3e",
|
|
131
|
+
"@lodestar/logger": "^2.1.0-dev.a2ac365b3e",
|
|
132
|
+
"@lodestar/native": "^2.1.0-dev.a2ac365b3e",
|
|
133
|
+
"@lodestar/params": "^2.1.0-dev.a2ac365b3e",
|
|
134
|
+
"@lodestar/reqresp": "^2.1.0-dev.a2ac365b3e",
|
|
135
|
+
"@lodestar/state-transition": "^2.1.0-dev.a2ac365b3e",
|
|
136
|
+
"@lodestar/types": "^2.1.0-dev.a2ac365b3e",
|
|
137
|
+
"@lodestar/utils": "^2.1.0-dev.a2ac365b3e",
|
|
138
|
+
"@lodestar/validator": "^2.1.0-dev.a2ac365b3e",
|
|
139
139
|
"@multiformats/multiaddr": "^13.0.1",
|
|
140
140
|
"datastore-core": "^12.0.1",
|
|
141
141
|
"datastore-level": "^13.0.1",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
"@ethereumjs/rlp": "^10.1.3",
|
|
158
158
|
"@libp2p/interface-internal": "^3.2.3",
|
|
159
159
|
"@libp2p/logger": "^6.2.16",
|
|
160
|
-
"@lodestar/spec-test-util": "^2.1.0-dev.
|
|
161
|
-
"@lodestar/test-utils": "^2.1.0-dev.
|
|
160
|
+
"@lodestar/spec-test-util": "^2.1.0-dev.a2ac365b3e",
|
|
161
|
+
"@lodestar/test-utils": "^2.1.0-dev.a2ac365b3e",
|
|
162
162
|
"@types/js-yaml": "^4.0.5",
|
|
163
163
|
"@types/qs": "^6.9.7",
|
|
164
164
|
"@types/tmp": "^0.2.3",
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"beacon",
|
|
172
172
|
"blockchain"
|
|
173
173
|
],
|
|
174
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "ee0caaaf2a31f4b0d06d219c8582039dadf80377"
|
|
175
175
|
}
|
|
@@ -542,11 +542,7 @@ export function getBeaconBlockApi(
|
|
|
542
542
|
})
|
|
543
543
|
);
|
|
544
544
|
return {
|
|
545
|
-
data: result.filter(
|
|
546
|
-
(item) =>
|
|
547
|
-
// skip if no slot filter
|
|
548
|
-
!(slot !== undefined && slot !== 0) || item.header.message.slot === slot
|
|
549
|
-
),
|
|
545
|
+
data: result.filter((item) => slot === undefined || item.header.message.slot === slot),
|
|
550
546
|
meta: {executionOptimistic, finalized},
|
|
551
547
|
};
|
|
552
548
|
}
|
package/src/api/impl/errors.ts
CHANGED
|
@@ -28,6 +28,16 @@ export class NodeIsSyncing extends ApiError {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* A service that is not ready to serve the request yet, e.g. while it is starting up. Expected to happen for every
|
|
33
|
+
* request until it is ready, the REST API server logs it at debug instead of as a warning
|
|
34
|
+
*/
|
|
35
|
+
export class ServiceNotReady extends ApiError {
|
|
36
|
+
constructor(message: string) {
|
|
37
|
+
super(503, message);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
// Error thrown by beacon node APIs that are only supported by distributed validator middleware clients
|
|
32
42
|
// For example https://github.com/ethereum/beacon-APIs/blob/f087fbf2764e657578a6c29bdf0261b36ee8db1e/apis/validator/beacon_committee_selections.yaml
|
|
33
43
|
export class OnlySupportedByDVT extends ApiError {
|
package/src/api/rest/base.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {NUMBER_OF_COLUMNS} from "@lodestar/params";
|
|
|
7
7
|
import {ErrorAborted, Gauge, Histogram, Logger} from "@lodestar/utils";
|
|
8
8
|
import {GossipActionError} from "../../chain/errors/gossipValidation.js";
|
|
9
9
|
import {isLocalhostIP} from "../../util/ip.js";
|
|
10
|
-
import {ApiError, FailureList, IndexedError, NodeIsSyncing} from "../impl/errors.js";
|
|
10
|
+
import {ApiError, FailureList, IndexedError, NodeIsSyncing, ServiceNotReady} from "../impl/errors.js";
|
|
11
11
|
import {HttpActiveSocketsTracker, SocketMetrics} from "./activeSockets.js";
|
|
12
12
|
|
|
13
13
|
export type RestApiServerOpts = {
|
|
@@ -178,7 +178,9 @@ export class RestApiServer {
|
|
|
178
178
|
|
|
179
179
|
const operationId = getOperationId(req);
|
|
180
180
|
|
|
181
|
-
if (
|
|
181
|
+
if (err instanceof ServiceNotReady) {
|
|
182
|
+
this.logger.debug(`Req ${req.id} ${operationId} failed`, {reason: err.message});
|
|
183
|
+
} else if (
|
|
182
184
|
err instanceof ApiError ||
|
|
183
185
|
err instanceof GossipActionError ||
|
|
184
186
|
[INVALID_MEDIA_TYPE_CODE, SCHEMA_VALIDATION_ERROR_CODE].includes(err.code)
|
|
@@ -8,6 +8,7 @@ import {JobItemQueue} from "../util/queue/index.js";
|
|
|
8
8
|
import {BlockInputColumns} from "./blocks/blockInput/index.js";
|
|
9
9
|
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
10
10
|
import {ChainEventEmitter} from "./emitter.js";
|
|
11
|
+
import {SeenDataColumnSidecars} from "./seenCache/seenDataColumnSidecars.js";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Minimum time to wait before attempting reconstruction
|
|
@@ -31,6 +32,7 @@ export type ColumnReconstructionInput = BlockInputColumns | PayloadEnvelopeInput
|
|
|
31
32
|
export type ColumnReconstructionTrackerInit = {
|
|
32
33
|
logger: Logger;
|
|
33
34
|
emitter: ChainEventEmitter;
|
|
35
|
+
seenDataColumnSidecars: SeenDataColumnSidecars;
|
|
34
36
|
metrics: Metrics | null;
|
|
35
37
|
config: ChainForkConfig;
|
|
36
38
|
signal: AbortSignal;
|
|
@@ -44,6 +46,7 @@ export type ColumnReconstructionTrackerInit = {
|
|
|
44
46
|
export class ColumnReconstructionTracker {
|
|
45
47
|
logger: Logger;
|
|
46
48
|
emitter: ChainEventEmitter;
|
|
49
|
+
seenDataColumnSidecars: SeenDataColumnSidecars;
|
|
47
50
|
metrics: Metrics | null;
|
|
48
51
|
config: ChainForkConfig;
|
|
49
52
|
|
|
@@ -54,6 +57,7 @@ export class ColumnReconstructionTracker {
|
|
|
54
57
|
constructor(init: ColumnReconstructionTrackerInit) {
|
|
55
58
|
this.logger = init.logger;
|
|
56
59
|
this.emitter = init.emitter;
|
|
60
|
+
this.seenDataColumnSidecars = init.seenDataColumnSidecars;
|
|
57
61
|
this.metrics = init.metrics;
|
|
58
62
|
this.config = init.config;
|
|
59
63
|
this.signal = init.signal;
|
|
@@ -104,7 +108,7 @@ export class ColumnReconstructionTracker {
|
|
|
104
108
|
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
105
109
|
this.logger.debug("Attempting data column sidecar reconstruction", logCtx);
|
|
106
110
|
try {
|
|
107
|
-
const result = await recoverDataColumnSidecars(input, this.emitter, this.metrics);
|
|
111
|
+
const result = await recoverDataColumnSidecars(input, this.emitter, this.seenDataColumnSidecars, this.metrics);
|
|
108
112
|
this.metrics?.recoverDataColumnSidecars.reconstructionResult.inc({result});
|
|
109
113
|
this.logger.debug("Data column sidecar reconstruction complete", {...logCtx, result});
|
|
110
114
|
} catch (e) {
|
|
@@ -8,6 +8,7 @@ import {DataColumnEngineResult, getDataColumnSidecarsFromExecution} from "../uti
|
|
|
8
8
|
import {IBlockInput, isBlockInputColumns} from "./blocks/blockInput/index.js";
|
|
9
9
|
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
10
10
|
import {ChainEventEmitter} from "./emitter.js";
|
|
11
|
+
import {SeenDataColumnSidecars} from "./seenCache/seenDataColumnSidecars.js";
|
|
11
12
|
|
|
12
13
|
/** A `null` answer only changes if the EL receives the transactions later, so retries are few and spaced out */
|
|
13
14
|
export const MAX_GET_BLOBS_ATTEMPTS = 3;
|
|
@@ -18,6 +19,7 @@ export type GetBlobsTrackerInit = {
|
|
|
18
19
|
logger: Logger;
|
|
19
20
|
executionEngine: Pick<IExecutionEngine, "getBlobs">;
|
|
20
21
|
emitter: ChainEventEmitter;
|
|
22
|
+
seenDataColumnSidecars: SeenDataColumnSidecars;
|
|
21
23
|
metrics: Metrics | null;
|
|
22
24
|
config: ChainForkConfig;
|
|
23
25
|
};
|
|
@@ -29,6 +31,7 @@ export class GetBlobsTracker {
|
|
|
29
31
|
logger: Logger;
|
|
30
32
|
executionEngine: Pick<IExecutionEngine, "getBlobs">;
|
|
31
33
|
emitter: ChainEventEmitter;
|
|
34
|
+
seenDataColumnSidecars: SeenDataColumnSidecars;
|
|
32
35
|
metrics: Metrics | null;
|
|
33
36
|
config: ChainForkConfig;
|
|
34
37
|
activeReconstructions = new Set<string>();
|
|
@@ -42,6 +45,7 @@ export class GetBlobsTracker {
|
|
|
42
45
|
this.logger = init.logger;
|
|
43
46
|
this.executionEngine = init.executionEngine;
|
|
44
47
|
this.emitter = init.emitter;
|
|
48
|
+
this.seenDataColumnSidecars = init.seenDataColumnSidecars;
|
|
45
49
|
this.metrics = init.metrics;
|
|
46
50
|
this.config = init.config;
|
|
47
51
|
}
|
|
@@ -101,6 +105,7 @@ export class GetBlobsTracker {
|
|
|
101
105
|
this.config,
|
|
102
106
|
this.executionEngine,
|
|
103
107
|
this.emitter,
|
|
108
|
+
this.seenDataColumnSidecars,
|
|
104
109
|
input,
|
|
105
110
|
this.metrics,
|
|
106
111
|
this.blobsAndProofsBuffers[freeIndex].buffers
|
package/src/chain/chain.ts
CHANGED
|
@@ -127,6 +127,7 @@ import {
|
|
|
127
127
|
SeenAttesters,
|
|
128
128
|
SeenBlockProposers,
|
|
129
129
|
SeenContributionAndProof,
|
|
130
|
+
SeenDataColumnSidecars,
|
|
130
131
|
SeenExecutionPayloadBids,
|
|
131
132
|
SeenPayloadAttesters,
|
|
132
133
|
SeenPayloadEnvelopeInput,
|
|
@@ -224,6 +225,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
224
225
|
readonly seenAggregatedAttestations: SeenAggregatedAttestations;
|
|
225
226
|
readonly seenExecutionPayloadBids = new SeenExecutionPayloadBids();
|
|
226
227
|
readonly seenBlockProposers = new SeenBlockProposers();
|
|
228
|
+
readonly seenDataColumnSidecars = new SeenDataColumnSidecars();
|
|
227
229
|
/** Proposer indexes with an in-flight proposer slashing production */
|
|
228
230
|
private readonly producingProposerSlashing = new Set<ValidatorIndex>();
|
|
229
231
|
readonly seenSyncCommitteeMessages = new SeenSyncCommitteeMessages();
|
|
@@ -527,12 +529,14 @@ export class BeaconChain implements IBeaconChain {
|
|
|
527
529
|
logger,
|
|
528
530
|
executionEngine: this.executionEngine,
|
|
529
531
|
emitter,
|
|
532
|
+
seenDataColumnSidecars: this.seenDataColumnSidecars,
|
|
530
533
|
metrics,
|
|
531
534
|
config,
|
|
532
535
|
});
|
|
533
536
|
this.columnReconstructionTracker = new ColumnReconstructionTracker({
|
|
534
537
|
logger,
|
|
535
538
|
emitter,
|
|
539
|
+
seenDataColumnSidecars: this.seenDataColumnSidecars,
|
|
536
540
|
metrics,
|
|
537
541
|
config,
|
|
538
542
|
signal,
|
|
@@ -2039,6 +2043,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
2039
2043
|
|
|
2040
2044
|
const finalizedSlot = computeStartSlotAtEpoch(cp.epoch);
|
|
2041
2045
|
this.seenBlockProposers.prune(finalizedSlot);
|
|
2046
|
+
this.seenDataColumnSidecars.prune(finalizedSlot);
|
|
2042
2047
|
|
|
2043
2048
|
// Update validator custody to account for effective balance changes
|
|
2044
2049
|
try {
|
|
@@ -35,6 +35,7 @@ export enum DataColumnSidecarErrorCode {
|
|
|
35
35
|
|
|
36
36
|
// following errors are adapted from the block errors
|
|
37
37
|
ALREADY_KNOWN = "DATA_COLUMN_SIDECAR_ERROR_ALREADY_KNOWN",
|
|
38
|
+
REPEAT_PROPOSAL = "DATA_COLUMN_SIDECAR_ERROR_REPEAT_PROPOSAL",
|
|
38
39
|
FUTURE_SLOT = "DATA_COLUMN_SIDECAR_ERROR_FUTURE_SLOT",
|
|
39
40
|
WOULD_REVERT_FINALIZED_SLOT = "DATA_COLUMN_SIDECAR_ERROR_WOULD_REVERT_FINALIZED_SLOT",
|
|
40
41
|
PARENT_UNKNOWN = "DATA_COLUMN_SIDECAR_ERROR_PARENT_UNKNOWN",
|
|
@@ -79,6 +80,13 @@ export type DataColumnSidecarErrorType =
|
|
|
79
80
|
limit: number;
|
|
80
81
|
}
|
|
81
82
|
| {code: DataColumnSidecarErrorCode.ALREADY_KNOWN; columnIndex: number; slot: Slot}
|
|
83
|
+
| {
|
|
84
|
+
code: DataColumnSidecarErrorCode.REPEAT_PROPOSAL;
|
|
85
|
+
slot: Slot;
|
|
86
|
+
proposerIndex: number;
|
|
87
|
+
columnIndex: number;
|
|
88
|
+
root: RootHex;
|
|
89
|
+
}
|
|
82
90
|
| {code: DataColumnSidecarErrorCode.FUTURE_SLOT; blockSlot: Slot; currentSlot: Slot}
|
|
83
91
|
| {code: DataColumnSidecarErrorCode.WOULD_REVERT_FINALIZED_SLOT; blockSlot: Slot; finalizedSlot: Slot}
|
|
84
92
|
| {
|
|
@@ -318,9 +318,7 @@ export function initializeNativeForkChoice(
|
|
|
318
318
|
: isPostGloas
|
|
319
319
|
? Number(state.latestExecutionPayloadBid.gasLimit)
|
|
320
320
|
: state.latestExecutionPayloadHeader.gasLimit,
|
|
321
|
-
|
|
322
|
-
executionStatus:
|
|
323
|
-
blockHeader.slot === GENESIS_SLOT && !isPostGloasAnchor ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
|
|
321
|
+
executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
|
|
324
322
|
}
|
|
325
323
|
: {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
|
|
326
324
|
|
package/src/chain/interface.ts
CHANGED
|
@@ -68,6 +68,7 @@ import {
|
|
|
68
68
|
SeenAttesters,
|
|
69
69
|
SeenBlockProposers,
|
|
70
70
|
SeenContributionAndProof,
|
|
71
|
+
SeenDataColumnSidecars,
|
|
71
72
|
SeenExecutionPayloadBids,
|
|
72
73
|
SeenPayloadAttesters,
|
|
73
74
|
SeenSyncCommitteeMessages,
|
|
@@ -147,6 +148,7 @@ export interface IBeaconChain {
|
|
|
147
148
|
readonly seenAggregatedAttestations: SeenAggregatedAttestations;
|
|
148
149
|
readonly seenExecutionPayloadBids: SeenExecutionPayloadBids;
|
|
149
150
|
readonly seenBlockProposers: SeenBlockProposers;
|
|
151
|
+
readonly seenDataColumnSidecars: SeenDataColumnSidecars;
|
|
150
152
|
readonly seenSyncCommitteeMessages: SeenSyncCommitteeMessages;
|
|
151
153
|
readonly seenContributionAndProof: SeenContributionAndProof;
|
|
152
154
|
readonly seenAttestationDatas: SeenAttestationDatas;
|
package/src/chain/options.ts
CHANGED
|
@@ -123,8 +123,6 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
123
123
|
maxSkipSlots: 32,
|
|
124
124
|
disableProposerSlashings: false,
|
|
125
125
|
// should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
|
|
126
|
-
// batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
|
|
127
|
-
// since this batch attestation work is designed to work with useWorker=true, make this the lowest value
|
|
128
126
|
minSameMessageSignatureSetsToBatch: 2,
|
|
129
127
|
// as of Feb 2025, this option turned out to be very useful:
|
|
130
128
|
// - it allows to share a persisted checkpoint state to other nodes
|
|
@@ -2,6 +2,7 @@ export {SeenAggregators, SeenAttesters, SeenPayloadAttesters} from "./seenAttest
|
|
|
2
2
|
export {SeenBlockProposers} from "./seenBlockProposers.js";
|
|
3
3
|
export {SeenSyncCommitteeMessages} from "./seenCommittee.js";
|
|
4
4
|
export {SeenContributionAndProof} from "./seenCommitteeContribution.js";
|
|
5
|
+
export {SeenDataColumnSidecars} from "./seenDataColumnSidecars.js";
|
|
5
6
|
export {SeenExecutionPayloadBids} from "./seenExecutionPayloadBids.js";
|
|
6
7
|
export {SeenBlockInput} from "./seenGossipBlockInput.js";
|
|
7
8
|
export {PayloadEnvelopeInput, SeenPayloadEnvelopeInput} from "./seenPayloadEnvelopeInput.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
2
2
|
import {Epoch, RootHex, Slot, ValidatorIndex, phase0} from "@lodestar/types";
|
|
3
|
-
import {MapDef} from "@lodestar/utils";
|
|
3
|
+
import {MapDef, byteArrayEquals} from "@lodestar/utils";
|
|
4
4
|
|
|
5
5
|
/** Two distinct block roots signed by the same proposer for the same slot are sufficient to establish an equivocation */
|
|
6
|
-
const MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL = 2;
|
|
6
|
+
export const MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL = 2;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Keeps a cache to filter block proposals from the same validator in the same slot.
|
|
@@ -44,6 +44,16 @@ export class SeenBlockProposers {
|
|
|
44
44
|
return this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.has(blockRoot) === true;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
hasBlockSignature(
|
|
48
|
+
blockSlot: Slot,
|
|
49
|
+
proposerIndex: ValidatorIndex,
|
|
50
|
+
blockRoot: RootHex,
|
|
51
|
+
signature: Uint8Array
|
|
52
|
+
): boolean {
|
|
53
|
+
const signedBlockHeader = this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.get(blockRoot);
|
|
54
|
+
return signedBlockHeader !== undefined && byteArrayEquals(signedBlockHeader.signature, signature);
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
isEquivocating(blockSlot: Slot, proposerIndex: ValidatorIndex): boolean {
|
|
48
58
|
return (
|
|
49
59
|
(this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.size ?? 0) >=
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {ColumnIndex, RootHex, Slot, ValidatorIndex} from "@lodestar/types";
|
|
2
|
+
import {MapDef} from "@lodestar/utils";
|
|
3
|
+
import {MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL} from "./seenBlockProposers.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Tracks the column indices of valid gossip data column sidecars per slot, proposer and block root,
|
|
7
|
+
* to ignore sidecars of a repeated proposal. Sidecars are accepted for at most two block roots per slot and
|
|
8
|
+
* proposer, same as blocks. Pruned on finalization.
|
|
9
|
+
*/
|
|
10
|
+
export class SeenDataColumnSidecars {
|
|
11
|
+
private readonly columnIndicesBySlot = new MapDef<Slot, MapDef<ValidatorIndex, MapDef<RootHex, Set<ColumnIndex>>>>(
|
|
12
|
+
() => new MapDef(() => new MapDef(() => new Set()))
|
|
13
|
+
);
|
|
14
|
+
private readonly evidenceChecksBySlot = new MapDef<Slot, Set<ValidatorIndex>>(() => new Set());
|
|
15
|
+
private finalizedSlot: Slot = 0;
|
|
16
|
+
|
|
17
|
+
isRepeatProposal(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): boolean {
|
|
18
|
+
const columnIndicesByRoot = this.columnIndicesBySlot.get(slot)?.get(proposerIndex);
|
|
19
|
+
if (columnIndicesByRoot === undefined) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (!columnIndicesByRoot.has(blockRoot) && columnIndicesByRoot.size >= MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
for (const [root, columnIndices] of columnIndicesByRoot) {
|
|
26
|
+
if (root !== blockRoot && columnIndices.has(columnIndex)) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
isKnown(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): boolean {
|
|
34
|
+
return this.columnIndicesBySlot.get(slot)?.get(proposerIndex)?.get(blockRoot)?.has(columnIndex) === true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
add(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): void {
|
|
38
|
+
if (slot < this.finalizedSlot || this.isRepeatProposal(slot, proposerIndex, columnIndex, blockRoot)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.columnIndicesBySlot.getOrDefault(slot).getOrDefault(proposerIndex).getOrDefault(blockRoot).add(columnIndex);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
markEvidenceCheck(slot: Slot, proposerIndex: ValidatorIndex): boolean {
|
|
45
|
+
if (slot < this.finalizedSlot) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const proposers = this.evidenceChecksBySlot.getOrDefault(slot);
|
|
49
|
+
if (proposers.has(proposerIndex)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
proposers.add(proposerIndex);
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
prune(finalizedSlot: Slot): void {
|
|
57
|
+
this.finalizedSlot = finalizedSlot;
|
|
58
|
+
for (const slot of this.columnIndicesBySlot.keys()) {
|
|
59
|
+
if (slot < finalizedSlot) {
|
|
60
|
+
this.columnIndicesBySlot.delete(slot);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
for (const slot of this.evidenceChecksBySlot.keys()) {
|
|
64
|
+
if (slot < finalizedSlot) {
|
|
65
|
+
this.evidenceChecksBySlot.delete(slot);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -76,8 +76,17 @@ export async function validateGossipBlock(
|
|
|
76
76
|
const proposerIndex = block.proposerIndex;
|
|
77
77
|
if (chain.seenBlockProposers.isKnown(blockSlot, proposerIndex)) {
|
|
78
78
|
if (chain.seenBlockProposers.isRepeatProposal(blockSlot, proposerIndex, blockRoot)) {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
if (chain.seenBlockProposers.hasBlockRoot(blockSlot, proposerIndex, blockRoot)) {
|
|
80
|
+
// The root is known with a verified signature, e.g. from the header of a data column sidecar, and a valid
|
|
81
|
+
// BLS signature of the same message by the same proposer is unique
|
|
82
|
+
if (!chain.seenBlockProposers.hasBlockSignature(blockSlot, proposerIndex, blockRoot, signedBlock.signature)) {
|
|
83
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
84
|
+
code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID,
|
|
85
|
+
slot: blockSlot,
|
|
86
|
+
root: blockRoot,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
} else if (!chain.seenBlockProposers.isEquivocating(blockSlot, proposerIndex)) {
|
|
81
90
|
await verifyBlockProposerSignature(chain, signedBlock, blockRoot, {verifyOnMainThread: false});
|
|
82
91
|
chain.seenBlockProposers.observeBlockRoot(blockSlot, proposerIndex, blockRoot, signedBlockHeader);
|
|
83
92
|
}
|
|
@@ -225,7 +225,7 @@ export async function validateGossipFuluDataColumnSidecar(
|
|
|
225
225
|
|
|
226
226
|
// 12) [IGNORE] The sidecar is the first sidecar for the tuple (block_header.slot, block_header.proposer_index,
|
|
227
227
|
// sidecar.index) with valid header signature, sidecar inclusion proof, and kzg proof
|
|
228
|
-
// -- Handled in
|
|
228
|
+
// -- Handled in gossip handler with seenDataColumnSidecars
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// SPEC FUNCTION
|
|
@@ -60,7 +60,7 @@ export async function validateApiVoluntaryExit(
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state, voluntaryExit);
|
|
63
|
+
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state.slot, voluntaryExit);
|
|
64
64
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
65
65
|
throw new VoluntaryExitError(GossipAction.REJECT, {
|
|
66
66
|
code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
|
|
@@ -150,7 +150,7 @@ async function validateVoluntaryExit(
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// [REJECT] The signature is valid
|
|
153
|
-
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state, voluntaryExit);
|
|
153
|
+
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state.slot, voluntaryExit);
|
|
154
154
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
155
155
|
throw new VoluntaryExitError(GossipAction.REJECT, {
|
|
156
156
|
code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Export generic RestApi server for CLI
|
|
2
2
|
|
|
3
|
+
export {ServiceNotReady} from "./api/impl/errors.js";
|
|
3
4
|
export type {RestApiServerMetrics, RestApiServerModules, RestApiServerOpts} from "./api/rest/base.js";
|
|
4
5
|
export {RestApiServer} from "./api/rest/base.js";
|
|
5
6
|
export {persistAnchorState} from "./chain/index.js";
|
|
@@ -81,9 +81,7 @@ function formatActiveResources(): string {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
* This class
|
|
85
|
-
* - In a libp2p worker
|
|
86
|
-
* - In the main thread
|
|
84
|
+
* This class runs in the libp2p worker.
|
|
87
85
|
*
|
|
88
86
|
* libp2p holds the reference to the TCP transport socket. libp2p is in a worker, what components
|
|
89
87
|
* must be in a worker too?
|