@lodestar/beacon-node 1.51.0-dev.17f78227c7 → 1.51.0-dev.1b22218e60
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/api.js +1 -1
- package/lib/api/impl/api.js.map +1 -1
- package/lib/api/impl/beacon/blocks/index.d.ts +2 -1
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +48 -95
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/index.d.ts +2 -1
- package/lib/api/impl/beacon/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/index.js +2 -2
- package/lib/api/impl/beacon/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 +22 -2
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +8 -2
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +3 -2
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +17 -9
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +3 -0
- package/lib/api/impl/debug/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 +143 -35
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/options.d.ts +2 -0
- package/lib/api/options.d.ts.map +1 -1
- package/lib/api/options.js +1 -0
- package/lib/api/options.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +13 -2
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +69 -35
- 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/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 +42 -57
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -11
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +82 -20
- 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 +4 -4
- 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 +7 -19
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +5 -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 +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 +14 -2
- 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/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/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 +50 -22
- 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 +26 -4
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +127 -43
- 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/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/errors/executionPayloadBid.d.ts +11 -1
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +2 -0
- package/lib/chain/errors/executionPayloadBid.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/inclusionList.d.ts +60 -0
- package/lib/chain/errors/inclusionList.d.ts.map +1 -0
- package/lib/chain/errors/inclusionList.js +19 -0
- package/lib/chain/errors/inclusionList.js.map +1 -0
- package/lib/chain/errors/index.d.ts +1 -1
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +1 -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 +10 -7
- 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 +199 -46
- 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/inclusionListStore.d.ts +63 -0
- package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -0
- package/lib/chain/opPools/inclusionListStore.js +171 -0
- package/lib/chain/opPools/inclusionListStore.js.map +1 -0
- package/lib/chain/opPools/index.d.ts +2 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +2 -0
- package/lib/chain/opPools/index.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/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/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 +5 -3
- 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/produceBlock/produceBlockBody.d.ts +6 -3
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +32 -11
- 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 +2 -2
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -1
- package/lib/chain/regen/interface.js.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/aggregateAndProof.js +1 -1
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.js +1 -1
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts +0 -15
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +37 -158
- package/lib/chain/validation/executionPayloadBid.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/validation/inclusionList.d.ts +14 -0
- package/lib/chain/validation/inclusionList.d.ts.map +1 -0
- package/lib/chain/validation/inclusionList.js +150 -0
- package/lib/chain/validation/inclusionList.js.map +1 -0
- package/lib/chain/validation/index.d.ts +1 -0
- package/lib/chain/validation/index.d.ts.map +1 -1
- package/lib/chain/validation/index.js +1 -0
- package/lib/chain/validation/index.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +16 -10
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +11 -0
- package/lib/chain/validation/syncCommitteeContributionAndProof.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/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/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/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/builder/validateBid.d.ts.map +1 -1
- package/lib/execution/builder/validateBid.js +14 -1
- package/lib/execution/builder/validateBid.js.map +1 -1
- package/lib/execution/engine/blobVersionedHashes.d.ts +1 -1
- package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -1
- package/lib/execution/engine/blobVersionedHashes.js.map +1 -1
- package/lib/execution/engine/disabled.d.ts +1 -0
- package/lib/execution/engine/disabled.d.ts.map +1 -1
- package/lib/execution/engine/disabled.js +3 -0
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +12 -8
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +35 -14
- package/lib/execution/engine/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 +29 -8
- 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 +5 -6
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +34 -20
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +31 -11
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +5 -3
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js +15 -4
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +4 -5
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +4 -15
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +38 -47
- 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 +4 -14
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +25 -9
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +19 -14
- 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 -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/beacon.d.ts +16 -9
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +35 -30
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +42 -8
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +104 -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/monitoring/service.js +1 -1
- package/lib/monitoring/service.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +4 -1
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +7 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +2 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +4 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +6 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +6 -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 +8 -9
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +1 -1
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +13 -21
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +13 -24
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +5 -5
- 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 +9 -7
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +58 -35
- 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 +2 -0
- 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 +28 -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/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 +118 -149
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +6 -6
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +5 -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 +56 -29
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +6 -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/inclusionListsByIndices.d.ts +10 -0
- package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/inclusionListsByIndices.js +30 -0
- package/lib/network/reqresp/handlers/inclusionListsByIndices.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +6 -12
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +1 -2
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +5 -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 +5 -17
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +6 -9
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +4 -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 +3 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +47 -21
- 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/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/sync.d.ts +15 -0
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +103 -25
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +43 -25
- 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/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.d.ts +5 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +36 -19
- 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 +31 -32
- package/src/api/impl/api.ts +1 -1
- package/src/api/impl/beacon/blocks/index.ts +81 -126
- package/src/api/impl/beacon/index.ts +3 -1
- package/src/api/impl/beacon/pool/index.ts +31 -1
- package/src/api/impl/beacon/state/index.ts +10 -1
- package/src/api/impl/beacon/state/utils.ts +20 -10
- package/src/api/impl/debug/index.ts +4 -0
- package/src/api/impl/validator/index.ts +178 -39
- package/src/api/options.ts +3 -0
- package/src/chain/GetBlobsTracker.ts +82 -52
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +76 -130
- 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 +58 -77
- package/src/chain/blocks/importExecutionPayload.ts +123 -36
- package/src/chain/blocks/index.ts +11 -4
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +35 -24
- package/src/chain/blocks/types.ts +8 -29
- package/src/chain/blocks/verifyBlock.ts +31 -16
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +16 -2
- 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/verifyPayloadsDataAvailability.ts +14 -6
- package/src/chain/blocks/writeBlockInputToDb.ts +6 -29
- package/src/chain/bls/interface.ts +2 -0
- package/src/chain/bls/multithread/index.ts +48 -24
- 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 +144 -42
- package/src/chain/emitter.ts +8 -8
- package/src/chain/errors/blockError.ts +1 -1
- package/src/chain/errors/executionPayloadBid.ts +12 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +8 -0
- package/src/chain/errors/inclusionList.ts +38 -0
- package/src/chain/errors/index.ts +1 -1
- package/src/chain/forkChoice/index.ts +11 -0
- package/src/chain/forkChoiceExecutionEngine.ts +183 -0
- package/src/chain/interface.ts +11 -6
- package/src/chain/opPools/aggregatedAttestationPool.ts +246 -43
- package/src/chain/opPools/attestationPool.ts +16 -4
- package/src/chain/opPools/inclusionListStore.ts +208 -0
- package/src/chain/opPools/index.ts +2 -0
- package/src/chain/opPools/payloadAttestationPool.ts +18 -7
- package/src/chain/opPools/singleAttestationPool.ts +287 -0
- 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 +5 -4
- package/src/chain/produceBlock/produceBlockBody.ts +67 -22
- package/src/chain/proposerTracker.ts +94 -0
- package/src/chain/regen/interface.ts +2 -2
- package/src/chain/regen/queued.ts +6 -4
- package/src/chain/seenCache/seenGossipBlockInput.ts +9 -93
- package/src/chain/validation/aggregateAndProof.ts +1 -1
- package/src/chain/validation/attestation.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +54 -183
- package/src/chain/validation/executionPayloadEnvelope.ts +68 -1
- package/src/chain/validation/inclusionList.ts +192 -0
- package/src/chain/validation/index.ts +1 -0
- package/src/chain/validation/syncCommittee.ts +31 -15
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +13 -0
- package/src/chain/validatorMonitor.ts +0 -6
- 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/blobSidecars.ts +0 -1
- 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/builder/validateBid.ts +23 -2
- package/src/execution/engine/blobVersionedHashes.ts +1 -1
- package/src/execution/engine/disabled.ts +4 -0
- package/src/execution/engine/http.ts +59 -47
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +46 -13
- package/src/execution/engine/jsonRpcTransport.ts +56 -31
- package/src/execution/engine/mock.ts +32 -14
- package/src/execution/engine/payloadIdCache.ts +24 -6
- package/src/execution/engine/restTransport.ts +18 -23
- package/src/execution/engine/sszTypes.ts +0 -9
- package/src/execution/engine/transport.ts +13 -17
- package/src/execution/engine/types.ts +44 -24
- package/src/execution/engine/utils.ts +4 -2
- package/src/index.ts +2 -0
- package/src/metrics/metrics/beacon.ts +37 -30
- package/src/metrics/metrics/lodestar.ts +106 -18
- package/src/metrics/server/http.ts +5 -5
- package/src/monitoring/service.ts +1 -1
- package/src/network/core/networkCore.ts +11 -1
- package/src/network/core/networkCoreWorker.ts +2 -0
- package/src/network/core/networkCoreWorkerHandler.ts +8 -1
- package/src/network/core/types.ts +6 -1
- package/src/network/gossip/gossipsub.ts +11 -0
- package/src/network/gossip/interface.ts +5 -5
- package/src/network/gossip/topic.ts +14 -25
- package/src/network/interface.ts +4 -5
- package/src/network/libp2p/index.ts +5 -1
- package/src/network/network.ts +66 -58
- package/src/network/options.ts +4 -0
- package/src/network/peers/peerManager.ts +28 -3
- package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
- 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 +150 -183
- package/src/network/processor/gossipQueues/index.ts +6 -6
- package/src/network/processor/gossipValidatorFn.ts +5 -5
- package/src/network/processor/index.ts +48 -27
- package/src/network/processor/types.ts +1 -1
- package/src/network/reqresp/ReqRespBeaconNode.ts +7 -7
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -2
- package/src/network/reqresp/handlers/inclusionListsByIndices.ts +44 -0
- package/src/network/reqresp/handlers/index.ts +5 -17
- package/src/network/reqresp/protocols.ts +6 -12
- package/src/network/reqresp/rateLimit.ts +5 -17
- package/src/network/reqresp/types.ts +6 -13
- package/src/network/subnets/attnetsService.ts +94 -6
- package/src/network/subnets/interface.ts +7 -0
- package/src/node/nodejs.ts +58 -22
- package/src/node/options.ts +9 -6
- package/src/sync/interface.ts +1 -0
- package/src/sync/range/batch.ts +9 -21
- package/src/sync/range/chain.ts +2 -14
- package/src/sync/sync.ts +108 -26
- package/src/sync/unknownBlock.ts +48 -36
- 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/file.ts +8 -9
- package/src/util/queue/itemQueue.ts +1 -1
- package/src/util/sszBytes.ts +42 -24
- 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
|
@@ -6,17 +6,24 @@ 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
|
-
import {
|
|
13
|
-
|
|
11
|
+
import {
|
|
12
|
+
BlobsBundle,
|
|
13
|
+
ExecutionPayload,
|
|
14
|
+
ExecutionRequests,
|
|
15
|
+
Root,
|
|
16
|
+
RootHex,
|
|
17
|
+
Wei,
|
|
18
|
+
bellatrix,
|
|
19
|
+
capella,
|
|
20
|
+
} from "@lodestar/types";
|
|
14
21
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
15
22
|
import {PayloadId, PayloadIdCache, WithdrawalV1} from "./payloadIdCache.js";
|
|
16
23
|
import {ExecutionPayloadBodyV2} from "./types.js";
|
|
17
24
|
import {DATA} from "./utils.js";
|
|
18
25
|
|
|
19
|
-
export {
|
|
26
|
+
export {type PayloadId, PayloadIdCache, type WithdrawalV1};
|
|
20
27
|
export type ClientVersion = routes.node.ClientVersion;
|
|
21
28
|
export const ClientCode = routes.node.ClientCode;
|
|
22
29
|
|
|
@@ -73,7 +80,13 @@ export type ExecutePayloadResponse =
|
|
|
73
80
|
latestValidHash: null;
|
|
74
81
|
validationError: null;
|
|
75
82
|
}
|
|
76
|
-
| {
|
|
83
|
+
| {
|
|
84
|
+
status: ExecutionPayloadStatus.VALID;
|
|
85
|
+
latestValidHash: RootHex;
|
|
86
|
+
validationError: null;
|
|
87
|
+
/** PayloadStatusV2: whether the payload satisfied the inclusion list constraints */
|
|
88
|
+
inclusionListSatisfied?: boolean | null;
|
|
89
|
+
}
|
|
77
90
|
| {status: ExecutionPayloadStatus.INVALID; latestValidHash: RootHex | null; validationError: string | null}
|
|
78
91
|
| {
|
|
79
92
|
status:
|
|
@@ -84,6 +97,19 @@ export type ExecutePayloadResponse =
|
|
|
84
97
|
validationError: string;
|
|
85
98
|
};
|
|
86
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
|
+
|
|
87
113
|
export type ForkChoiceUpdateStatus =
|
|
88
114
|
| ExecutionPayloadStatus.VALID
|
|
89
115
|
| ExecutionPayloadStatus.INVALID
|
|
@@ -99,6 +125,8 @@ export type PayloadAttributes = {
|
|
|
99
125
|
parentBeaconBlockRoot?: Uint8Array;
|
|
100
126
|
slotNumber?: number; // EIP-7843
|
|
101
127
|
targetGasLimit?: bigint; // GLOAS (PayloadAttributesV4, execution-apis#796)
|
|
128
|
+
/** Transactions the built payload must include (PayloadAttributesV5, HEZE:EIP-7805) */
|
|
129
|
+
inclusionListTransactions?: bellatrix.Transactions;
|
|
102
130
|
};
|
|
103
131
|
|
|
104
132
|
export type VersionedHashes = Uint8Array[];
|
|
@@ -129,9 +157,16 @@ export interface IExecutionEngine {
|
|
|
129
157
|
executionPayload: ExecutionPayload,
|
|
130
158
|
versionedHashes?: VersionedHashes,
|
|
131
159
|
parentBeaconBlockRoot?: Root,
|
|
132
|
-
executionRequests?: ExecutionRequests
|
|
160
|
+
executionRequests?: ExecutionRequests,
|
|
161
|
+
inclusionListTransactions?: bellatrix.Transactions
|
|
133
162
|
): Promise<ExecutePayloadResponse>;
|
|
134
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Transactions the execution layer wants included in the next payload. Parameterless since
|
|
166
|
+
* execution-apis#609: the execution layer builds against its own view of the head.
|
|
167
|
+
*/
|
|
168
|
+
getInclusionList(): Promise<bellatrix.Transactions>;
|
|
169
|
+
|
|
135
170
|
/**
|
|
136
171
|
* Signal fork choice updates
|
|
137
172
|
* This function performs two actions atomically:
|
|
@@ -142,7 +177,10 @@ export interface IExecutionEngine {
|
|
|
142
177
|
* The call of the notify_forkchoice_updated function maps on the POS_FORKCHOICE_UPDATED event defined in the EIP-3675.
|
|
143
178
|
* https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/fork-choice.md#notify_forkchoice_updated
|
|
144
179
|
*
|
|
145
|
-
* 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.
|
|
146
184
|
*/
|
|
147
185
|
notifyForkchoiceUpdate(
|
|
148
186
|
fork: ForkName,
|
|
@@ -150,7 +188,7 @@ export interface IExecutionEngine {
|
|
|
150
188
|
safeBlockHash: RootHex,
|
|
151
189
|
finalizedBlockHash: RootHex,
|
|
152
190
|
payloadAttributes?: PayloadAttributes
|
|
153
|
-
): Promise<
|
|
191
|
+
): Promise<ForkchoiceUpdatedResult>;
|
|
154
192
|
|
|
155
193
|
/**
|
|
156
194
|
* Given the payload_id, get_payload returns the most recent version of the execution payload that has been built
|
|
@@ -178,9 +216,4 @@ export interface IExecutionEngine {
|
|
|
178
216
|
versionedHashes: VersionedHashes,
|
|
179
217
|
buffers?: Uint8Array[]
|
|
180
218
|
): Promise<BlobAndProofV2[] | null>;
|
|
181
|
-
getBlobs(
|
|
182
|
-
fork: ForkPreFulu,
|
|
183
|
-
versionedHashes: VersionedHashes,
|
|
184
|
-
buffers?: Uint8Array[]
|
|
185
|
-
): Promise<(BlobAndProof | null)[]>;
|
|
186
219
|
}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import {ForkName, ForkSeq} from "@lodestar/params";
|
|
2
|
-
import {ExecutionPayload, ExecutionRequests, Root, RootHex} from "@lodestar/types";
|
|
3
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
2
|
+
import {ExecutionPayload, ExecutionRequests, Root, RootHex, bellatrix} from "@lodestar/types";
|
|
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,
|
|
25
|
+
deserializeInclusionList,
|
|
19
26
|
parseExecutionPayload,
|
|
20
27
|
serializeBeaconBlockRoot,
|
|
21
28
|
serializeExecutionPayload,
|
|
22
29
|
serializeExecutionRequests,
|
|
30
|
+
serializeInclusionList,
|
|
23
31
|
serializePayloadAttributes,
|
|
24
32
|
serializeVersionedHashes,
|
|
25
33
|
} from "./types.js";
|
|
@@ -37,9 +45,9 @@ const notifyNewPayloadOpts: ReqOpts = {routeId: "notifyNewPayload"};
|
|
|
37
45
|
const forkchoiceUpdatedOpts: ReqOpts = {routeId: "forkchoiceUpdated"};
|
|
38
46
|
const getPayloadOpts: ReqOpts = {routeId: "getPayload"};
|
|
39
47
|
const getPayloadBodiesByHashOpts: ReqOpts = {routeId: "getPayloadBodiesByHash"};
|
|
40
|
-
const getBlobsV1Opts: ReqOpts = {routeId: "getBlobsV1"};
|
|
41
48
|
const getBlobsV2Opts: ReqOpts = {routeId: "getBlobsV2"};
|
|
42
49
|
const getClientVersionOpts: ReqOpts = {routeId: "getClientVersion"};
|
|
50
|
+
const getInclusionListOpts: ReqOpts = {routeId: "getInclusionList"};
|
|
43
51
|
|
|
44
52
|
/**
|
|
45
53
|
* Legacy `engine_*` JSON-RPC methods
|
|
@@ -57,7 +65,8 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
57
65
|
executionPayload: ExecutionPayload,
|
|
58
66
|
versionedHashes?: VersionedHashes,
|
|
59
67
|
parentBeaconBlockRoot?: Root,
|
|
60
|
-
executionRequests?: ExecutionRequests
|
|
68
|
+
executionRequests?: ExecutionRequests,
|
|
69
|
+
inclusionListTransactions?: bellatrix.Transactions
|
|
61
70
|
): Promise<PayloadStatusResult> {
|
|
62
71
|
const serializedExecutionPayload = serializeExecutionPayload(fork, executionPayload);
|
|
63
72
|
|
|
@@ -76,6 +85,28 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
76
85
|
if (executionRequests === undefined) {
|
|
77
86
|
throw Error(`executionRequests required in notifyNewPayload for fork=${fork}`);
|
|
78
87
|
}
|
|
88
|
+
if (ForkSeq[fork] >= ForkSeq.heze) {
|
|
89
|
+
if (inclusionListTransactions === undefined) {
|
|
90
|
+
throw Error(`inclusionListTransactions required in notifyNewPayload for fork=${fork}`);
|
|
91
|
+
}
|
|
92
|
+
const method = "engine_newPayloadV6";
|
|
93
|
+
return this.rpc.fetchWithRetries<
|
|
94
|
+
EngineApiRpcReturnTypes[typeof method],
|
|
95
|
+
EngineApiRpcParamTypes[typeof method]
|
|
96
|
+
>(
|
|
97
|
+
{
|
|
98
|
+
method,
|
|
99
|
+
params: [
|
|
100
|
+
serializedExecutionPayload,
|
|
101
|
+
serializedVersionedHashes,
|
|
102
|
+
serializedParentBeaconBlockRoot,
|
|
103
|
+
serializeExecutionRequests(fork, executionRequests),
|
|
104
|
+
serializeInclusionList(inclusionListTransactions),
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
notifyNewPayloadOpts
|
|
108
|
+
);
|
|
109
|
+
}
|
|
79
110
|
const method = ForkSeq[fork] >= ForkSeq.gloas ? "engine_newPayloadV5" : "engine_newPayloadV4";
|
|
80
111
|
return this.rpc.fetchWithRetries<EngineApiRpcReturnTypes[typeof method], EngineApiRpcParamTypes[typeof method]>(
|
|
81
112
|
{
|
|
@@ -113,13 +144,15 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
113
144
|
payloadAttributes?: PayloadAttributes
|
|
114
145
|
): Promise<ForkchoiceUpdatedResult> {
|
|
115
146
|
const method =
|
|
116
|
-
ForkSeq[fork] >= ForkSeq.
|
|
117
|
-
? "
|
|
118
|
-
: ForkSeq[fork] >= ForkSeq.
|
|
119
|
-
? "
|
|
120
|
-
: ForkSeq[fork] >= ForkSeq.
|
|
121
|
-
? "
|
|
122
|
-
:
|
|
147
|
+
ForkSeq[fork] >= ForkSeq.heze
|
|
148
|
+
? "engine_forkchoiceUpdatedV5"
|
|
149
|
+
: ForkSeq[fork] >= ForkSeq.gloas
|
|
150
|
+
? "engine_forkchoiceUpdatedV4"
|
|
151
|
+
: ForkSeq[fork] >= ForkSeq.deneb
|
|
152
|
+
? "engine_forkchoiceUpdatedV3"
|
|
153
|
+
: ForkSeq[fork] >= ForkSeq.capella
|
|
154
|
+
? "engine_forkchoiceUpdatedV2"
|
|
155
|
+
: "engine_forkchoiceUpdatedV1";
|
|
123
156
|
const payloadAttributesRpc = payloadAttributes ? serializePayloadAttributes(payloadAttributes) : undefined;
|
|
124
157
|
// If we are just fcUing and not asking execution for payload, retry is not required
|
|
125
158
|
// and we can move on, as the next fcU will be issued soon on the new slot
|
|
@@ -174,23 +207,6 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
174
207
|
return response.map(deserializeExecutionPayloadBodyV2);
|
|
175
208
|
}
|
|
176
209
|
|
|
177
|
-
async getBlobsV1(versionedHashes: VersionedHashes): Promise<(BlobAndProof | null)[]> {
|
|
178
|
-
assertReqSizeLimit(versionedHashes.length, MAX_VERSIONED_HASHES);
|
|
179
|
-
const versionedHashesHex = versionedHashes.map(bytesToData);
|
|
180
|
-
const response = await this.rpc.fetchWithRetries<
|
|
181
|
-
EngineApiRpcReturnTypes["engine_getBlobsV1"],
|
|
182
|
-
EngineApiRpcParamTypes["engine_getBlobsV1"]
|
|
183
|
-
>({method: "engine_getBlobsV1", params: [versionedHashesHex]}, getBlobsV1Opts);
|
|
184
|
-
|
|
185
|
-
if (response.length !== versionedHashesHex.length) {
|
|
186
|
-
throw Error(
|
|
187
|
-
`Invalid engine_getBlobsV1 response length=${response.length} versionedHashes=${versionedHashesHex.length}`
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return response.map(deserializeBlobAndProofs);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
210
|
async getBlobsV2(versionedHashes: VersionedHashes, buffers?: Uint8Array[]): Promise<BlobAndProofV2[] | null> {
|
|
195
211
|
assertReqSizeLimit(versionedHashes.length, MAX_VERSIONED_HASHES);
|
|
196
212
|
const versionedHashesHex = versionedHashes.map(bytesToData);
|
|
@@ -244,4 +260,13 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
244
260
|
return {code, name: cv.name, version: cv.version, commit: strip0xPrefix(cv.commit)};
|
|
245
261
|
});
|
|
246
262
|
}
|
|
263
|
+
|
|
264
|
+
async getInclusionList(): Promise<bellatrix.Transactions> {
|
|
265
|
+
const method = "engine_getInclusionListV1";
|
|
266
|
+
const response = await this.rpc.fetchWithRetries<
|
|
267
|
+
EngineApiRpcReturnTypes[typeof method],
|
|
268
|
+
EngineApiRpcParamTypes[typeof method]
|
|
269
|
+
>({method, params: []}, getInclusionListOpts);
|
|
270
|
+
return deserializeInclusionList(response);
|
|
271
|
+
}
|
|
247
272
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
+
import {SerializedList} from "@chainsafe/ssz";
|
|
2
3
|
import {ChainConfig} from "@lodestar/config";
|
|
3
4
|
import {
|
|
4
5
|
BLOB_TX_TYPE,
|
|
@@ -137,10 +138,12 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
137
138
|
engine_newPayloadV3: this.notifyNewPayload.bind(this),
|
|
138
139
|
engine_newPayloadV4: this.notifyNewPayload.bind(this),
|
|
139
140
|
engine_newPayloadV5: this.notifyNewPayload.bind(this),
|
|
141
|
+
engine_newPayloadV6: this.notifyNewPayload.bind(this),
|
|
140
142
|
engine_forkchoiceUpdatedV1: this.notifyForkchoiceUpdate.bind(this),
|
|
141
143
|
engine_forkchoiceUpdatedV2: this.notifyForkchoiceUpdate.bind(this),
|
|
142
144
|
engine_forkchoiceUpdatedV3: this.notifyForkchoiceUpdate.bind(this),
|
|
143
145
|
engine_forkchoiceUpdatedV4: this.notifyForkchoiceUpdate.bind(this),
|
|
146
|
+
engine_forkchoiceUpdatedV5: this.notifyForkchoiceUpdate.bind(this),
|
|
144
147
|
engine_getPayloadV1: this.getPayloadV1.bind(this),
|
|
145
148
|
engine_getPayloadV2: this.getPayloadV5.bind(this),
|
|
146
149
|
engine_getPayloadV3: this.getPayloadV5.bind(this),
|
|
@@ -149,8 +152,8 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
149
152
|
engine_getPayloadV6: this.getPayloadV5.bind(this),
|
|
150
153
|
engine_getPayloadBodiesByHashV2: this.getPayloadBodiesByHashV2.bind(this),
|
|
151
154
|
engine_getClientVersionV1: this.getClientVersionV1.bind(this),
|
|
152
|
-
engine_getBlobsV1: this.getBlobs.bind(this),
|
|
153
155
|
engine_getBlobsV2: this.getBlobsV2.bind(this),
|
|
156
|
+
engine_getInclusionListV1: this.getInclusionList.bind(this),
|
|
154
157
|
};
|
|
155
158
|
}
|
|
156
159
|
|
|
@@ -234,7 +237,13 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
234
237
|
// IF the payload has been fully validated while processing the call
|
|
235
238
|
// RETURN payload status from the Payload validation process
|
|
236
239
|
// If validation succeeds, the response MUST contain {status: VALID, latestValidHash: payload.blockHash}
|
|
237
|
-
|
|
240
|
+
// The mock does not check inclusion list constraints, so every payload satisfies them (PayloadStatusV2)
|
|
241
|
+
return {
|
|
242
|
+
status: ExecutionPayloadStatus.VALID,
|
|
243
|
+
latestValidHash: blockHash,
|
|
244
|
+
validationError: null,
|
|
245
|
+
inclusionListSatisfied: true,
|
|
246
|
+
};
|
|
238
247
|
}
|
|
239
248
|
|
|
240
249
|
/**
|
|
@@ -343,14 +352,14 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
343
352
|
executionPayload.gasUsed = Math.floor(0.5 * INTEROP_GAS_LIMIT);
|
|
344
353
|
executionPayload.timestamp = payloadAttributes.timestamp;
|
|
345
354
|
executionPayload.blockHash = crypto.randomBytes(32);
|
|
346
|
-
|
|
355
|
+
const transactions: Uint8Array[] = [];
|
|
347
356
|
|
|
348
357
|
// Between 0 and 4 transactions for all forks
|
|
349
358
|
const eip1559TxCount = Math.round(4 * Math.random());
|
|
350
359
|
for (let i = 0; i < eip1559TxCount; i++) {
|
|
351
360
|
const tx = crypto.randomBytes(512);
|
|
352
361
|
tx[0] = TX_TYPE_EIP1559;
|
|
353
|
-
|
|
362
|
+
transactions.push(tx);
|
|
354
363
|
}
|
|
355
364
|
|
|
356
365
|
const commitments: deneb.KZGCommitment[] = [];
|
|
@@ -364,7 +373,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
364
373
|
const blob = generateRandomBlob();
|
|
365
374
|
const commitment = kzg.blobToKzgCommitment(blob);
|
|
366
375
|
const {proofs: cellProofs} = kzg.computeCellsAndKzgProofs(blob);
|
|
367
|
-
|
|
376
|
+
transactions.push(transactionForKzgCommitment(commitment));
|
|
368
377
|
commitments.push(commitment);
|
|
369
378
|
blobs.push(blob);
|
|
370
379
|
proofs.push(...cellProofs);
|
|
@@ -376,12 +385,13 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
376
385
|
const blob = generateRandomBlob();
|
|
377
386
|
const commitment = kzg.blobToKzgCommitment(blob);
|
|
378
387
|
const proof = kzg.computeBlobKzgProof(blob, commitment);
|
|
379
|
-
|
|
388
|
+
transactions.push(transactionForKzgCommitment(commitment));
|
|
380
389
|
commitments.push(commitment);
|
|
381
390
|
blobs.push(blob);
|
|
382
391
|
proofs.push(proof);
|
|
383
392
|
}
|
|
384
393
|
}
|
|
394
|
+
executionPayload.transactions = SerializedList.fromArray(transactions);
|
|
385
395
|
|
|
386
396
|
if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
387
397
|
(executionPayload as ExecutionPayload<ForkPostCapella>).withdrawals = ssz.capella.Withdrawals.defaultValue();
|
|
@@ -409,7 +419,12 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
409
419
|
// IF the payload is deemed VALID and the build process has begun
|
|
410
420
|
// {payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: buildProcessId}
|
|
411
421
|
return {
|
|
412
|
-
payloadStatus: {
|
|
422
|
+
payloadStatus: {
|
|
423
|
+
status: ExecutionPayloadStatus.VALID,
|
|
424
|
+
latestValidHash: null,
|
|
425
|
+
validationError: null,
|
|
426
|
+
inclusionListSatisfied: true,
|
|
427
|
+
},
|
|
413
428
|
payloadId: String(payloadId as number),
|
|
414
429
|
};
|
|
415
430
|
}
|
|
@@ -418,7 +433,12 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
418
433
|
// IF the payload is deemed VALID and a build process hasn't been started
|
|
419
434
|
// {payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: null}
|
|
420
435
|
return {
|
|
421
|
-
payloadStatus: {
|
|
436
|
+
payloadStatus: {
|
|
437
|
+
status: ExecutionPayloadStatus.VALID,
|
|
438
|
+
latestValidHash: null,
|
|
439
|
+
validationError: null,
|
|
440
|
+
inclusionListSatisfied: true,
|
|
441
|
+
},
|
|
422
442
|
payloadId: null,
|
|
423
443
|
};
|
|
424
444
|
}
|
|
@@ -475,18 +495,16 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
475
495
|
return [{code: ClientCode.XX, name: "mock", version: "", commit: ""}];
|
|
476
496
|
}
|
|
477
497
|
|
|
478
|
-
private getBlobs(
|
|
479
|
-
versionedHashes: EngineApiRpcParamTypes["engine_getBlobsV1"][0]
|
|
480
|
-
): EngineApiRpcReturnTypes["engine_getBlobsV1"] {
|
|
481
|
-
return versionedHashes.map((_vh) => null);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
498
|
private getBlobsV2(
|
|
485
499
|
_versionedHashes: EngineApiRpcParamTypes["engine_getBlobsV2"][0]
|
|
486
500
|
): EngineApiRpcReturnTypes["engine_getBlobsV2"] {
|
|
487
501
|
return null;
|
|
488
502
|
}
|
|
489
503
|
|
|
504
|
+
private getInclusionList(): EngineApiRpcReturnTypes["engine_getInclusionListV1"] {
|
|
505
|
+
return [];
|
|
506
|
+
}
|
|
507
|
+
|
|
490
508
|
private timestampToFork(timestamp: number): ForkPostBellatrix {
|
|
491
509
|
if (timestamp >= this.gloasForkTimestamp) return ForkName.gloas;
|
|
492
510
|
if (timestamp >= this.fuluForkTimestamp) return ForkName.fulu;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import {byteArrayEquals} from "@chainsafe/ssz";
|
|
1
2
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
|
+
import {bellatrix} from "@lodestar/types";
|
|
2
4
|
import {pruneSetToMax} from "@lodestar/utils";
|
|
3
5
|
import {PayloadAttributesRpc} from "./types.js";
|
|
4
6
|
import {DATA, QUANTITY} from "./utils.js";
|
|
@@ -17,13 +19,18 @@ export type WithdrawalV1 = {
|
|
|
17
19
|
amount: QUANTITY;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
|
-
type FcuAttributes = {headBlockHash: DATA
|
|
22
|
+
type FcuAttributes = {headBlockHash: DATA} & Omit<PayloadAttributesRpc, "withdrawals" | "inclusionListTransactions"> & {
|
|
23
|
+
inclusionListTransactions?: bellatrix.Transactions;
|
|
24
|
+
};
|
|
21
25
|
|
|
22
26
|
export class PayloadIdCache {
|
|
23
|
-
private readonly payloadIdByFcuAttributes = new Map<
|
|
27
|
+
private readonly payloadIdByFcuAttributes = new Map<
|
|
28
|
+
string,
|
|
29
|
+
{payloadId: PayloadId; fullKey: string; inclusionListTransactions?: bellatrix.Transactions}
|
|
30
|
+
>();
|
|
24
31
|
|
|
25
|
-
getFullKey({headBlockHash,
|
|
26
|
-
return `${headBlockHash}-${
|
|
32
|
+
getFullKey({headBlockHash, timestamp, prevRandao, suggestedFeeRecipient}: FcuAttributes): string {
|
|
33
|
+
return `${headBlockHash}-${timestamp}-${prevRandao}-${suggestedFeeRecipient}`;
|
|
27
34
|
}
|
|
28
35
|
getKey({timestamp}: Pick<FcuAttributes, "timestamp">): string {
|
|
29
36
|
return timestamp;
|
|
@@ -37,7 +44,8 @@ export class PayloadIdCache {
|
|
|
37
44
|
add(fcuAttributes: FcuAttributes, payloadId: PayloadId): void {
|
|
38
45
|
const key = this.getKey(fcuAttributes);
|
|
39
46
|
const fullKey = this.getFullKey(fcuAttributes);
|
|
40
|
-
|
|
47
|
+
const {inclusionListTransactions} = fcuAttributes;
|
|
48
|
+
this.payloadIdByFcuAttributes.set(key, {payloadId, fullKey, inclusionListTransactions});
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
prune(): void {
|
|
@@ -49,6 +57,16 @@ export class PayloadIdCache {
|
|
|
49
57
|
const key = this.getKey(fcuAttributes);
|
|
50
58
|
const fullKey = this.getFullKey(fcuAttributes);
|
|
51
59
|
const payloadInfo = this.payloadIdByFcuAttributes.get(key);
|
|
52
|
-
return payloadInfo?.fullKey === fullKey
|
|
60
|
+
return payloadInfo?.fullKey === fullKey &&
|
|
61
|
+
isSameInclusionList(payloadInfo.inclusionListTransactions, fcuAttributes.inclusionListTransactions)
|
|
62
|
+
? payloadInfo.payloadId
|
|
63
|
+
: undefined;
|
|
53
64
|
}
|
|
54
65
|
}
|
|
66
|
+
|
|
67
|
+
function isSameInclusionList(a?: bellatrix.Transactions, b?: bellatrix.Transactions): boolean {
|
|
68
|
+
if (a === undefined || b === undefined) {
|
|
69
|
+
return a === b;
|
|
70
|
+
}
|
|
71
|
+
return byteArrayEquals(a.bytes, b.bytes);
|
|
72
|
+
}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import {Type} from "@chainsafe/ssz";
|
|
2
2
|
import {CELLS_PER_EXT_BLOB, ForkName, ForkSeq, isForkPostBellatrix} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
ExecutionPayload,
|
|
5
|
+
ExecutionRequests,
|
|
6
|
+
Root,
|
|
7
|
+
RootHex,
|
|
8
|
+
bellatrix,
|
|
9
|
+
capella,
|
|
10
|
+
deneb,
|
|
11
|
+
electra,
|
|
12
|
+
gloas,
|
|
13
|
+
} from "@lodestar/types";
|
|
5
14
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
6
15
|
import {EndTimer, LodestarError, fromHex, strip0xPrefix, toHex, toRootHex} from "@lodestar/utils";
|
|
7
16
|
import {isValidBlobVersionedHashes} from "./blobVersionedHashes.js";
|
|
@@ -9,15 +18,16 @@ import {
|
|
|
9
18
|
ClientCode,
|
|
10
19
|
ClientVersion,
|
|
11
20
|
ExecutionPayloadStatus,
|
|
21
|
+
ForkchoiceUpdatedResult,
|
|
12
22
|
PayloadAttributes,
|
|
13
23
|
PayloadId,
|
|
24
|
+
PayloadStatusResult,
|
|
14
25
|
VersionedHashes,
|
|
15
26
|
} from "./interface.js";
|
|
16
27
|
import {JsonRpcHttpClientEventEmitter, ReqOpts} from "./jsonRpcHttpClient.js";
|
|
17
28
|
import {EngineRestHttpClient, EngineRestResponseError} from "./restHttpClient.js";
|
|
18
29
|
import {
|
|
19
30
|
BlobsRequest,
|
|
20
|
-
BlobsV1Response,
|
|
21
31
|
BlobsV2Response,
|
|
22
32
|
BodiesByHashRequest,
|
|
23
33
|
BodiesResponseBellatrix,
|
|
@@ -47,7 +57,7 @@ import {
|
|
|
47
57
|
PayloadStatusSsz,
|
|
48
58
|
executionForkName,
|
|
49
59
|
} from "./sszTypes.js";
|
|
50
|
-
import {
|
|
60
|
+
import {GetPayloadResult, IEngineTransport} from "./transport.js";
|
|
51
61
|
import {EngineTransportMetrics} from "./transportMetrics.js";
|
|
52
62
|
import {
|
|
53
63
|
ExecutionPayloadBodyV2,
|
|
@@ -78,7 +88,6 @@ const notifyNewPayloadOpts: ReqOpts = {routeId: "notifyNewPayload"};
|
|
|
78
88
|
const forkchoiceUpdatedOpts: ReqOpts = {routeId: "forkchoiceUpdated"};
|
|
79
89
|
const getPayloadOpts: ReqOpts = {routeId: "getPayload"};
|
|
80
90
|
const getPayloadBodiesByHashOpts: ReqOpts = {routeId: "getPayloadBodiesByHash"};
|
|
81
|
-
const getBlobsV1Opts: ReqOpts = {routeId: "getBlobsV1"};
|
|
82
91
|
const getBlobsV2Opts: ReqOpts = {routeId: "getBlobsV2"};
|
|
83
92
|
const getClientVersionOpts: ReqOpts = {routeId: "getClientVersion"};
|
|
84
93
|
const getCapabilitiesOpts: ReqOpts = {routeId: "getCapabilities", retries: 0};
|
|
@@ -376,24 +385,6 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
376
385
|
return bodies;
|
|
377
386
|
}
|
|
378
387
|
|
|
379
|
-
async getBlobsV1(versionedHashes: VersionedHashes): Promise<(BlobAndProof | null)[]> {
|
|
380
|
-
assertReqSizeLimit(versionedHashes.length, this.limits.blobsMaxVersionedHashes);
|
|
381
|
-
const res = await this.client.request(
|
|
382
|
-
{method: "POST", path: "/blobs/v1", body: BlobsRequest.serialize({versionedHashes}), responseType: "ssz"},
|
|
383
|
-
getBlobsV1Opts
|
|
384
|
-
);
|
|
385
|
-
// 204 means the EL cannot serve blobs at all, e.g. while syncing
|
|
386
|
-
if (res.status === 204) {
|
|
387
|
-
return versionedHashes.map(() => null);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
const {entries} = deserializeResponse(BlobsV1Response, res.body, "getBlobsV1", this.metrics);
|
|
391
|
-
if (entries.length !== versionedHashes.length) {
|
|
392
|
-
throw Error(`Invalid blobs/v1 response length=${entries.length} versionedHashes=${versionedHashes.length}`);
|
|
393
|
-
}
|
|
394
|
-
return entries.map((entry) => (entry.available ? entry.contents : null));
|
|
395
|
-
}
|
|
396
|
-
|
|
397
388
|
/**
|
|
398
389
|
* Blobs and proofs are views into the response body rather than copies, the response is all-or-nothing
|
|
399
390
|
* so every byte of it is needed. The pooled buffers of the JSON-RPC transport are not used.
|
|
@@ -454,6 +445,10 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
454
445
|
};
|
|
455
446
|
});
|
|
456
447
|
}
|
|
448
|
+
|
|
449
|
+
getInclusionList(): Promise<bellatrix.Transactions> {
|
|
450
|
+
throw Error("engine_getInclusionListV1 is not available over the REST engine API");
|
|
451
|
+
}
|
|
457
452
|
}
|
|
458
453
|
|
|
459
454
|
function toPayloadAttributesBellatrix(attributes: PayloadAttributes) {
|
|
@@ -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,22 +1,17 @@
|
|
|
1
1
|
import {ForkName} from "@lodestar/params";
|
|
2
|
-
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei} from "@lodestar/types";
|
|
3
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
2
|
+
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei, bellatrix} from "@lodestar/types";
|
|
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
|
-
};
|
|
14
|
-
|
|
15
|
-
export type ForkchoiceUpdatedResult = {
|
|
16
|
-
payloadStatus: PayloadStatusResult;
|
|
17
|
-
payloadId: PayloadId | null;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
15
|
export type GetPayloadResult = {
|
|
21
16
|
executionPayload: ExecutionPayload;
|
|
22
17
|
executionPayloadValue: Wei;
|
|
@@ -38,7 +33,8 @@ export interface IEngineTransport {
|
|
|
38
33
|
executionPayload: ExecutionPayload,
|
|
39
34
|
versionedHashes?: VersionedHashes,
|
|
40
35
|
parentBeaconBlockRoot?: Root,
|
|
41
|
-
executionRequests?: ExecutionRequests
|
|
36
|
+
executionRequests?: ExecutionRequests,
|
|
37
|
+
inclusionListTransactions?: bellatrix.Transactions
|
|
42
38
|
): Promise<PayloadStatusResult>;
|
|
43
39
|
|
|
44
40
|
forkchoiceUpdated(
|
|
@@ -53,9 +49,9 @@ export interface IEngineTransport {
|
|
|
53
49
|
|
|
54
50
|
getPayloadBodiesByHashV2(blockHashes: RootHex[]): Promise<(ExecutionPayloadBodyV2 | null)[]>;
|
|
55
51
|
|
|
56
|
-
getBlobsV1(versionedHashes: VersionedHashes): Promise<(BlobAndProof | null)[]>;
|
|
57
|
-
|
|
58
52
|
getBlobsV2(versionedHashes: VersionedHashes, buffers?: Uint8Array[]): Promise<BlobAndProofV2[] | null>;
|
|
59
53
|
|
|
60
54
|
getClientVersion(clientVersion: ClientVersion): Promise<ClientVersion[]>;
|
|
55
|
+
|
|
56
|
+
getInclusionList(): Promise<bellatrix.Transactions>;
|
|
61
57
|
}
|