@lodestar/beacon-node 1.51.0-dev.8391040477 → 1.51.0-dev.83aae9f53e
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 +17 -27
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +5 -2
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/index.d.ts +6 -0
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +42 -26
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +11 -0
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +85 -27
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +4 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +61 -97
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +6 -5
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +6 -11
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +8 -15
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.js +2 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +12 -9
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +24 -19
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +4 -1
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +18 -7
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +8 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +7 -5
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +3 -3
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +11 -6
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
- package/lib/chain/bls/interface.d.ts +2 -0
- package/lib/chain/bls/interface.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +13 -11
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/types.d.ts +1 -1
- package/lib/chain/bls/multithread/types.d.ts.map +1 -1
- package/lib/chain/bls/multithread/worker.js +1 -1
- package/lib/chain/bls/multithread/worker.js.map +1 -1
- package/lib/chain/bls/singleThread.js +1 -1
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.js +1 -1
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +1 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +4 -4
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +1 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +1 -1
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -3
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +23 -10
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/attestationPool.d.ts +1 -1
- package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/attestationPool.js +15 -4
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js +17 -7
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.js +9 -3
- package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.js +11 -3
- package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +1 -1
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +0 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +0 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +13 -13
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/db/beacon.d.ts +7 -0
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +34 -0
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +1 -1
- package/lib/db/dataColumnStore.d.ts.map +1 -1
- package/lib/db/dataColumnStore.js +1 -4
- package/lib/db/dataColumnStore.js.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.js +5 -5
- package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
- package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -1
- package/lib/db/flatFileStore/slotIndex.js +2 -2
- package/lib/db/flatFileStore/slotIndex.js.map +1 -1
- package/lib/db/interface.d.ts +1 -0
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts +6 -0
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +19 -0
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/execution/builder/apiClient.d.ts +14 -8
- package/lib/execution/builder/apiClient.d.ts.map +1 -1
- package/lib/execution/builder/apiClient.js +12 -10
- package/lib/execution/builder/apiClient.js.map +1 -1
- package/lib/execution/builder/http.d.ts +2 -0
- package/lib/execution/builder/http.d.ts.map +1 -1
- package/lib/execution/builder/http.js +2 -0
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/execution/engine/index.d.ts +1 -1
- package/lib/execution/engine/index.d.ts.map +1 -1
- package/lib/execution/engine/index.js +1 -1
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +1 -1
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +2 -2
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +4 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +10 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/server/http.js +5 -5
- package/lib/metrics/server/http.js.map +1 -1
- package/lib/monitoring/service.js +1 -1
- package/lib/monitoring/service.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +2 -0
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +3 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +1 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +2 -0
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +3 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +2 -0
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/interface.d.ts +2 -0
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +5 -1
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +2 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +6 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts +2 -0
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts +2 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.d.ts +9 -1
- package/lib/network/peers/utils/assertPeerRelevance.d.ts.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.js +32 -21
- package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +13 -10
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/node/nodejs.d.ts +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +11 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/options.d.ts +3 -1
- package/lib/node/options.d.ts.map +1 -1
- package/lib/node/options.js +4 -2
- package/lib/node/options.js.map +1 -1
- package/lib/sync/interface.d.ts.map +1 -1
- package/lib/sync/interface.js.map +1 -1
- package/lib/sync/sync.d.ts +7 -0
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +61 -3
- package/lib/sync/sync.js.map +1 -1
- package/lib/util/file.d.ts.map +1 -1
- package/lib/util/file.js +8 -9
- package/lib/util/file.js.map +1 -1
- package/lib/util/queue/itemQueue.js +1 -1
- package/lib/util/queue/itemQueue.js.map +1 -1
- package/lib/util/sszBytes.js +2 -2
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +16 -17
- package/src/api/impl/beacon/blocks/index.ts +35 -45
- package/src/api/impl/beacon/pool/index.ts +5 -1
- package/src/api/impl/beacon/state/utils.ts +1 -1
- package/src/api/impl/validator/index.ts +47 -30
- package/src/chain/GetBlobsTracker.ts +97 -38
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +76 -130
- package/src/chain/blocks/importBlock.ts +8 -7
- package/src/chain/blocks/importExecutionPayload.ts +13 -21
- package/src/chain/blocks/index.ts +6 -2
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +35 -24
- package/src/chain/blocks/types.ts +4 -1
- package/src/chain/blocks/verifyBlock.ts +31 -16
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +10 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +7 -5
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +14 -6
- package/src/chain/bls/interface.ts +2 -0
- package/src/chain/bls/multithread/index.ts +14 -10
- package/src/chain/bls/multithread/types.ts +1 -1
- package/src/chain/bls/multithread/worker.ts +1 -5
- package/src/chain/bls/singleThread.ts +1 -1
- package/src/chain/bls/utils.ts +1 -1
- package/src/chain/chain.ts +5 -5
- package/src/chain/errors/blockError.ts +1 -1
- package/src/chain/interface.ts +2 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +25 -9
- package/src/chain/opPools/attestationPool.ts +16 -4
- package/src/chain/opPools/payloadAttestationPool.ts +18 -7
- package/src/chain/opPools/syncCommitteeMessagePool.ts +10 -3
- package/src/chain/opPools/syncContributionAndProofPool.ts +13 -3
- package/src/chain/opPools/utils.ts +1 -1
- package/src/chain/options.ts +0 -2
- package/src/chain/validation/executionPayloadBid.ts +14 -13
- package/src/db/beacon.ts +44 -0
- package/src/db/dataColumnStore.ts +2 -4
- package/src/db/flatFileStore/flatFileStore.ts +7 -7
- package/src/db/flatFileStore/slotIndex.ts +4 -3
- package/src/db/interface.ts +2 -0
- package/src/db/repositories/dataColumnSidecarArchive.ts +20 -0
- package/src/execution/builder/apiClient.ts +16 -13
- package/src/execution/builder/http.ts +4 -0
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +1 -1
- package/src/execution/engine/types.ts +3 -1
- package/src/index.ts +2 -0
- package/src/metrics/metrics/lodestar.ts +10 -0
- package/src/metrics/server/http.ts +5 -5
- package/src/monitoring/service.ts +1 -1
- package/src/network/core/networkCore.ts +5 -0
- package/src/network/core/networkCoreWorker.ts +1 -0
- package/src/network/core/networkCoreWorkerHandler.ts +4 -0
- package/src/network/core/types.ts +2 -0
- package/src/network/interface.ts +2 -0
- package/src/network/libp2p/index.ts +5 -1
- package/src/network/network.ts +8 -1
- package/src/network/options.ts +2 -0
- package/src/network/peers/peerManager.ts +1 -1
- package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
- package/src/network/processor/gossipHandlers.ts +16 -9
- package/src/node/nodejs.ts +25 -7
- package/src/node/options.ts +9 -6
- package/src/sync/interface.ts +1 -0
- package/src/sync/sync.ts +65 -4
- package/src/util/file.ts +8 -9
- package/src/util/queue/itemQueue.ts +1 -1
- package/src/util/sszBytes.ts +2 -2
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.51.0-dev.
|
|
14
|
+
"version": "1.51.0-dev.83aae9f53e",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -105,7 +105,6 @@
|
|
|
105
105
|
"@chainsafe/enr": "^6.0.2",
|
|
106
106
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
107
107
|
"@chainsafe/libp2p-quic": "^2.1.5",
|
|
108
|
-
"@chainsafe/lodestar-z": "catalog:",
|
|
109
108
|
"@chainsafe/persistent-merkle-tree": "^1.3.1",
|
|
110
109
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
111
110
|
"@chainsafe/snappy-wasm": "^0.5.2",
|
|
@@ -127,17 +126,18 @@
|
|
|
127
126
|
"@libp2p/prometheus-metrics": "^5.0.31",
|
|
128
127
|
"@libp2p/tcp": "^11.0.30",
|
|
129
128
|
"@libp2p/utils": "^7.4.3",
|
|
130
|
-
"@lodestar/api": "^1.51.0-dev.
|
|
131
|
-
"@lodestar/config": "^1.51.0-dev.
|
|
132
|
-
"@lodestar/db": "^1.51.0-dev.
|
|
133
|
-
"@lodestar/fork-choice": "^1.51.0-dev.
|
|
134
|
-
"@lodestar/logger": "^1.51.0-dev.
|
|
135
|
-
"@lodestar/
|
|
136
|
-
"@lodestar/
|
|
137
|
-
"@lodestar/
|
|
138
|
-
"@lodestar/
|
|
139
|
-
"@lodestar/
|
|
140
|
-
"@lodestar/
|
|
129
|
+
"@lodestar/api": "^1.51.0-dev.83aae9f53e",
|
|
130
|
+
"@lodestar/config": "^1.51.0-dev.83aae9f53e",
|
|
131
|
+
"@lodestar/db": "^1.51.0-dev.83aae9f53e",
|
|
132
|
+
"@lodestar/fork-choice": "^1.51.0-dev.83aae9f53e",
|
|
133
|
+
"@lodestar/logger": "^1.51.0-dev.83aae9f53e",
|
|
134
|
+
"@lodestar/native": "^1.51.0-dev.83aae9f53e",
|
|
135
|
+
"@lodestar/params": "^1.51.0-dev.83aae9f53e",
|
|
136
|
+
"@lodestar/reqresp": "^1.51.0-dev.83aae9f53e",
|
|
137
|
+
"@lodestar/state-transition": "^1.51.0-dev.83aae9f53e",
|
|
138
|
+
"@lodestar/types": "^1.51.0-dev.83aae9f53e",
|
|
139
|
+
"@lodestar/utils": "^1.51.0-dev.83aae9f53e",
|
|
140
|
+
"@lodestar/validator": "^1.51.0-dev.83aae9f53e",
|
|
141
141
|
"@multiformats/multiaddr": "^13.0.1",
|
|
142
142
|
"datastore-core": "^12.0.1",
|
|
143
143
|
"datastore-level": "^13.0.1",
|
|
@@ -159,14 +159,13 @@
|
|
|
159
159
|
"@ethereumjs/rlp": "^4.0.1",
|
|
160
160
|
"@libp2p/interface-internal": "^3.2.0",
|
|
161
161
|
"@libp2p/logger": "^6.2.15",
|
|
162
|
-
"@lodestar/spec-test-util": "^1.51.0-dev.
|
|
163
|
-
"@lodestar/test-utils": "^1.51.0-dev.
|
|
162
|
+
"@lodestar/spec-test-util": "^1.51.0-dev.83aae9f53e",
|
|
163
|
+
"@lodestar/test-utils": "^1.51.0-dev.83aae9f53e",
|
|
164
164
|
"@types/js-yaml": "^4.0.5",
|
|
165
165
|
"@types/qs": "^6.9.7",
|
|
166
166
|
"@types/tmp": "^0.2.3",
|
|
167
167
|
"dotenv": "^16.4.5",
|
|
168
168
|
"js-yaml": "^4.1.0",
|
|
169
|
-
"rimraf": "^4.4.1",
|
|
170
169
|
"tmp": "^0.2.1"
|
|
171
170
|
},
|
|
172
171
|
"keywords": [
|
|
@@ -175,5 +174,5 @@
|
|
|
175
174
|
"beacon",
|
|
176
175
|
"blockchain"
|
|
177
176
|
],
|
|
178
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "92f4d1484892d1df5c4f342b2bcddcb0755f9e65"
|
|
179
178
|
}
|
|
@@ -316,18 +316,8 @@ export function getBeaconBlockApi(
|
|
|
316
316
|
break;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
case routes.beacon.BroadcastValidation.none: {
|
|
320
|
-
chain.logger.debug("Skipping broadcast validation", valLogMeta);
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
319
|
default: {
|
|
325
|
-
|
|
326
|
-
const message = `Broadcast validation of ${broadcastValidation} type not implemented yet`;
|
|
327
|
-
if (chain.opts.broadcastValidationStrictness === "error") {
|
|
328
|
-
throw Error(message);
|
|
329
|
-
}
|
|
330
|
-
chain.logger.warn(message, valLogMeta);
|
|
320
|
+
throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
|
|
331
321
|
}
|
|
332
322
|
}
|
|
333
323
|
|
|
@@ -397,26 +387,24 @@ export function getBeaconBlockApi(
|
|
|
397
387
|
...blobSidecars.map((blobSidecar) => () => network.publishBlobSidecar(blobSidecar)),
|
|
398
388
|
() =>
|
|
399
389
|
// there is no rush to persist block since we published it to gossip anyway
|
|
400
|
-
chain
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
source: BlockInputSource.api,
|
|
415
|
-
});
|
|
416
|
-
}
|
|
390
|
+
chain.processBlock(blockForImport, opts).catch((e) => {
|
|
391
|
+
if (e instanceof BlockError) {
|
|
392
|
+
switch (e.type.code) {
|
|
393
|
+
case BlockErrorCode.ALREADY_KNOWN:
|
|
394
|
+
// Block was imported while publishing, e.g. received via gossip
|
|
395
|
+
chain.logger.debug("Ignoring already-known block during publishing", valLogMeta);
|
|
396
|
+
return;
|
|
397
|
+
case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
|
|
398
|
+
case BlockErrorCode.PARENT_PAYLOAD_UNKNOWN:
|
|
399
|
+
chain.emitter.emit(ChainEvent.blockUnknownParent, {
|
|
400
|
+
blockInput: blockForImport,
|
|
401
|
+
peer: IDENTITY_PEER_ID,
|
|
402
|
+
source: BlockInputSource.api,
|
|
403
|
+
});
|
|
417
404
|
}
|
|
418
|
-
|
|
419
|
-
|
|
405
|
+
}
|
|
406
|
+
throw e;
|
|
407
|
+
}),
|
|
420
408
|
];
|
|
421
409
|
const sentPeersArr = await promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
|
|
422
410
|
publishPromises
|
|
@@ -804,11 +792,6 @@ export function getBeaconBlockApi(
|
|
|
804
792
|
};
|
|
805
793
|
try {
|
|
806
794
|
switch (broadcastValidation) {
|
|
807
|
-
case routes.beacon.BroadcastValidation.none: {
|
|
808
|
-
chain.logger.debug("Skipping broadcast validation of execution payload envelope", valLogMeta);
|
|
809
|
-
break;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
795
|
case routes.beacon.BroadcastValidation.gossip: {
|
|
813
796
|
await validateApiExecutionPayloadEnvelope(chain, signedExecutionPayloadEnvelope);
|
|
814
797
|
break;
|
|
@@ -847,11 +830,7 @@ export function getBeaconBlockApi(
|
|
|
847
830
|
}
|
|
848
831
|
|
|
849
832
|
default: {
|
|
850
|
-
|
|
851
|
-
if (chain.opts.broadcastValidationStrictness === "error") {
|
|
852
|
-
throw Error(message);
|
|
853
|
-
}
|
|
854
|
-
chain.logger.warn(message, valLogMeta);
|
|
833
|
+
throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
|
|
855
834
|
}
|
|
856
835
|
}
|
|
857
836
|
} catch (error) {
|
|
@@ -1003,9 +982,13 @@ export function getBeaconBlockApi(
|
|
|
1003
982
|
() => network.publishSignedExecutionPayloadEnvelope(signedExecutionPayloadEnvelope),
|
|
1004
983
|
// Publish all data column sidecars
|
|
1005
984
|
...dataColumnSidecars.map((dataColumnSidecar) => () => network.publishDataColumnSidecar(dataColumnSidecar)),
|
|
1006
|
-
// Import execution payload
|
|
1007
|
-
|
|
1008
|
-
|
|
985
|
+
// Import execution payload
|
|
986
|
+
() =>
|
|
987
|
+
chain.processExecutionPayload(payloadInput, {
|
|
988
|
+
// Signature is verified during broadcast validation only for the submitted envelope,
|
|
989
|
+
// an envelope cached by another source is verified at import
|
|
990
|
+
validSignature: payloadInput.getPayloadEnvelope() === signedExecutionPayloadEnvelope,
|
|
991
|
+
}),
|
|
1009
992
|
];
|
|
1010
993
|
|
|
1011
994
|
const publishPromise = promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
|
|
@@ -1109,7 +1092,7 @@ export function getBeaconBlockApi(
|
|
|
1109
1092
|
},
|
|
1110
1093
|
|
|
1111
1094
|
async getSignedExecutionPayloadEnvelope({blockId}, context) {
|
|
1112
|
-
const {block,
|
|
1095
|
+
const {block, finalized} = await getBlockResponse(chain, blockId);
|
|
1113
1096
|
const slot = block.message.slot;
|
|
1114
1097
|
const fork = config.getForkName(slot);
|
|
1115
1098
|
|
|
@@ -1123,6 +1106,13 @@ export function getBeaconBlockApi(
|
|
|
1123
1106
|
const blockRoot = config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block.message);
|
|
1124
1107
|
const blockRootHex = toRootHex(blockRoot);
|
|
1125
1108
|
|
|
1109
|
+
// The block's own flag is the status of the payload it builds on, the envelope's is that of its
|
|
1110
|
+
// FULL variant. An unfinalized block without one has not imported its envelope yet.
|
|
1111
|
+
const payload = finalized ? null : chain.forkChoice.getBlockHex(blockRootHex, PayloadStatus.FULL);
|
|
1112
|
+
if (!finalized && payload === null) {
|
|
1113
|
+
throw new ApiError(404, `Execution payload envelope not found for slot=${slot}, blockRoot=${blockRootHex}`);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1126
1116
|
let data: Uint8Array | gloas.SignedExecutionPayloadEnvelope | null;
|
|
1127
1117
|
try {
|
|
1128
1118
|
data = context?.returnBytes
|
|
@@ -1147,7 +1137,7 @@ export function getBeaconBlockApi(
|
|
|
1147
1137
|
|
|
1148
1138
|
return {
|
|
1149
1139
|
data,
|
|
1150
|
-
meta: {executionOptimistic, finalized, version: fork},
|
|
1140
|
+
meta: {executionOptimistic: payload !== null && isOptimisticBlock(payload), finalized, version: fork},
|
|
1151
1141
|
};
|
|
1152
1142
|
},
|
|
1153
1143
|
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
PayloadAttestationError,
|
|
18
18
|
PayloadAttestationErrorCode,
|
|
19
19
|
SyncCommitteeError,
|
|
20
|
+
SyncCommitteeErrorCode,
|
|
20
21
|
} from "../../../../chain/errors/index.js";
|
|
21
22
|
import {validateApiAttesterSlashing} from "../../../../chain/validation/attesterSlashing.js";
|
|
22
23
|
import {validateApiBlsToExecutionChange} from "../../../../chain/validation/blsToExecutionChange.js";
|
|
@@ -340,7 +341,10 @@ export function getBeaconPoolApi({
|
|
|
340
341
|
const synCommittee = state.getIndexedSyncCommittee(signature.slot);
|
|
341
342
|
const indexesInCommittee = synCommittee.validatorIndexMap.get(signature.validatorIndex);
|
|
342
343
|
if (indexesInCommittee === undefined || indexesInCommittee.length === 0) {
|
|
343
|
-
|
|
344
|
+
throw new SyncCommitteeError(GossipAction.REJECT, {
|
|
345
|
+
code: SyncCommitteeErrorCode.VALIDATOR_NOT_IN_SYNC_COMMITTEE,
|
|
346
|
+
validatorIndex: signature.validatorIndex,
|
|
347
|
+
});
|
|
344
348
|
}
|
|
345
349
|
|
|
346
350
|
// Verify signature only, all other data is very likely to be correct, since the `signature` object is created by this node.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {type PubkeyCache} from "@chainsafe/lodestar-z/pubkeys";
|
|
2
1
|
import {routes} from "@lodestar/api";
|
|
3
2
|
import {CheckpointWithHex, IForkChoice} from "@lodestar/fork-choice";
|
|
3
|
+
import {type PubkeyCache} from "@lodestar/native/pubkeys";
|
|
4
4
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
5
5
|
import {IBeaconStateView, IBeaconStateViewGloas} from "@lodestar/state-transition";
|
|
6
6
|
import {
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
import {validateGossipProposerPreferences} from "../../../chain/validation/proposerPreferences.js";
|
|
95
95
|
import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js";
|
|
96
96
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
97
|
-
import {
|
|
97
|
+
import {BuilderApiBid, decodeBuilderUrl} from "../../../execution/builder/apiClient.js";
|
|
98
98
|
import {BuilderStatus, NoBidReceived} from "../../../execution/builder/http.js";
|
|
99
99
|
import {getBuilderBidTotalGwei, validateBuilderApiExecutionPayloadBid} from "../../../execution/builder/validateBid.js";
|
|
100
100
|
import {validateGossipFnRetryUnknownRoot} from "../../../network/processor/gossipHandlers.js";
|
|
@@ -123,10 +123,14 @@ import {
|
|
|
123
123
|
* A cutoff of 1667 BPS (2 seconds for 12s slots) gives enough time and if there are unexpected delays
|
|
124
124
|
* it ensures we publish in time as proposals after the attestation deadline will likely be orphaned
|
|
125
125
|
* due to proposer boost reorg.
|
|
126
|
-
*
|
|
127
|
-
* TODO GLOAS: re-evaluate cutoff timing due to attestation deadline changes in gloas
|
|
128
126
|
*/
|
|
129
127
|
const BLOCK_PRODUCTION_RACE_CUTOFF_BPS = 1667;
|
|
128
|
+
/**
|
|
129
|
+
* Post-gloas cutoff, kept at 1667 BPS (2 seconds for 12s slots) for now.
|
|
130
|
+
*
|
|
131
|
+
* TODO GLOAS: revisit, the block propagates faster as it only commits to a bid and the attestation deadline changed
|
|
132
|
+
*/
|
|
133
|
+
export const BLOCK_PRODUCTION_RACE_CUTOFF_GLOAS_BPS = 1667;
|
|
130
134
|
/** Rejection message of the bid block branch when there is no viable bid to commit to */
|
|
131
135
|
const NO_BID_AVAILABLE = "No builder bid available";
|
|
132
136
|
|
|
@@ -1005,33 +1009,50 @@ export function getValidatorApi(
|
|
|
1005
1009
|
(!circuitBreakerActive &&
|
|
1006
1010
|
chain.executionPayloadBidPool.getBestBid(slot, bidParentBlockHash, parentBlockRootHex) !== null);
|
|
1007
1011
|
|
|
1008
|
-
//
|
|
1009
|
-
//
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
});
|
|
1022
|
-
return null;
|
|
1023
|
-
}
|
|
1024
|
-
return p2pBid;
|
|
1025
|
-
});
|
|
1012
|
+
// Calculate cutoff time based on start of the slot, ensures a slow local payload build does
|
|
1013
|
+
// not delay the proposal when a builder bid block is available (and vice versa)
|
|
1014
|
+
const cutoffMs = Math.max(
|
|
1015
|
+
0,
|
|
1016
|
+
config.getSlotComponentDurationMs(fork, BLOCK_PRODUCTION_RACE_CUTOFF_GLOAS_BPS) - chain.clock.msFromSlot(slot)
|
|
1017
|
+
);
|
|
1018
|
+
|
|
1019
|
+
// Give p2p bids the same time to bid up as granted to builder API bid requests via the advertised
|
|
1020
|
+
// deadline, the pool is read once the deadline passed and the bid requests settled. A late request
|
|
1021
|
+
// does not wait past the race cutoff, a pooled bid is still the fastest fallback if the local block fails
|
|
1022
|
+
const bidDeadlinePromise = circuitBreakerActive
|
|
1023
|
+
? Promise.resolve()
|
|
1024
|
+
: sleep(Math.min(chain.builderApiClient.bidDeadline, cutoffMs));
|
|
1026
1025
|
|
|
1027
1026
|
// Candidates are ranked by their boosted counted total payment, the p2p bid is governed
|
|
1028
1027
|
// by the top-level factors and each builder API bid by its own entry. Ties prefer the
|
|
1029
1028
|
// earliest received builder API bid, so the signed block can be routed back to its
|
|
1030
1029
|
// builder directly.
|
|
1031
1030
|
const bestBidPromise: Promise<BidCandidate | null> = (async () => {
|
|
1032
|
-
|
|
1031
|
+
// Past the race cutoff a pooled p2p bid is used right away rather than waiting for pending
|
|
1032
|
+
// builder API requests, the local block is selected at the cutoff anyway if it is ready
|
|
1033
|
+
let [builderApiBids] = await Promise.all([
|
|
1034
|
+
Promise.race([builderApiBidsPromise, sleep(cutoffMs).then(() => null)]),
|
|
1035
|
+
bidDeadlinePromise,
|
|
1036
|
+
]);
|
|
1033
1037
|
let parentExecutionRequestsPromise: Promise<gloas.ExecutionRequests> | null = null;
|
|
1034
1038
|
|
|
1039
|
+
let p2pBid: PooledExecutionPayloadBid | null = circuitBreakerActive
|
|
1040
|
+
? null
|
|
1041
|
+
: chain.executionPayloadBidPool.getBestBid(slot, bidParentBlockHash, parentBlockRootHex);
|
|
1042
|
+
// Discard p2p bids below the proposer's configured floor on the total payment.
|
|
1043
|
+
// A p2p bid's total is just its value since gossip validation enforces executionPayment=0.
|
|
1044
|
+
if (p2pBid !== null && BigInt(p2pBid.signedBid.message.value) < builderConfig.minBid) {
|
|
1045
|
+
logger.info("Best p2p bid below configured minimum", {
|
|
1046
|
+
slot,
|
|
1047
|
+
bidValue: prettyGweiToEth(p2pBid.signedBid.message.value),
|
|
1048
|
+
minBid: prettyGweiToEth(builderConfig.minBid),
|
|
1049
|
+
});
|
|
1050
|
+
p2pBid = null;
|
|
1051
|
+
}
|
|
1052
|
+
if (builderApiBids === null) {
|
|
1053
|
+
builderApiBids = p2pBid !== null ? [] : await builderApiBidsPromise;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1035
1056
|
const candidates = (
|
|
1036
1057
|
await Promise.all(
|
|
1037
1058
|
builderApiBids.map(async ({url, entry, signedBid, receivedMs}): Promise<BidCandidate | null> => {
|
|
@@ -1118,13 +1139,6 @@ export function getValidatorApi(
|
|
|
1118
1139
|
return fn().finally(() => t?.({source}));
|
|
1119
1140
|
};
|
|
1120
1141
|
|
|
1121
|
-
// Calculate cutoff time based on start of the slot, ensures a slow local payload build does
|
|
1122
|
-
// not delay the proposal when a builder bid block is available (and vice versa)
|
|
1123
|
-
const cutoffMs = Math.max(
|
|
1124
|
-
0,
|
|
1125
|
-
config.getSlotComponentDurationMs(fork, BLOCK_PRODUCTION_RACE_CUTOFF_BPS) - chain.clock.msFromSlot(slot)
|
|
1126
|
-
);
|
|
1127
|
-
|
|
1128
1142
|
// use abort controller to stop waiting for the bid block if the engine block will be selected
|
|
1129
1143
|
const controller = new AbortController();
|
|
1130
1144
|
|
|
@@ -1756,7 +1770,10 @@ export function getValidatorApi(
|
|
|
1756
1770
|
}
|
|
1757
1771
|
}
|
|
1758
1772
|
|
|
1759
|
-
|
|
1773
|
+
// The fork epoch PTC is computed at the fork from effective balances updated at the end of the
|
|
1774
|
+
// last pre-fork epoch, so its dependent root is one epoch later than for other epochs
|
|
1775
|
+
const dependentRootEpoch = epoch === config.GLOAS_FORK_EPOCH ? epoch + 1 : epoch;
|
|
1776
|
+
const dependentRoot = fromHex(state.getShufflingDecisionRoot(dependentRootEpoch));
|
|
1760
1777
|
|
|
1761
1778
|
return {
|
|
1762
1779
|
data: duties,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
3
|
-
import {Logger} from "@lodestar/utils";
|
|
3
|
+
import {Logger, pruneSetToMax} from "@lodestar/utils";
|
|
4
4
|
import {BLOB_AND_PROOF_V2_RPC_BYTES} from "../execution/engine/types.js";
|
|
5
5
|
import {IExecutionEngine} from "../execution/index.js";
|
|
6
6
|
import {Metrics} from "../metrics/metrics.js";
|
|
7
|
-
import {callInNextEventLoop} from "../util/eventLoop.js";
|
|
8
7
|
import {
|
|
9
8
|
DataColumnEngineResult,
|
|
10
9
|
getBlobSidecarsFromExecution,
|
|
@@ -14,6 +13,11 @@ import {IBlockInput, isBlockInputBlobs} from "./blocks/blockInput/index.js";
|
|
|
14
13
|
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
15
14
|
import {ChainEventEmitter} from "./emitter.js";
|
|
16
15
|
|
|
16
|
+
/** A `null` answer only changes if the EL receives the transactions later, so retries are few and spaced out */
|
|
17
|
+
export const MAX_GET_BLOBS_ATTEMPTS = 3;
|
|
18
|
+
export const GET_BLOBS_RETRY_INTERVAL_MS = 1000;
|
|
19
|
+
const MAX_TRACKED_BLOCK_ROOTS = 64;
|
|
20
|
+
|
|
17
21
|
export type GetBlobsTrackerInit = {
|
|
18
22
|
logger: Logger;
|
|
19
23
|
executionEngine: IExecutionEngine;
|
|
@@ -32,6 +36,8 @@ export class GetBlobsTracker {
|
|
|
32
36
|
metrics: Metrics | null;
|
|
33
37
|
config: ChainForkConfig;
|
|
34
38
|
activeReconstructions = new Set<string>();
|
|
39
|
+
failedAttempts = new Map<string, {count: number; lastAttemptMs: number; retryTimer?: NodeJS.Timeout}>();
|
|
40
|
+
pendingTriggers = new Set<string>();
|
|
35
41
|
// Preallocate buffers for getBlobsV2 RPC calls
|
|
36
42
|
// See https://github.com/ChainSafe/lodestar/pull/8282 for context
|
|
37
43
|
blobsAndProofsBuffers: {buffers: Uint8Array[]; inUse: boolean}[] = [];
|
|
@@ -46,23 +52,55 @@ export class GetBlobsTracker {
|
|
|
46
52
|
|
|
47
53
|
triggerGetBlobs(input: IBlockInput | PayloadEnvelopeInput): void {
|
|
48
54
|
if (this.activeReconstructions.has(input.blockRootHex)) {
|
|
55
|
+
this.pendingTriggers.add(input.blockRootHex);
|
|
49
56
|
return;
|
|
50
57
|
}
|
|
51
58
|
|
|
59
|
+
const failed = this.failedAttempts.get(input.blockRootHex);
|
|
60
|
+
if (failed) {
|
|
61
|
+
if (failed.count >= MAX_GET_BLOBS_ATTEMPTS) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const waitMs = GET_BLOBS_RETRY_INTERVAL_MS - (Date.now() - failed.lastAttemptMs);
|
|
65
|
+
if (waitMs > 0) {
|
|
66
|
+
// Columns tend to arrive in one burst, so keep a single trailing retry instead of relying on a later trigger
|
|
67
|
+
failed.retryTimer ??= setTimeout(() => {
|
|
68
|
+
failed.retryTimer = undefined;
|
|
69
|
+
if (this.failedAttempts.get(input.blockRootHex) === failed && !input.hasAllData()) {
|
|
70
|
+
this.triggerGetBlobs(input);
|
|
71
|
+
}
|
|
72
|
+
}, waitMs).unref();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// The request is sent right away, before block processing issues newPayload: ELs that drop a
|
|
78
|
+
// transaction's blobs once the payload is validated can only answer a request that gets there first
|
|
52
79
|
if (!(input instanceof PayloadEnvelopeInput) && isBlockInputBlobs(input)) {
|
|
53
80
|
// there is not preallocation for blob sidecars like there is for columns sidecars so no need to
|
|
54
81
|
// store the index for the preallocated buffers
|
|
55
82
|
this.activeReconstructions.add(input.blockRootHex);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
83
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
84
|
+
this.logger.verbose("Trigger getBlobsV1 for block", logCtx);
|
|
85
|
+
let requestFailed = false;
|
|
86
|
+
getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter, input)
|
|
87
|
+
.then(() => {
|
|
88
|
+
// EL errors and misses are handled inside the helper, blobs still missing means the attempt failed
|
|
89
|
+
if (!input.hasAllData()) {
|
|
90
|
+
requestFailed = true;
|
|
91
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
63
92
|
}
|
|
64
|
-
)
|
|
65
|
-
|
|
93
|
+
})
|
|
94
|
+
.catch((error) => {
|
|
95
|
+
this.logger.debug("Error during getBlobsV1 for block", logCtx, error as Error);
|
|
96
|
+
requestFailed = true;
|
|
97
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
98
|
+
})
|
|
99
|
+
.finally(() => {
|
|
100
|
+
this.logger.verbose("Completed getBlobsV1 for block", logCtx);
|
|
101
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
102
|
+
this.retryPendingTrigger(input, requestFailed);
|
|
103
|
+
});
|
|
66
104
|
|
|
67
105
|
return;
|
|
68
106
|
}
|
|
@@ -83,34 +121,55 @@ export class GetBlobsTracker {
|
|
|
83
121
|
}
|
|
84
122
|
timer?.();
|
|
85
123
|
|
|
86
|
-
// We don't care about the outcome of this call,
|
|
87
|
-
// just that it has been triggered for this block root.
|
|
88
124
|
this.activeReconstructions.add(input.blockRootHex);
|
|
89
125
|
this.blobsAndProofsBuffers[freeIndex].inUse = true;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
126
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
127
|
+
this.logger.verbose("Trigger getBlobsV2 for block", logCtx);
|
|
128
|
+
let requestFailed = false;
|
|
129
|
+
getDataColumnSidecarsFromExecution(
|
|
130
|
+
this.config,
|
|
131
|
+
this.executionEngine,
|
|
132
|
+
this.emitter,
|
|
133
|
+
input,
|
|
134
|
+
this.metrics,
|
|
135
|
+
this.blobsAndProofsBuffers[freeIndex].buffers
|
|
136
|
+
)
|
|
137
|
+
.then((result) => {
|
|
138
|
+
this.logger.debug("getBlobsV2 result for block", {...logCtx, result});
|
|
139
|
+
this.metrics?.dataColumns.dataColumnEngineResult.inc({result});
|
|
140
|
+
if (result === DataColumnEngineResult.NullResponse) {
|
|
141
|
+
requestFailed = true;
|
|
142
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
.catch((error) => {
|
|
146
|
+
this.logger.debug("Error during getBlobsV2 for block", logCtx, error as Error);
|
|
147
|
+
this.metrics?.dataColumns.dataColumnEngineResult.inc({result: DataColumnEngineResult.Failed});
|
|
148
|
+
requestFailed = true;
|
|
149
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
150
|
+
})
|
|
151
|
+
.finally(() => {
|
|
152
|
+
this.logger.verbose("Completed getBlobsV2 for block", logCtx);
|
|
153
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
154
|
+
this.blobsAndProofsBuffers[freeIndex].inUse = false;
|
|
155
|
+
this.retryPendingTrigger(input, requestFailed);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
private retryPendingTrigger(input: IBlockInput | PayloadEnvelopeInput, requestFailed: boolean): void {
|
|
160
|
+
// Triggers dropped while the request was in flight re-enter once it failed, the attempt that was just
|
|
161
|
+
// recorded makes this arm the trailing retry instead of sending another request right away.
|
|
162
|
+
// Post-gloas only the bid triggers a request, so every failed attempt re-enters to arm its own retry
|
|
163
|
+
const hadPendingTrigger = this.pendingTriggers.delete(input.blockRootHex);
|
|
164
|
+
if (requestFailed && (hadPendingTrigger || input instanceof PayloadEnvelopeInput)) {
|
|
165
|
+
this.triggerGetBlobs(input);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
private recordFailedAttempt(blockRootHex: string): void {
|
|
170
|
+
const failed = this.failedAttempts.get(blockRootHex);
|
|
171
|
+
clearTimeout(failed?.retryTimer);
|
|
172
|
+
this.failedAttempts.set(blockRootHex, {count: (failed?.count ?? 0) + 1, lastAttemptMs: Date.now()});
|
|
173
|
+
pruneSetToMax(this.failedAttempts, MAX_TRACKED_BLOCK_ROOTS);
|
|
115
174
|
}
|
|
116
175
|
}
|
|
@@ -197,6 +197,7 @@ export class ArchiveStore {
|
|
|
197
197
|
//
|
|
198
198
|
// `jobQueue.push()` can throw synchronously (queue aborted / full) or reject asynchronously;
|
|
199
199
|
// awaiting it inside the deferred callback funnels both failure modes into the one catch.
|
|
200
|
+
// biome-ignore lint/nursery/noMisusedPromises: the callback catches all errors itself
|
|
200
201
|
callInNextEventLoop(async () => {
|
|
201
202
|
try {
|
|
202
203
|
await this.jobQueue.push(finalized);
|