@lodestar/beacon-node 1.51.0-dev.d422f387ac → 1.51.0-dev.d5620be4a1
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 +19 -61
- 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 +17 -0
- package/lib/api/impl/beacon/pool/index.js.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 +38 -25
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -2
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +7 -31
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +11 -56
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +5 -241
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.d.ts +2 -4
- package/lib/chain/blocks/blockInput/errors.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/errors.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +2 -18
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +0 -1
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +36 -53
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +4 -0
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +24 -3
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +2 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +4 -20
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +0 -24
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +17 -6
- 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 +6 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +7 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +4 -0
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +10 -5
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts +0 -2
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +6 -24
- package/lib/chain/blocks/writeBlockInputToDb.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 +1 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +45 -17
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/chain.d.ts +24 -3
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +120 -39
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +7 -7
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -5
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +7 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/index.d.ts +0 -1
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +0 -1
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +11 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +11 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.d.ts +51 -0
- package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -0
- package/lib/chain/forkChoiceExecutionEngine.js +117 -0
- package/lib/chain/forkChoiceExecutionEngine.js.map +1 -0
- package/lib/chain/interface.d.ts +7 -4
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +17 -4
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +177 -37
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/index.d.ts +1 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +1 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/singleAttestationPool.d.ts +77 -0
- package/lib/chain/opPools/singleAttestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/singleAttestationPool.js +209 -0
- package/lib/chain/opPools/singleAttestationPool.js.map +1 -0
- package/lib/chain/options.d.ts +5 -2
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +3 -2
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/proposerTracker.d.ts +31 -0
- package/lib/chain/proposerTracker.d.ts.map +1 -0
- package/lib/chain/proposerTracker.js +75 -0
- package/lib/chain/proposerTracker.js.map +1 -0
- package/lib/chain/regen/interface.d.ts +1 -1
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +1 -1
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +5 -3
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -14
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +6 -65
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts +6 -0
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +53 -0
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +1 -2
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +0 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/repositories/blobSidecars.d.ts +0 -1
- package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.js +0 -1
- package/lib/db/repositories/blobSidecars.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/http.d.ts +4 -6
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +8 -10
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +17 -5
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -4
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +2 -12
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +0 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +0 -4
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -4
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +1 -15
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +0 -9
- package/lib/execution/engine/sszTypes.d.ts.map +1 -1
- package/lib/execution/engine/sszTypes.js +0 -5
- package/lib/execution/engine/sszTypes.js.map +1 -1
- package/lib/execution/engine/transport.d.ts +1 -14
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +0 -8
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +0 -8
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts.map +1 -1
- package/lib/execution/engine/utils.js +3 -2
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +0 -9
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +0 -30
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +27 -8
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +74 -18
- 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/network/core/networkCore.d.ts +2 -1
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +4 -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 -1
- 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 +4 -1
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +1 -0
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +10 -0
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +1 -8
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +0 -1
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +0 -16
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +0 -23
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +2 -5
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +6 -7
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +50 -37
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +2 -0
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +28 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +4 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +8 -16
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/peers/utils/subnetMap.d.ts +5 -2
- package/lib/network/peers/utils/subnetMap.d.ts.map +1 -1
- package/lib/network/peers/utils/subnetMap.js +6 -3
- package/lib/network/peers/utils/subnetMap.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +1 -8
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +43 -123
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +0 -6
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +1 -5
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts +6 -0
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +29 -4
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +0 -3
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +1 -12
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +0 -2
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +0 -10
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +1 -17
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +2 -8
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +1 -7
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts +35 -5
- package/lib/network/subnets/attnetsService.d.ts.map +1 -1
- package/lib/network/subnets/attnetsService.js +84 -6
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/network/subnets/interface.d.ts +7 -0
- package/lib/network/subnets/interface.d.ts.map +1 -1
- package/lib/network/subnets/interface.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -0
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +37 -19
- 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/range/batch.d.ts +2 -3
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +9 -22
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +2 -15
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +1 -7
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +6 -34
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +24 -128
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +2 -18
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +14 -99
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +1 -7
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +0 -19
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/execution.d.ts +3 -4
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +1 -73
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +5 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +34 -17
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +0 -5
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -2
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +24 -64
- package/src/api/impl/beacon/pool/index.ts +26 -0
- package/src/api/impl/validator/index.ts +43 -29
- package/src/chain/GetBlobsTracker.ts +10 -39
- package/src/chain/blocks/blockInput/blockInput.ts +11 -343
- package/src/chain/blocks/blockInput/errors.ts +1 -2
- package/src/chain/blocks/blockInput/types.ts +2 -20
- package/src/chain/blocks/importBlock.ts +56 -72
- package/src/chain/blocks/importExecutionPayload.ts +42 -13
- package/src/chain/blocks/index.ts +5 -2
- package/src/chain/blocks/types.ts +5 -31
- package/src/chain/blocks/verifyBlock.ts +30 -16
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +6 -1
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -6
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +4 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +10 -5
- package/src/chain/blocks/writeBlockInputToDb.ts +6 -29
- package/src/chain/bls/interface.ts +2 -0
- package/src/chain/bls/multithread/index.ts +43 -19
- package/src/chain/chain.ts +135 -37
- package/src/chain/emitter.ts +8 -8
- package/src/chain/errors/executionPayloadEnvelope.ts +8 -0
- package/src/chain/errors/index.ts +0 -1
- package/src/chain/forkChoice/index.ts +11 -0
- package/src/chain/forkChoiceExecutionEngine.ts +183 -0
- package/src/chain/interface.ts +7 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +222 -35
- package/src/chain/opPools/index.ts +1 -0
- package/src/chain/opPools/singleAttestationPool.ts +287 -0
- package/src/chain/options.ts +5 -2
- package/src/chain/produceBlock/produceBlockBody.ts +7 -3
- package/src/chain/proposerTracker.ts +94 -0
- package/src/chain/regen/interface.ts +1 -1
- package/src/chain/regen/queued.ts +6 -4
- package/src/chain/seenCache/seenGossipBlockInput.ts +9 -93
- package/src/chain/validation/executionPayloadEnvelope.ts +68 -1
- package/src/chain/validatorMonitor.ts +0 -6
- package/src/db/repositories/blobSidecars.ts +0 -1
- package/src/execution/builder/apiClient.ts +16 -13
- package/src/execution/builder/http.ts +4 -0
- package/src/execution/engine/http.ts +19 -42
- package/src/execution/engine/interface.ts +18 -9
- package/src/execution/engine/jsonRpcTransport.ts +10 -22
- package/src/execution/engine/mock.ts +0 -7
- package/src/execution/engine/restTransport.ts +3 -22
- package/src/execution/engine/sszTypes.ts +0 -9
- package/src/execution/engine/transport.ts +8 -17
- package/src/execution/engine/types.ts +0 -17
- package/src/execution/engine/utils.ts +4 -2
- package/src/index.ts +1 -1
- package/src/metrics/metrics/beacon.ts +0 -30
- package/src/metrics/metrics/lodestar.ts +75 -18
- package/src/metrics/server/http.ts +5 -5
- package/src/network/core/networkCore.ts +6 -1
- package/src/network/core/networkCoreWorker.ts +1 -0
- package/src/network/core/networkCoreWorkerHandler.ts +4 -1
- package/src/network/core/types.ts +4 -1
- package/src/network/gossip/gossipsub.ts +11 -0
- package/src/network/gossip/interface.ts +0 -5
- package/src/network/gossip/topic.ts +0 -25
- package/src/network/interface.ts +0 -5
- package/src/network/network.ts +50 -60
- package/src/network/options.ts +2 -0
- package/src/network/peers/peerManager.ts +27 -2
- package/src/network/peers/utils/prioritizePeers.ts +14 -22
- package/src/network/peers/utils/subnetMap.ts +6 -3
- package/src/network/processor/extractSlotRootFns.ts +0 -9
- package/src/network/processor/gossipHandlers.ts +56 -156
- package/src/network/processor/gossipQueues/index.ts +0 -6
- package/src/network/processor/gossipValidatorFn.ts +0 -5
- package/src/network/processor/index.ts +25 -4
- package/src/network/reqresp/ReqRespBeaconNode.ts +0 -7
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -2
- package/src/network/reqresp/handlers/index.ts +0 -17
- package/src/network/reqresp/protocols.ts +0 -12
- package/src/network/reqresp/rateLimit.ts +1 -17
- package/src/network/reqresp/types.ts +0 -13
- package/src/network/subnets/attnetsService.ts +94 -6
- package/src/network/subnets/interface.ts +7 -0
- package/src/node/nodejs.ts +34 -15
- package/src/node/options.ts +5 -1
- package/src/sync/range/batch.ts +9 -21
- package/src/sync/range/chain.ts +2 -14
- package/src/sync/unknownBlock.ts +1 -8
- package/src/sync/utils/downloadByRange.ts +31 -230
- package/src/sync/utils/downloadByRoot.ts +15 -142
- package/src/util/blobs.ts +0 -34
- package/src/util/execution.ts +8 -102
- package/src/util/sszBytes.ts +40 -22
- package/src/util/types.ts +1 -8
- package/lib/chain/errors/blobSidecarError.d.ts +0 -108
- package/lib/chain/errors/blobSidecarError.d.ts.map +0 -1
- package/lib/chain/errors/blobSidecarError.js +0 -38
- package/lib/chain/errors/blobSidecarError.js.map +0 -1
- package/lib/chain/validation/blobSidecar.d.ts +0 -16
- package/lib/chain/validation/blobSidecar.d.ts.map +0 -1
- package/lib/chain/validation/blobSidecar.js +0 -276
- package/lib/chain/validation/blobSidecar.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +0 -9
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +0 -91
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts +0 -5
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +0 -46
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +0 -1
- package/src/chain/errors/blobSidecarError.ts +0 -70
- package/src/chain/validation/blobSidecar.ts +0 -357
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +0 -133
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +0 -69
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {PayloadStatus} from "@lodestar/fork-choice";
|
|
1
|
+
import {PayloadStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
2
|
import {
|
|
3
3
|
computeStartSlotAtEpoch,
|
|
4
4
|
getExecutionPayloadEnvelopeSignatureSet,
|
|
@@ -6,9 +6,15 @@ import {
|
|
|
6
6
|
} from "@lodestar/state-transition";
|
|
7
7
|
import {gloas, ssz} from "@lodestar/types";
|
|
8
8
|
import {byteArrayEquals, toRootHex} from "@lodestar/utils";
|
|
9
|
+
import {
|
|
10
|
+
getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized,
|
|
11
|
+
getSlotFromExecutionPayloadEnvelopeSerialized,
|
|
12
|
+
getTransactionCountFromExecutionPayloadEnvelopeSerialized,
|
|
13
|
+
} from "../../util/sszBytes.js";
|
|
9
14
|
import {ExecutionPayloadEnvelopeError, ExecutionPayloadEnvelopeErrorCode, GossipAction} from "../errors/index.js";
|
|
10
15
|
import {IBeaconChain} from "../index.js";
|
|
11
16
|
import {RegenCaller} from "../regen/index.js";
|
|
17
|
+
import {PayloadEnvelopeInput} from "../seenCache/seenPayloadEnvelopeInput.js";
|
|
12
18
|
|
|
13
19
|
export async function validateApiExecutionPayloadEnvelope(
|
|
14
20
|
chain: IBeaconChain,
|
|
@@ -24,6 +30,40 @@ export async function validateGossipExecutionPayloadEnvelope(
|
|
|
24
30
|
return validateExecutionPayloadEnvelope(chain, executionPayloadEnvelope);
|
|
25
31
|
}
|
|
26
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Applies the transaction count check to the serialized envelope so that an oversized envelope is dropped
|
|
35
|
+
* before it is deserialized. Defers to validateGossipExecutionPayloadEnvelope if the data is malformed
|
|
36
|
+
* or the block is not known.
|
|
37
|
+
*/
|
|
38
|
+
export function validateGossipExecutionPayloadEnvelopeSerialized(
|
|
39
|
+
chain: IBeaconChain,
|
|
40
|
+
serializedData: Uint8Array
|
|
41
|
+
): void {
|
|
42
|
+
const blockRootHex = getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized(serializedData);
|
|
43
|
+
const slot = getSlotFromExecutionPayloadEnvelopeSerialized(serializedData);
|
|
44
|
+
const transactionCount = getTransactionCountFromExecutionPayloadEnvelopeSerialized(serializedData);
|
|
45
|
+
if (blockRootHex === null || slot === null || transactionCount === null) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const block = chain.forkChoice.getBlockHexDefaultStatus(blockRootHex);
|
|
50
|
+
const payloadInput = chain.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
51
|
+
if (!block || !payloadInput) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const maxTransactionCount = getMaxTransactionCount(chain, block, payloadInput);
|
|
56
|
+
if (BigInt(transactionCount) > maxTransactionCount) {
|
|
57
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
58
|
+
code: ExecutionPayloadEnvelopeErrorCode.TOO_MANY_TRANSACTIONS,
|
|
59
|
+
slot,
|
|
60
|
+
root: blockRootHex,
|
|
61
|
+
transactionCount,
|
|
62
|
+
maxTransactionCount: Number(maxTransactionCount),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
27
67
|
async function validateExecutionPayloadEnvelope(
|
|
28
68
|
chain: IBeaconChain,
|
|
29
69
|
executionPayloadEnvelope: gloas.SignedExecutionPayloadEnvelope
|
|
@@ -123,6 +163,20 @@ async function validateExecutionPayloadEnvelope(
|
|
|
123
163
|
});
|
|
124
164
|
}
|
|
125
165
|
|
|
166
|
+
// [IGNORE] The number of transactions is within the limit implied by the parent payload's gas limit
|
|
167
|
+
// TODO GLOAS: [REJECT] once https://github.com/ethereum/consensus-specs/pull/5802 is released,
|
|
168
|
+
// also in validateGossipExecutionPayloadEnvelopeSerialized
|
|
169
|
+
const maxTransactionCount = getMaxTransactionCount(chain, block, payloadInput);
|
|
170
|
+
if (BigInt(payload.transactions.length) > maxTransactionCount) {
|
|
171
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
172
|
+
code: ExecutionPayloadEnvelopeErrorCode.TOO_MANY_TRANSACTIONS,
|
|
173
|
+
slot: payload.slotNumber,
|
|
174
|
+
root: blockRootHex,
|
|
175
|
+
transactionCount: payload.transactions.length,
|
|
176
|
+
maxTransactionCount: Number(maxTransactionCount),
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
126
180
|
// Get the block state to verify the builder's signature.
|
|
127
181
|
const blockState = await chain.regen
|
|
128
182
|
.getState(block.stateRoot, RegenCaller.validateGossipPayloadEnvelope)
|
|
@@ -154,3 +208,16 @@ async function validateExecutionPayloadEnvelope(
|
|
|
154
208
|
});
|
|
155
209
|
}
|
|
156
210
|
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The bid's gas limit is only tied to the parent payload by bid gossip, so the bound is the gas limit the
|
|
214
|
+
* EIP-1559 rule allows on top of the parent payload's. The bid is the only bound if that gas limit is unknown.
|
|
215
|
+
*/
|
|
216
|
+
function getMaxTransactionCount(chain: IBeaconChain, block: ProtoBlock, payloadInput: PayloadEnvelopeInput): bigint {
|
|
217
|
+
const parentGasLimit = block.executionPayloadBlockHash === null ? 0n : BigInt(block.executionPayloadGasLimit);
|
|
218
|
+
const maxGasLimit =
|
|
219
|
+
parentGasLimit === 0n
|
|
220
|
+
? payloadInput.getBid().gasLimit
|
|
221
|
+
: parentGasLimit + (parentGasLimit / 1024n > 1n ? parentGasLimit / 1024n : 1n) - 1n;
|
|
222
|
+
return maxGasLimit / BigInt(chain.config.MIN_TRANSACTION_GAS);
|
|
223
|
+
}
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
SubnetID,
|
|
22
22
|
ValidatorIndex,
|
|
23
23
|
altair,
|
|
24
|
-
deneb,
|
|
25
24
|
gloas,
|
|
26
25
|
} from "@lodestar/types";
|
|
27
26
|
import {
|
|
@@ -70,7 +69,6 @@ export type ValidatorMonitor = {
|
|
|
70
69
|
balances?: number[]
|
|
71
70
|
): void;
|
|
72
71
|
registerBeaconBlock(src: OpSource, delaySec: Seconds, block: BeaconBlock): void;
|
|
73
|
-
registerBlobSidecar(src: OpSource, seenTimestampSec: Seconds, blob: deneb.BlobSidecar): void;
|
|
74
72
|
registerExecutionPayloadEnvelope(
|
|
75
73
|
src: OpSource,
|
|
76
74
|
delaySec: Seconds,
|
|
@@ -434,10 +432,6 @@ export function createValidatorMonitor(
|
|
|
434
432
|
}
|
|
435
433
|
},
|
|
436
434
|
|
|
437
|
-
registerBlobSidecar(_src, _seenTimestampSec, _blob) {
|
|
438
|
-
//TODO: freetheblobs
|
|
439
|
-
},
|
|
440
|
-
|
|
441
435
|
registerExecutionPayloadEnvelope(_src, _delaySec, _envelope) {
|
|
442
436
|
// TODO GLOAS: implement execution payload envelope monitoring
|
|
443
437
|
},
|
|
@@ -14,7 +14,6 @@ export const blobSidecarsWrapperSsz = new ContainerType(
|
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
export type BlobSidecarsWrapper = ValueOf<typeof blobSidecarsWrapperSsz>;
|
|
17
|
-
export const BLOB_SIDECARS_IN_WRAPPER_INDEX = 44;
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* blobSidecarsWrapper by block root (= hash_tree_root(SignedBeaconBlock.message))
|
|
@@ -19,21 +19,20 @@ import {IClock} from "../../util/clock.js";
|
|
|
19
19
|
* Additional duration to account for potential event loop lag which causes
|
|
20
20
|
* builder bids to be rejected even though the response was sent in time.
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
export const BUILDER_BID_LAG_BUFFER_MS = 250;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* is reached, advertised on each bid request via the `X-Timeout-Ms` header.
|
|
27
|
-
*
|
|
25
|
+
* Default duration given to a builder to provide a `SignedExecutionPayloadBid` before the deadline
|
|
26
|
+
* is reached, advertised on each bid request via the `X-Timeout-Ms` header. Bids received via
|
|
27
|
+
* p2p are given the same time to bid up.
|
|
28
28
|
*/
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
/** Local timeout for bid requests, event loop lag must not discard bids that arrived in time */
|
|
32
|
-
export const BUILDER_BID_REQUEST_TIMEOUT_MS = BUILDER_BID_DEADLINE_MS + EVENT_LOOP_LAG_BUFFER;
|
|
29
|
+
export const DEFAULT_BUILDER_BID_DEADLINE_MS = 500;
|
|
33
30
|
|
|
34
31
|
export type BuilderApiClientOpts = {
|
|
35
|
-
/** Timeout for builder api requests, bid requests
|
|
32
|
+
/** Timeout for builder api requests, bid requests are bounded by `bidDeadline` instead */
|
|
36
33
|
timeout?: number;
|
|
34
|
+
/** Time builders are given to provide a bid once block production starts, in milliseconds */
|
|
35
|
+
bidDeadline?: number;
|
|
37
36
|
// Add User-Agent header to all requests
|
|
38
37
|
userAgent?: string;
|
|
39
38
|
};
|
|
@@ -69,6 +68,7 @@ export type BuilderApiBid = {
|
|
|
69
68
|
* each block production request, clients are dialed on demand based on the entry `url`.
|
|
70
69
|
*/
|
|
71
70
|
export class BuilderApiClient {
|
|
71
|
+
readonly bidDeadline: number;
|
|
72
72
|
private readonly clients = new Map<BuilderUrl, BuilderApi>();
|
|
73
73
|
|
|
74
74
|
constructor(
|
|
@@ -78,7 +78,9 @@ export class BuilderApiClient {
|
|
|
78
78
|
private readonly bls: IBlsVerifier,
|
|
79
79
|
private readonly metrics: Metrics | null = null,
|
|
80
80
|
private readonly logger?: Logger
|
|
81
|
-
) {
|
|
81
|
+
) {
|
|
82
|
+
this.bidDeadline = opts.bidDeadline ?? DEFAULT_BUILDER_BID_DEADLINE_MS;
|
|
83
|
+
}
|
|
82
84
|
|
|
83
85
|
/**
|
|
84
86
|
* Fan out bid requests to the builders named by the entries, one request per unique
|
|
@@ -139,9 +141,10 @@ export class BuilderApiClient {
|
|
|
139
141
|
proposerPubkey,
|
|
140
142
|
requestAuth: entry.auth,
|
|
141
143
|
dateMilliseconds: Date.now(),
|
|
142
|
-
timeoutMs:
|
|
144
|
+
timeoutMs: this.bidDeadline,
|
|
143
145
|
},
|
|
144
|
-
|
|
146
|
+
// Event loop lag must not discard bids that arrived in time
|
|
147
|
+
{timeoutMs: this.bidDeadline + BUILDER_BID_LAG_BUFFER_MS}
|
|
145
148
|
);
|
|
146
149
|
const signedBid = res.value();
|
|
147
150
|
if (signedBid === undefined) {
|
|
@@ -203,7 +206,7 @@ export class BuilderApiClient {
|
|
|
203
206
|
|
|
204
207
|
/**
|
|
205
208
|
* Establish the connection to every known builder outside the bid deadline, a cold TCP/TLS handshake
|
|
206
|
-
* to a distant builder can exhaust
|
|
209
|
+
* to a distant builder can exhaust the bid deadline on its own, and a long idle connection
|
|
207
210
|
* may be half-open and only fail once written to.
|
|
208
211
|
*/
|
|
209
212
|
async checkStatus(): Promise<void> {
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from "@lodestar/types";
|
|
21
21
|
import {toPrintableUrl} from "@lodestar/utils";
|
|
22
22
|
import {Metrics} from "../../metrics/metrics.js";
|
|
23
|
+
import {DEFAULT_BUILDER_BID_DEADLINE_MS} from "./apiClient.js";
|
|
23
24
|
import {ValidatorRegistration, ValidatorRegistrationCache} from "./cache.js";
|
|
24
25
|
import {IExecutionBuilder} from "./interface.js";
|
|
25
26
|
|
|
@@ -29,6 +30,8 @@ export type ExecutionBuilderHttpOpts = {
|
|
|
29
30
|
timeout?: number;
|
|
30
31
|
faultInspectionWindow?: number;
|
|
31
32
|
allowedFaults?: number;
|
|
33
|
+
/** Post-gloas only, time builders are given to provide a bid once block production starts, in milliseconds */
|
|
34
|
+
bidDeadline?: number;
|
|
32
35
|
|
|
33
36
|
// Only required for merge-mock runs, no need to expose it to cli
|
|
34
37
|
issueLocalFcUWithFeeRecipient?: string;
|
|
@@ -40,6 +43,7 @@ export const defaultExecutionBuilderHttpOpts: ExecutionBuilderHttpOpts = {
|
|
|
40
43
|
enabled: false,
|
|
41
44
|
url: "http://localhost:8661",
|
|
42
45
|
timeout: 12000,
|
|
46
|
+
bidDeadline: DEFAULT_BUILDER_BID_DEADLINE_MS,
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
export enum BuilderStatus {
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import {Logger} from "@lodestar/logger";
|
|
2
|
-
import {
|
|
3
|
-
ForkName,
|
|
4
|
-
ForkPostFulu,
|
|
5
|
-
ForkPreFulu,
|
|
6
|
-
ForkSeq,
|
|
7
|
-
SLOTS_PER_EPOCH,
|
|
8
|
-
isForkPostBellatrix,
|
|
9
|
-
isForkPostFulu,
|
|
10
|
-
} from "@lodestar/params";
|
|
2
|
+
import {ForkName, ForkPostFulu, ForkSeq, SLOTS_PER_EPOCH, isForkPostBellatrix} from "@lodestar/params";
|
|
11
3
|
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei, bellatrix} from "@lodestar/types";
|
|
12
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
13
4
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
14
5
|
import {isErrorAborted} from "@lodestar/utils";
|
|
15
6
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -22,9 +13,11 @@ import {
|
|
|
22
13
|
ExecutePayloadResponse,
|
|
23
14
|
ExecutionEngineState,
|
|
24
15
|
ExecutionPayloadStatus,
|
|
16
|
+
ForkchoiceUpdatedResult,
|
|
25
17
|
IExecutionEngine,
|
|
26
18
|
PayloadAttributes,
|
|
27
19
|
PayloadId,
|
|
20
|
+
PayloadStatusResult,
|
|
28
21
|
VersionedHashes,
|
|
29
22
|
} from "./interface.js";
|
|
30
23
|
import {ErrorJsonRpcResponse, HttpRpcError, JsonRpcHttpClientEvent} from "./jsonRpcHttpClient.js";
|
|
@@ -32,7 +25,7 @@ import {PayloadIdCache} from "./payloadIdCache.js";
|
|
|
32
25
|
import {EngineRestError, EngineRestResponseError, isRetryableEngineRestError} from "./restHttpClient.js";
|
|
33
26
|
import {EngineCapabilities, RestEngineTransport} from "./restTransport.js";
|
|
34
27
|
import {executionForkName} from "./sszTypes.js";
|
|
35
|
-
import {IEngineTransport
|
|
28
|
+
import {IEngineTransport} from "./transport.js";
|
|
36
29
|
import {ExecutionPayloadBodyV2, serializePayloadAttributes} from "./types.js";
|
|
37
30
|
import {getExecutionEngineState} from "./utils.js";
|
|
38
31
|
|
|
@@ -154,7 +147,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
154
147
|
private restSupport: RestSupport = {state: "pending"};
|
|
155
148
|
private restProbe: Promise<RestSupport> | null = null;
|
|
156
149
|
private lastRestProbeMs = Number.NEGATIVE_INFINITY;
|
|
157
|
-
private readonly loggedRestFallbacks = new Set<ForkName | "
|
|
150
|
+
private readonly loggedRestFallbacks = new Set<ForkName | "v2">();
|
|
158
151
|
|
|
159
152
|
constructor(
|
|
160
153
|
{jsonRpc, rest}: ExecutionEngineTransports,
|
|
@@ -342,15 +335,16 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
342
335
|
safeBlockHash: RootHex,
|
|
343
336
|
finalizedBlockHash: RootHex,
|
|
344
337
|
payloadAttributes?: PayloadAttributes
|
|
345
|
-
): Promise<
|
|
346
|
-
const
|
|
347
|
-
payloadStatus: {status, validationError},
|
|
348
|
-
payloadId,
|
|
349
|
-
} = await this.enqueue(() =>
|
|
338
|
+
): Promise<ForkchoiceUpdatedResult> {
|
|
339
|
+
const result = await this.enqueue(() =>
|
|
350
340
|
this.withTransport(fork, undefined, (transport) =>
|
|
351
341
|
transport.forkchoiceUpdated(fork, headBlockHash, safeBlockHash, finalizedBlockHash, payloadAttributes)
|
|
352
342
|
)
|
|
353
343
|
);
|
|
344
|
+
const {
|
|
345
|
+
payloadStatus: {status},
|
|
346
|
+
payloadId,
|
|
347
|
+
} = result;
|
|
354
348
|
|
|
355
349
|
this.updateEngineState(getExecutionEngineState({payloadStatus: status, oldState: this.state}));
|
|
356
350
|
this.metrics?.engineNotifyForkchoiceUpdateResult.inc({result: status});
|
|
@@ -374,21 +368,17 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
374
368
|
);
|
|
375
369
|
void this.prunePayloadIdCache();
|
|
376
370
|
}
|
|
377
|
-
return
|
|
371
|
+
return result;
|
|
378
372
|
|
|
379
373
|
case ExecutionPayloadStatus.SYNCING:
|
|
380
374
|
// Throw error on syncing if requested to produce a block, else silently ignore
|
|
381
375
|
if (payloadAttributes) {
|
|
382
376
|
throw Error("Execution Layer Syncing");
|
|
383
377
|
}
|
|
384
|
-
return
|
|
378
|
+
return result;
|
|
385
379
|
|
|
386
380
|
case ExecutionPayloadStatus.INVALID:
|
|
387
|
-
|
|
388
|
-
`Invalid ${payloadAttributes ? "prepare payload" : "forkchoice request"}, validationError=${
|
|
389
|
-
validationError ?? ""
|
|
390
|
-
}`
|
|
391
|
-
);
|
|
381
|
+
return result;
|
|
392
382
|
|
|
393
383
|
default:
|
|
394
384
|
throw Error(`Unknown status ${status}`);
|
|
@@ -426,24 +416,11 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
426
416
|
}
|
|
427
417
|
|
|
428
418
|
async getBlobs(
|
|
429
|
-
|
|
430
|
-
versionedHashes: VersionedHashes,
|
|
431
|
-
buffers?: Uint8Array[]
|
|
432
|
-
): Promise<BlobAndProofV2[] | null>;
|
|
433
|
-
async getBlobs(
|
|
434
|
-
fork: ForkPreFulu,
|
|
419
|
+
_fork: ForkPostFulu,
|
|
435
420
|
versionedHashes: VersionedHashes,
|
|
436
421
|
buffers?: Uint8Array[]
|
|
437
|
-
): Promise<
|
|
438
|
-
|
|
439
|
-
fork: ForkName,
|
|
440
|
-
versionedHashes: VersionedHashes,
|
|
441
|
-
buffers?: Uint8Array[]
|
|
442
|
-
): Promise<BlobAndProofV2[] | (BlobAndProof | null)[] | null> {
|
|
443
|
-
if (isForkPostFulu(fork)) {
|
|
444
|
-
return this.withTransport(undefined, "v2", (transport) => transport.getBlobsV2(versionedHashes, buffers));
|
|
445
|
-
}
|
|
446
|
-
return this.withTransport(undefined, "v1", (transport) => transport.getBlobsV1(versionedHashes));
|
|
422
|
+
): Promise<BlobAndProofV2[] | null> {
|
|
423
|
+
return this.withTransport(undefined, "v2", (transport) => transport.getBlobsV2(versionedHashes, buffers));
|
|
447
424
|
}
|
|
448
425
|
|
|
449
426
|
/**
|
|
@@ -469,7 +446,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
469
446
|
*/
|
|
470
447
|
private async withTransport<T>(
|
|
471
448
|
fork: ForkName | undefined,
|
|
472
|
-
blobsRevision: "
|
|
449
|
+
blobsRevision: "v2" | undefined,
|
|
473
450
|
fn: (transport: IEngineTransport) => Promise<T>
|
|
474
451
|
): Promise<T> {
|
|
475
452
|
const transport = await this.getTransport(fork, blobsRevision);
|
|
@@ -510,7 +487,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
510
487
|
* Pick the transport for a call. Fork-scoped calls only go over REST if the execution client
|
|
511
488
|
* advertises that fork, blob requests only if it serves the needed `/blobs/vN` revision.
|
|
512
489
|
*/
|
|
513
|
-
private async getTransport(fork?: ForkName, blobsRevision?: "
|
|
490
|
+
private async getTransport(fork?: ForkName, blobsRevision?: "v2"): Promise<IEngineTransport> {
|
|
514
491
|
if (this.rest === null || this.engineApi === "json-rpc") {
|
|
515
492
|
return this.jsonRpc;
|
|
516
493
|
}
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
DEPOSIT_REQUEST_TYPE,
|
|
7
7
|
ForkName,
|
|
8
8
|
ForkPostFulu,
|
|
9
|
-
ForkPreFulu,
|
|
10
9
|
WITHDRAWAL_REQUEST_TYPE,
|
|
11
10
|
} from "@lodestar/params";
|
|
12
11
|
import {
|
|
@@ -19,7 +18,6 @@ import {
|
|
|
19
18
|
bellatrix,
|
|
20
19
|
capella,
|
|
21
20
|
} from "@lodestar/types";
|
|
22
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
23
21
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
24
22
|
import {PayloadId, PayloadIdCache, WithdrawalV1} from "./payloadIdCache.js";
|
|
25
23
|
import {ExecutionPayloadBodyV2} from "./types.js";
|
|
@@ -99,6 +97,19 @@ export type ExecutePayloadResponse =
|
|
|
99
97
|
validationError: string;
|
|
100
98
|
};
|
|
101
99
|
|
|
100
|
+
export type PayloadStatusResult = {
|
|
101
|
+
status: ExecutionPayloadStatus;
|
|
102
|
+
latestValidHash: RootHex | null;
|
|
103
|
+
validationError: string | null;
|
|
104
|
+
/** PayloadStatusV2: whether a VALID payload satisfied the inclusion list constraints, null otherwise */
|
|
105
|
+
inclusionListSatisfied?: boolean | null;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type ForkchoiceUpdatedResult = {
|
|
109
|
+
payloadStatus: PayloadStatusResult;
|
|
110
|
+
payloadId: PayloadId | null;
|
|
111
|
+
};
|
|
112
|
+
|
|
102
113
|
export type ForkChoiceUpdateStatus =
|
|
103
114
|
| ExecutionPayloadStatus.VALID
|
|
104
115
|
| ExecutionPayloadStatus.INVALID
|
|
@@ -166,7 +177,10 @@ export interface IExecutionEngine {
|
|
|
166
177
|
* The call of the notify_forkchoice_updated function maps on the POS_FORKCHOICE_UPDATED event defined in the EIP-3675.
|
|
167
178
|
* https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/fork-choice.md#notify_forkchoice_updated
|
|
168
179
|
*
|
|
169
|
-
* Should be called in response to fork-choice head and finalized events
|
|
180
|
+
* Should be called in response to fork-choice head and finalized events.
|
|
181
|
+
*
|
|
182
|
+
* An INVALID verdict is returned, not thrown: the caller feeds it back into fork choice together with the
|
|
183
|
+
* `latestValidHash`. Only SYNCING while building a payload is an error.
|
|
170
184
|
*/
|
|
171
185
|
notifyForkchoiceUpdate(
|
|
172
186
|
fork: ForkName,
|
|
@@ -174,7 +188,7 @@ export interface IExecutionEngine {
|
|
|
174
188
|
safeBlockHash: RootHex,
|
|
175
189
|
finalizedBlockHash: RootHex,
|
|
176
190
|
payloadAttributes?: PayloadAttributes
|
|
177
|
-
): Promise<
|
|
191
|
+
): Promise<ForkchoiceUpdatedResult>;
|
|
178
192
|
|
|
179
193
|
/**
|
|
180
194
|
* Given the payload_id, get_payload returns the most recent version of the execution payload that has been built
|
|
@@ -202,9 +216,4 @@ export interface IExecutionEngine {
|
|
|
202
216
|
versionedHashes: VersionedHashes,
|
|
203
217
|
buffers?: Uint8Array[]
|
|
204
218
|
): Promise<BlobAndProofV2[] | null>;
|
|
205
|
-
getBlobs(
|
|
206
|
-
fork: ForkPreFulu,
|
|
207
|
-
versionedHashes: VersionedHashes,
|
|
208
|
-
buffers?: Uint8Array[]
|
|
209
|
-
): Promise<(BlobAndProof | null)[]>;
|
|
210
219
|
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import {ForkName, ForkSeq} from "@lodestar/params";
|
|
2
2
|
import {ExecutionPayload, ExecutionRequests, Root, RootHex, bellatrix} from "@lodestar/types";
|
|
3
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
4
3
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
5
4
|
import {strip0xPrefix} from "@lodestar/utils";
|
|
6
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ClientCode,
|
|
7
|
+
ClientVersion,
|
|
8
|
+
ForkchoiceUpdatedResult,
|
|
9
|
+
PayloadAttributes,
|
|
10
|
+
PayloadId,
|
|
11
|
+
PayloadStatusResult,
|
|
12
|
+
VersionedHashes,
|
|
13
|
+
} from "./interface.js";
|
|
7
14
|
import {IJsonRpcHttpClient, JsonRpcHttpClientEventEmitter, ReqOpts} from "./jsonRpcHttpClient.js";
|
|
8
|
-
import {
|
|
15
|
+
import {GetPayloadResult, IEngineTransport} from "./transport.js";
|
|
9
16
|
import {
|
|
10
17
|
BLOB_AND_PROOF_V2_RPC_BYTES,
|
|
11
18
|
EngineApiRpcParamTypes,
|
|
12
19
|
EngineApiRpcReturnTypes,
|
|
13
20
|
ExecutionPayloadBodyV2,
|
|
14
21
|
assertReqSizeLimit,
|
|
15
|
-
deserializeBlobAndProofs,
|
|
16
22
|
deserializeBlobAndProofsV2,
|
|
17
23
|
deserializeBlobAndProofsV2IntoBytes,
|
|
18
24
|
deserializeExecutionPayloadBodyV2,
|
|
@@ -39,7 +45,6 @@ const notifyNewPayloadOpts: ReqOpts = {routeId: "notifyNewPayload"};
|
|
|
39
45
|
const forkchoiceUpdatedOpts: ReqOpts = {routeId: "forkchoiceUpdated"};
|
|
40
46
|
const getPayloadOpts: ReqOpts = {routeId: "getPayload"};
|
|
41
47
|
const getPayloadBodiesByHashOpts: ReqOpts = {routeId: "getPayloadBodiesByHash"};
|
|
42
|
-
const getBlobsV1Opts: ReqOpts = {routeId: "getBlobsV1"};
|
|
43
48
|
const getBlobsV2Opts: ReqOpts = {routeId: "getBlobsV2"};
|
|
44
49
|
const getClientVersionOpts: ReqOpts = {routeId: "getClientVersion"};
|
|
45
50
|
const getInclusionListOpts: ReqOpts = {routeId: "getInclusionList"};
|
|
@@ -202,23 +207,6 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
202
207
|
return response.map(deserializeExecutionPayloadBodyV2);
|
|
203
208
|
}
|
|
204
209
|
|
|
205
|
-
async getBlobsV1(versionedHashes: VersionedHashes): Promise<(BlobAndProof | null)[]> {
|
|
206
|
-
assertReqSizeLimit(versionedHashes.length, MAX_VERSIONED_HASHES);
|
|
207
|
-
const versionedHashesHex = versionedHashes.map(bytesToData);
|
|
208
|
-
const response = await this.rpc.fetchWithRetries<
|
|
209
|
-
EngineApiRpcReturnTypes["engine_getBlobsV1"],
|
|
210
|
-
EngineApiRpcParamTypes["engine_getBlobsV1"]
|
|
211
|
-
>({method: "engine_getBlobsV1", params: [versionedHashesHex]}, getBlobsV1Opts);
|
|
212
|
-
|
|
213
|
-
if (response.length !== versionedHashesHex.length) {
|
|
214
|
-
throw Error(
|
|
215
|
-
`Invalid engine_getBlobsV1 response length=${response.length} versionedHashes=${versionedHashesHex.length}`
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return response.map(deserializeBlobAndProofs);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
210
|
async getBlobsV2(versionedHashes: VersionedHashes, buffers?: Uint8Array[]): Promise<BlobAndProofV2[] | null> {
|
|
223
211
|
assertReqSizeLimit(versionedHashes.length, MAX_VERSIONED_HASHES);
|
|
224
212
|
const versionedHashesHex = versionedHashes.map(bytesToData);
|
|
@@ -152,7 +152,6 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
152
152
|
engine_getPayloadV6: this.getPayloadV5.bind(this),
|
|
153
153
|
engine_getPayloadBodiesByHashV2: this.getPayloadBodiesByHashV2.bind(this),
|
|
154
154
|
engine_getClientVersionV1: this.getClientVersionV1.bind(this),
|
|
155
|
-
engine_getBlobsV1: this.getBlobs.bind(this),
|
|
156
155
|
engine_getBlobsV2: this.getBlobsV2.bind(this),
|
|
157
156
|
engine_getInclusionListV1: this.getInclusionList.bind(this),
|
|
158
157
|
};
|
|
@@ -496,12 +495,6 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
496
495
|
return [{code: ClientCode.XX, name: "mock", version: "", commit: ""}];
|
|
497
496
|
}
|
|
498
497
|
|
|
499
|
-
private getBlobs(
|
|
500
|
-
versionedHashes: EngineApiRpcParamTypes["engine_getBlobsV1"][0]
|
|
501
|
-
): EngineApiRpcReturnTypes["engine_getBlobsV1"] {
|
|
502
|
-
return versionedHashes.map((_vh) => null);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
498
|
private getBlobsV2(
|
|
506
499
|
_versionedHashes: EngineApiRpcParamTypes["engine_getBlobsV2"][0]
|
|
507
500
|
): EngineApiRpcReturnTypes["engine_getBlobsV2"] {
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
electra,
|
|
12
12
|
gloas,
|
|
13
13
|
} from "@lodestar/types";
|
|
14
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
15
14
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
16
15
|
import {EndTimer, LodestarError, fromHex, strip0xPrefix, toHex, toRootHex} from "@lodestar/utils";
|
|
17
16
|
import {isValidBlobVersionedHashes} from "./blobVersionedHashes.js";
|
|
@@ -19,15 +18,16 @@ import {
|
|
|
19
18
|
ClientCode,
|
|
20
19
|
ClientVersion,
|
|
21
20
|
ExecutionPayloadStatus,
|
|
21
|
+
ForkchoiceUpdatedResult,
|
|
22
22
|
PayloadAttributes,
|
|
23
23
|
PayloadId,
|
|
24
|
+
PayloadStatusResult,
|
|
24
25
|
VersionedHashes,
|
|
25
26
|
} from "./interface.js";
|
|
26
27
|
import {JsonRpcHttpClientEventEmitter, ReqOpts} from "./jsonRpcHttpClient.js";
|
|
27
28
|
import {EngineRestHttpClient, EngineRestResponseError} from "./restHttpClient.js";
|
|
28
29
|
import {
|
|
29
30
|
BlobsRequest,
|
|
30
|
-
BlobsV1Response,
|
|
31
31
|
BlobsV2Response,
|
|
32
32
|
BodiesByHashRequest,
|
|
33
33
|
BodiesResponseBellatrix,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
PayloadStatusSsz,
|
|
58
58
|
executionForkName,
|
|
59
59
|
} from "./sszTypes.js";
|
|
60
|
-
import {
|
|
60
|
+
import {GetPayloadResult, IEngineTransport} from "./transport.js";
|
|
61
61
|
import {EngineTransportMetrics} from "./transportMetrics.js";
|
|
62
62
|
import {
|
|
63
63
|
ExecutionPayloadBodyV2,
|
|
@@ -88,7 +88,6 @@ const notifyNewPayloadOpts: ReqOpts = {routeId: "notifyNewPayload"};
|
|
|
88
88
|
const forkchoiceUpdatedOpts: ReqOpts = {routeId: "forkchoiceUpdated"};
|
|
89
89
|
const getPayloadOpts: ReqOpts = {routeId: "getPayload"};
|
|
90
90
|
const getPayloadBodiesByHashOpts: ReqOpts = {routeId: "getPayloadBodiesByHash"};
|
|
91
|
-
const getBlobsV1Opts: ReqOpts = {routeId: "getBlobsV1"};
|
|
92
91
|
const getBlobsV2Opts: ReqOpts = {routeId: "getBlobsV2"};
|
|
93
92
|
const getClientVersionOpts: ReqOpts = {routeId: "getClientVersion"};
|
|
94
93
|
const getCapabilitiesOpts: ReqOpts = {routeId: "getCapabilities", retries: 0};
|
|
@@ -386,24 +385,6 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
386
385
|
return bodies;
|
|
387
386
|
}
|
|
388
387
|
|
|
389
|
-
async getBlobsV1(versionedHashes: VersionedHashes): Promise<(BlobAndProof | null)[]> {
|
|
390
|
-
assertReqSizeLimit(versionedHashes.length, this.limits.blobsMaxVersionedHashes);
|
|
391
|
-
const res = await this.client.request(
|
|
392
|
-
{method: "POST", path: "/blobs/v1", body: BlobsRequest.serialize({versionedHashes}), responseType: "ssz"},
|
|
393
|
-
getBlobsV1Opts
|
|
394
|
-
);
|
|
395
|
-
// 204 means the EL cannot serve blobs at all, e.g. while syncing
|
|
396
|
-
if (res.status === 204) {
|
|
397
|
-
return versionedHashes.map(() => null);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
const {entries} = deserializeResponse(BlobsV1Response, res.body, "getBlobsV1", this.metrics);
|
|
401
|
-
if (entries.length !== versionedHashes.length) {
|
|
402
|
-
throw Error(`Invalid blobs/v1 response length=${entries.length} versionedHashes=${versionedHashes.length}`);
|
|
403
|
-
}
|
|
404
|
-
return entries.map((entry) => (entry.available ? entry.contents : null));
|
|
405
|
-
}
|
|
406
|
-
|
|
407
388
|
/**
|
|
408
389
|
* Blobs and proofs are views into the response body rather than copies, the response is all-or-nothing
|
|
409
390
|
* so every byte of it is needed. The pooled buffers of the JSON-RPC transport are not used.
|
|
@@ -253,14 +253,6 @@ export const BlobsRequest = new ContainerType(
|
|
|
253
253
|
{typeName: "BlobsRequest"}
|
|
254
254
|
);
|
|
255
255
|
|
|
256
|
-
const BlobAndProofV1 = new ContainerType(
|
|
257
|
-
{
|
|
258
|
-
blob: ssz.deneb.Blob,
|
|
259
|
-
proof: Bytes48,
|
|
260
|
-
},
|
|
261
|
-
{typeName: "BlobAndProofV1"}
|
|
262
|
-
);
|
|
263
|
-
|
|
264
256
|
const BlobAndProofV2 = new ContainerType(
|
|
265
257
|
{
|
|
266
258
|
blob: ssz.deneb.Blob,
|
|
@@ -274,7 +266,6 @@ function BlobsResponseType<T extends CompositeType<ValueOf<T>, CompositeView<T>,
|
|
|
274
266
|
return new ContainerType({entries: new ListCompositeType(BlobEntry, MAX_BLOBS_REQUEST)}, {typeName: "BlobsResponse"});
|
|
275
267
|
}
|
|
276
268
|
|
|
277
|
-
export const BlobsV1Response = BlobsResponseType(BlobAndProofV1);
|
|
278
269
|
export const BlobsV2Response = BlobsResponseType(BlobAndProofV2);
|
|
279
270
|
|
|
280
271
|
const bellatrix = {
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import {ForkName} from "@lodestar/params";
|
|
2
2
|
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei, bellatrix} from "@lodestar/types";
|
|
3
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
4
3
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
5
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ClientVersion,
|
|
6
|
+
ForkchoiceUpdatedResult,
|
|
7
|
+
PayloadAttributes,
|
|
8
|
+
PayloadId,
|
|
9
|
+
PayloadStatusResult,
|
|
10
|
+
VersionedHashes,
|
|
11
|
+
} from "./interface.js";
|
|
6
12
|
import {JsonRpcHttpClientEventEmitter} from "./jsonRpcHttpClient.js";
|
|
7
13
|
import {ExecutionPayloadBodyV2} from "./types.js";
|
|
8
14
|
|
|
9
|
-
export type PayloadStatusResult = {
|
|
10
|
-
status: ExecutionPayloadStatus;
|
|
11
|
-
latestValidHash: RootHex | null;
|
|
12
|
-
validationError: string | null;
|
|
13
|
-
/** PayloadStatusV2: whether a VALID payload satisfied the inclusion list constraints, null otherwise */
|
|
14
|
-
inclusionListSatisfied?: boolean | null;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type ForkchoiceUpdatedResult = {
|
|
18
|
-
payloadStatus: PayloadStatusResult;
|
|
19
|
-
payloadId: PayloadId | null;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
15
|
export type GetPayloadResult = {
|
|
23
16
|
executionPayload: ExecutionPayload;
|
|
24
17
|
executionPayloadValue: Wei;
|
|
@@ -56,8 +49,6 @@ export interface IEngineTransport {
|
|
|
56
49
|
|
|
57
50
|
getPayloadBodiesByHashV2(blockHashes: RootHex[]): Promise<(ExecutionPayloadBodyV2 | null)[]>;
|
|
58
51
|
|
|
59
|
-
getBlobsV1(versionedHashes: VersionedHashes): Promise<(BlobAndProof | null)[]>;
|
|
60
|
-
|
|
61
52
|
getBlobsV2(versionedHashes: VersionedHashes, buffers?: Uint8Array[]): Promise<BlobAndProofV2[] | null>;
|
|
62
53
|
|
|
63
54
|
getClientVersion(clientVersion: ClientVersion): Promise<ClientVersion[]>;
|