@lodestar/beacon-node 1.42.0-dev.4118b5b440 → 1.42.0-dev.47afaa6bb7
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 +25 -13
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +5 -1
- 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 +38 -40
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +8 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +34 -28
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- 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/historicalState/getHistoricalState.d.ts +3 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -3
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +4 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +37 -23
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -8
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +87 -51
- 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 +3 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.d.ts +21 -15
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +2 -2
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +4 -4
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +5 -5
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +5 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +4 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +15 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +114 -66
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +31 -9
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +12 -3
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +10 -5
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +30 -24
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +2 -2
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +15 -14
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +11 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +13 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- 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 +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +10 -4
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +9 -10
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +7 -7
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +32 -17
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +13 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +14 -14
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +6 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +6 -6
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +14 -14
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +15 -6
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +185 -6
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +10 -7
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +7 -3
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +5 -3
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +3 -3
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +5 -1
- 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 +5 -2
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +3 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +11 -9
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/buckets.d.ts +2 -2
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js +4 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +20 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +33 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/interface.d.ts +6 -3
- 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 +22 -11
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +6 -3
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +10 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +7 -2
- package/lib/network/options.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +25 -5
- 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 +260 -73
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +11 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +234 -22
- 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 +9 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- 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 +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +10 -4
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +16 -4
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +3 -3
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +2 -2
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -2
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/unknownBlock.js +2 -2
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +3 -3
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +4 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +3 -3
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +10 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +3 -3
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +21 -10
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/dataColumns.d.ts +18 -11
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +51 -17
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +6 -2
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +49 -25
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +25 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +189 -2
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +33 -16
- package/src/api/impl/beacon/pool/index.ts +5 -1
- package/src/api/impl/beacon/state/index.ts +43 -55
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +8 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +37 -42
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -4
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +4 -4
- package/src/chain/blocks/importBlock.ts +50 -31
- package/src/chain/blocks/importExecutionPayload.ts +98 -62
- package/src/chain/blocks/index.ts +3 -2
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/types.ts +26 -15
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +10 -14
- package/src/chain/blocks/verifyBlocksSignatures.ts +10 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +151 -98
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +8 -5
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/forkChoice/index.ts +35 -41
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +16 -15
- package/src/chain/lightClient/index.ts +17 -18
- package/src/chain/opPools/aggregatedAttestationPool.ts +20 -21
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +14 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +13 -16
- package/src/chain/produceBlock/produceBlockBody.ts +51 -48
- package/src/chain/regen/interface.ts +13 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
- package/src/chain/serializeState.ts +3 -3
- package/src/chain/shufflingCache.ts +5 -7
- package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
- package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
- package/src/chain/stateCache/types.ts +14 -18
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +16 -10
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +10 -10
- package/src/chain/validation/executionPayloadEnvelope.ts +7 -4
- package/src/chain/validation/payloadAttestationMessage.ts +6 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +10 -6
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +9 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +15 -13
- package/src/db/buckets.ts +2 -2
- package/src/db/repositories/dataColumnSidecar.ts +4 -2
- package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
- package/src/metrics/metrics/lodestar.ts +34 -0
- package/src/network/interface.ts +17 -3
- package/src/network/libp2p/index.ts +24 -13
- package/src/network/network.ts +37 -6
- package/src/network/options.ts +7 -2
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +325 -86
- package/src/network/processor/index.ts +304 -22
- package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +26 -5
- package/src/node/nodejs.ts +6 -5
- package/src/node/notifier.ts +5 -6
- package/src/sync/backfill/backfill.ts +3 -3
- package/src/sync/unknownBlock.ts +3 -3
- package/src/sync/utils/downloadByRange.ts +9 -7
- package/src/sync/utils/downloadByRoot.ts +16 -12
- package/src/util/blobs.ts +35 -15
- package/src/util/dataColumns.ts +69 -25
- package/src/util/execution.ts +49 -30
- package/src/util/sszBytes.ts +245 -3
- package/src/util/types.ts +6 -0
|
@@ -3,6 +3,7 @@ import {routes} from "@lodestar/api";
|
|
|
3
3
|
import {
|
|
4
4
|
AncestorStatus,
|
|
5
5
|
EpochDifference,
|
|
6
|
+
ExecutionStatus,
|
|
6
7
|
ForkChoiceError,
|
|
7
8
|
ForkChoiceErrorCode,
|
|
8
9
|
NotReorgedReason,
|
|
@@ -18,15 +19,14 @@ import {
|
|
|
18
19
|
SLOTS_PER_EPOCH,
|
|
19
20
|
} from "@lodestar/params";
|
|
20
21
|
import {
|
|
21
|
-
|
|
22
|
-
EpochCache,
|
|
22
|
+
IBeaconStateView,
|
|
23
23
|
RootCache,
|
|
24
24
|
computeEpochAtSlot,
|
|
25
25
|
computeStartSlotAtEpoch,
|
|
26
26
|
computeTimeAtSlot,
|
|
27
|
-
isExecutionStateType,
|
|
28
27
|
isStartSlotOfEpoch,
|
|
29
|
-
|
|
28
|
+
isStatePostAltair,
|
|
29
|
+
isStatePostBellatrix,
|
|
30
30
|
} from "@lodestar/state-transition";
|
|
31
31
|
import {
|
|
32
32
|
Attestation,
|
|
@@ -87,7 +87,7 @@ export async function importBlock(
|
|
|
87
87
|
fullyVerifiedBlock: FullyVerifiedBlock,
|
|
88
88
|
opts: ImportBlockOpts
|
|
89
89
|
): Promise<void> {
|
|
90
|
-
const {blockInput,
|
|
90
|
+
const {blockInput, postBlockState, parentBlockSlot, executionStatus, dataAvailabilityStatus, indexedAttestations} =
|
|
91
91
|
fullyVerifiedBlock;
|
|
92
92
|
const block = blockInput.getBlock();
|
|
93
93
|
const source = blockInput.getBlockSource();
|
|
@@ -99,7 +99,7 @@ export async function importBlock(
|
|
|
99
99
|
const blockEpoch = computeEpochAtSlot(blockSlot);
|
|
100
100
|
const prevFinalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
101
101
|
const blockDelaySec =
|
|
102
|
-
fullyVerifiedBlock.seenTimestampSec - computeTimeAtSlot(this.config, blockSlot,
|
|
102
|
+
fullyVerifiedBlock.seenTimestampSec - computeTimeAtSlot(this.config, blockSlot, postBlockState.genesisTime);
|
|
103
103
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
104
104
|
const fork = this.config.getForkSeq(blockSlot);
|
|
105
105
|
|
|
@@ -122,13 +122,13 @@ export async function importBlock(
|
|
|
122
122
|
// 2. Import block to fork choice
|
|
123
123
|
|
|
124
124
|
// Should compute checkpoint balances before forkchoice.onBlock
|
|
125
|
-
this.checkpointBalancesCache.processState(blockRootHex,
|
|
125
|
+
this.checkpointBalancesCache.processState(blockRootHex, postBlockState);
|
|
126
126
|
const blockSummary = this.forkChoice.onBlock(
|
|
127
127
|
block.message,
|
|
128
|
-
|
|
128
|
+
postBlockState,
|
|
129
129
|
blockDelaySec,
|
|
130
130
|
currentSlot,
|
|
131
|
-
executionStatus,
|
|
131
|
+
fork >= ForkSeq.gloas ? ExecutionStatus.PayloadSeparated : executionStatus,
|
|
132
132
|
dataAvailabilityStatus
|
|
133
133
|
);
|
|
134
134
|
|
|
@@ -138,13 +138,14 @@ export async function importBlock(
|
|
|
138
138
|
// Post-Gloas: blockSummary.payloadStatus is always PENDING, so payloadPresent = false (block state only, no payload processing yet)
|
|
139
139
|
const payloadPresent = !isGloasBlock(blockSummary);
|
|
140
140
|
// processState manages both block state and payload state variants together for memory/disk management
|
|
141
|
-
this.regen.processBlockState(blockRootHex,
|
|
141
|
+
this.regen.processBlockState(blockRootHex, postBlockState);
|
|
142
142
|
|
|
143
143
|
// For Gloas blocks, create PayloadEnvelopeInput so it's available for later payload import
|
|
144
144
|
if (fork >= ForkSeq.gloas) {
|
|
145
|
-
this.seenPayloadEnvelopeInputCache.add({
|
|
145
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.add({
|
|
146
146
|
blockRootHex,
|
|
147
147
|
block: block as SignedBeaconBlock<ForkPostGloas>,
|
|
148
|
+
forkName: blockInput.forkName,
|
|
148
149
|
sampledColumns: this.custodyConfig.sampledColumns,
|
|
149
150
|
custodyColumns: this.custodyConfig.custodyColumns,
|
|
150
151
|
timeCreatedSec: fullyVerifiedBlock.seenTimestampSec,
|
|
@@ -155,6 +156,22 @@ export async function importBlock(
|
|
|
155
156
|
source: source.source,
|
|
156
157
|
...(opts.seenTimestampSec !== undefined ? {recvToImport: Date.now() / 1000 - opts.seenTimestampSec} : {}),
|
|
157
158
|
});
|
|
159
|
+
|
|
160
|
+
// Immediately attempt fetch of data columns from execution engine as the bid contains kzg commitments
|
|
161
|
+
// which is all the information we need so there is no reason to delay until execution payload arrives
|
|
162
|
+
// TODO GLOAS: If we want EL retries after this initial attempt, add an explicit retry policy here
|
|
163
|
+
// (for example later in the slot). Do not couple retries to incoming gossip columns.
|
|
164
|
+
this.getBlobsTracker.triggerGetBlobs(payloadInput, () => {
|
|
165
|
+
// TODO GLOAS: come up with a better mechanism to trigger processExecutionPayload after data becomes available,
|
|
166
|
+
// similar to how pre-gloas uses waitForBlockAndAllData with a cutoff timeout and incompleteBlockInput event
|
|
167
|
+
this.processExecutionPayload(payloadInput, {validSignature: true}).catch((e) => {
|
|
168
|
+
this.logger.debug(
|
|
169
|
+
"Error processing execution payload after getBlobs",
|
|
170
|
+
{slot: blockSlot, root: blockRootHex},
|
|
171
|
+
e as Error
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
158
175
|
}
|
|
159
176
|
|
|
160
177
|
this.metrics?.importBlock.bySource.inc({source: source.source});
|
|
@@ -174,7 +191,7 @@ export async function importBlock(
|
|
|
174
191
|
(opts.importAttestations !== AttestationImportOpt.Skip && blockEpoch >= currentEpoch - FORK_CHOICE_ATT_EPOCH_LIMIT)
|
|
175
192
|
) {
|
|
176
193
|
const attestations = block.message.body.attestations;
|
|
177
|
-
const rootCache = new RootCache(
|
|
194
|
+
const rootCache = new RootCache(postBlockState);
|
|
178
195
|
const invalidAttestationErrorsByCode = new Map<string, {error: Error; count: number}>();
|
|
179
196
|
|
|
180
197
|
const addAttestation = fork >= ForkSeq.electra ? addAttestationPostElectra : addAttestationPreElectra;
|
|
@@ -188,7 +205,7 @@ export async function importBlock(
|
|
|
188
205
|
const attDataRoot = toRootHex(ssz.phase0.AttestationData.hashTreeRoot(indexedAttestation.data));
|
|
189
206
|
addAttestation.call(
|
|
190
207
|
this,
|
|
191
|
-
|
|
208
|
+
postBlockState,
|
|
192
209
|
target,
|
|
193
210
|
attDataRoot,
|
|
194
211
|
attestation as Attestation<ForkPostElectra>,
|
|
@@ -303,7 +320,7 @@ export async function importBlock(
|
|
|
303
320
|
|
|
304
321
|
if (newHead.blockRoot !== oldHead.blockRoot) {
|
|
305
322
|
// Set head state as strong reference
|
|
306
|
-
this.regen.updateHeadState(newHead,
|
|
323
|
+
this.regen.updateHeadState(newHead, postBlockState);
|
|
307
324
|
|
|
308
325
|
try {
|
|
309
326
|
this.emitter.emit(routes.events.EventType.head, {
|
|
@@ -373,11 +390,13 @@ export async function importBlock(
|
|
|
373
390
|
// we want to import block asap so do this in the next event loop
|
|
374
391
|
callInNextEventLoop(() => {
|
|
375
392
|
try {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
393
|
+
if (isStatePostAltair(postBlockState)) {
|
|
394
|
+
this.lightClientServer?.onImportBlockHead(
|
|
395
|
+
block.message as BeaconBlock<ForkPostAltair>,
|
|
396
|
+
postBlockState,
|
|
397
|
+
parentBlockSlot
|
|
398
|
+
);
|
|
399
|
+
}
|
|
381
400
|
} catch (e) {
|
|
382
401
|
this.logger.verbose("Error lightClientServer.onImportBlock", {slot: blockSlot}, e as Error);
|
|
383
402
|
}
|
|
@@ -396,11 +415,11 @@ export async function importBlock(
|
|
|
396
415
|
// and the block is weak and can potentially be reorged out.
|
|
397
416
|
let shouldOverrideFcu = false;
|
|
398
417
|
|
|
399
|
-
if (blockSlot >= currentSlot &&
|
|
418
|
+
if (blockSlot >= currentSlot && isStatePostBellatrix(postBlockState) && postBlockState.isExecutionStateType) {
|
|
400
419
|
let notOverrideFcuReason = NotReorgedReason.Unknown;
|
|
401
420
|
const proposalSlot = blockSlot + 1;
|
|
402
421
|
try {
|
|
403
|
-
const proposerIndex =
|
|
422
|
+
const proposerIndex = postBlockState.getBeaconProposer(proposalSlot);
|
|
404
423
|
const feeRecipient = this.beaconProposerCache.get(proposerIndex);
|
|
405
424
|
|
|
406
425
|
if (feeRecipient) {
|
|
@@ -480,20 +499,20 @@ export async function importBlock(
|
|
|
480
499
|
}
|
|
481
500
|
}
|
|
482
501
|
|
|
483
|
-
if (!isStateValidatorsNodesPopulated(
|
|
484
|
-
this.logger.verbose("After importBlock caching postState without SSZ cache", {slot:
|
|
502
|
+
if (!postBlockState.isStateValidatorsNodesPopulated()) {
|
|
503
|
+
this.logger.verbose("After importBlock caching postState without SSZ cache", {slot: postBlockState.slot});
|
|
485
504
|
}
|
|
486
505
|
|
|
487
506
|
// Cache shufflings when crossing an epoch boundary
|
|
488
507
|
const parentEpoch = computeEpochAtSlot(parentBlockSlot);
|
|
489
508
|
if (parentEpoch < blockEpoch) {
|
|
490
|
-
this.shufflingCache.processState(
|
|
509
|
+
this.shufflingCache.processState(postBlockState);
|
|
491
510
|
this.logger.verbose("Processed shuffling for next epoch", {parentEpoch, blockEpoch, slot: blockSlot});
|
|
492
511
|
}
|
|
493
512
|
|
|
494
513
|
if (blockSlot % SLOTS_PER_EPOCH === 0) {
|
|
495
514
|
// Cache state to preserve epoch transition work
|
|
496
|
-
const checkpointState =
|
|
515
|
+
const checkpointState = postBlockState;
|
|
497
516
|
const cp = getCheckpointFromState(checkpointState);
|
|
498
517
|
this.regen.addCheckpointState(cp, checkpointState, payloadPresent);
|
|
499
518
|
// consumers should not mutate state ever
|
|
@@ -502,7 +521,7 @@ export async function importBlock(
|
|
|
502
521
|
// Note: in-lined code from previos handler of ChainEvent.checkpoint
|
|
503
522
|
this.logger.verbose("Checkpoint processed", toCheckpointHexPayload(cp, payloadPresent));
|
|
504
523
|
|
|
505
|
-
const activeValidatorsCount = checkpointState.
|
|
524
|
+
const activeValidatorsCount = checkpointState.activeValidatorCount;
|
|
506
525
|
this.metrics?.currentActiveValidators.set(activeValidatorsCount);
|
|
507
526
|
this.metrics?.currentValidators.set({status: "active"}, activeValidatorsCount);
|
|
508
527
|
|
|
@@ -583,11 +602,11 @@ export async function importBlock(
|
|
|
583
602
|
this.metrics?.parentBlockDistance.observe(blockSlot - parentBlockSlot);
|
|
584
603
|
this.metrics?.proposerBalanceDeltaAny.observe(fullyVerifiedBlock.proposerBalanceDelta);
|
|
585
604
|
this.validatorMonitor?.registerImportedBlock(block.message, fullyVerifiedBlock);
|
|
586
|
-
if (
|
|
605
|
+
if (isStatePostAltair(fullyVerifiedBlock.postBlockState)) {
|
|
587
606
|
this.validatorMonitor?.registerSyncAggregateInBlock(
|
|
588
607
|
blockEpoch,
|
|
589
608
|
(block as altair.SignedBeaconBlock).message.body.syncAggregate,
|
|
590
|
-
fullyVerifiedBlock.
|
|
609
|
+
fullyVerifiedBlock.postBlockState.currentSyncCommitteeIndexed.validatorIndices
|
|
591
610
|
);
|
|
592
611
|
}
|
|
593
612
|
|
|
@@ -629,7 +648,7 @@ export async function importBlock(
|
|
|
629
648
|
export function addAttestationPreElectra(
|
|
630
649
|
this: BeaconChain,
|
|
631
650
|
// added to have the same signature as addAttestationPostElectra
|
|
632
|
-
_:
|
|
651
|
+
_: IBeaconStateView,
|
|
633
652
|
target: phase0.Checkpoint,
|
|
634
653
|
attDataRoot: string,
|
|
635
654
|
attestation: Attestation,
|
|
@@ -646,7 +665,7 @@ export function addAttestationPreElectra(
|
|
|
646
665
|
|
|
647
666
|
export function addAttestationPostElectra(
|
|
648
667
|
this: BeaconChain,
|
|
649
|
-
|
|
668
|
+
state: IBeaconStateView,
|
|
650
669
|
target: phase0.Checkpoint,
|
|
651
670
|
attDataRoot: string,
|
|
652
671
|
attestation: Attestation<ForkPostElectra>,
|
|
@@ -664,7 +683,7 @@ export function addAttestationPostElectra(
|
|
|
664
683
|
} else {
|
|
665
684
|
const attSlot = attestation.data.slot;
|
|
666
685
|
const attEpoch = computeEpochAtSlot(attSlot);
|
|
667
|
-
const decisionRoot =
|
|
686
|
+
const decisionRoot = state.getShufflingDecisionRoot(attEpoch);
|
|
668
687
|
const committees = this.shufflingCache.getBeaconCommittees(attEpoch, decisionRoot, attSlot, committeeIndices);
|
|
669
688
|
const aggregationBools = attestation.aggregationBits.toBoolArray();
|
|
670
689
|
let offset = 0;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
CachedBeaconStateGloas,
|
|
6
|
-
getExecutionPayloadEnvelopeSignatureSet,
|
|
7
|
-
} from "@lodestar/state-transition";
|
|
8
|
-
import {processExecutionPayloadEnvelope} from "@lodestar/state-transition/block";
|
|
2
|
+
import {ExecutionStatus, PayloadExecutionStatus} from "@lodestar/fork-choice";
|
|
3
|
+
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
4
|
+
import {getExecutionPayloadEnvelopeSignatureSet, isStatePostGloas} from "@lodestar/state-transition";
|
|
9
5
|
import {byteArrayEquals, fromHex, toRootHex} from "@lodestar/utils";
|
|
10
6
|
import {ExecutionPayloadStatus} from "../../execution/index.js";
|
|
11
7
|
import {isQueueErrorAborted} from "../../util/queue/index.js";
|
|
@@ -56,18 +52,33 @@ export class PayloadError extends Error {
|
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
|
|
55
|
+
function toForkChoiceExecutionStatus(status: ExecutionPayloadStatus): PayloadExecutionStatus {
|
|
56
|
+
switch (status) {
|
|
57
|
+
case ExecutionPayloadStatus.VALID:
|
|
58
|
+
return ExecutionStatus.Valid;
|
|
59
|
+
// TODO GLOAS: Handle optimistic import for payload
|
|
60
|
+
case ExecutionPayloadStatus.SYNCING:
|
|
61
|
+
case ExecutionPayloadStatus.ACCEPTED:
|
|
62
|
+
return ExecutionStatus.Syncing;
|
|
63
|
+
default:
|
|
64
|
+
throw new Error(`Unexpected execution payload status for fork choice: ${status}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
59
68
|
/**
|
|
60
69
|
* Import an execution payload envelope after all data is available.
|
|
61
70
|
*
|
|
62
71
|
* This function:
|
|
63
|
-
* 1.
|
|
64
|
-
* 2.
|
|
65
|
-
* 3.
|
|
66
|
-
* 4.
|
|
67
|
-
* 5.
|
|
68
|
-
* 6.
|
|
69
|
-
* 7.
|
|
70
|
-
* 8.
|
|
72
|
+
* 1. Emits `execution_payload_available` if payload is for current slot
|
|
73
|
+
* 2. Gets the ProtoBlock from fork choice
|
|
74
|
+
* 3. Applies write-queue backpressure (waitForSpace) early, before verification
|
|
75
|
+
* 4. Regenerates the block state
|
|
76
|
+
* 5. Runs EL verification (notifyNewPayload) in parallel with signature verification and processExecutionPayloadEnvelope
|
|
77
|
+
* 6. Persists verified payload envelope to hot DB
|
|
78
|
+
* 7. Updates fork choice
|
|
79
|
+
* 8. Caches the post-execution payload state
|
|
80
|
+
* 9. Records metrics for column sources
|
|
81
|
+
* 10. Emits `execution_payload` for recent enough payloads after successful import
|
|
71
82
|
*
|
|
72
83
|
*/
|
|
73
84
|
export async function importExecutionPayload(
|
|
@@ -75,10 +86,24 @@ export async function importExecutionPayload(
|
|
|
75
86
|
payloadInput: PayloadEnvelopeInput,
|
|
76
87
|
opts: ImportPayloadOpts = {}
|
|
77
88
|
): Promise<void> {
|
|
78
|
-
const
|
|
89
|
+
const signedEnvelope = payloadInput.getPayloadEnvelope();
|
|
90
|
+
const envelope = signedEnvelope.message;
|
|
79
91
|
const blockRootHex = payloadInput.blockRootHex;
|
|
92
|
+
const blockHashHex = payloadInput.getBlockHashHex();
|
|
93
|
+
const fork = this.config.getForkName(envelope.slot);
|
|
94
|
+
|
|
95
|
+
// 1. Emit `execution_payload_available` event at the start of import. At this point the payload input
|
|
96
|
+
// is already complete, so the payload and required data are available for payload attestation.
|
|
97
|
+
// This event is only about availability, not validity of the execution payload, hence we can emit
|
|
98
|
+
// it before getting a response from the execution client on whether the payload is valid or not.
|
|
99
|
+
if (this.clock.currentSlot - envelope.slot < EVENTSTREAM_EMIT_RECENT_EXECUTION_PAYLOAD_SLOTS) {
|
|
100
|
+
this.emitter.emit(routes.events.EventType.executionPayloadAvailable, {
|
|
101
|
+
slot: envelope.slot,
|
|
102
|
+
blockRoot: blockRootHex,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
80
105
|
|
|
81
|
-
//
|
|
106
|
+
// 2. Get ProtoBlock for parent root lookup
|
|
82
107
|
const protoBlock = this.forkChoice.getBlockHexDefaultStatus(blockRootHex);
|
|
83
108
|
if (!protoBlock) {
|
|
84
109
|
throw new PayloadError({
|
|
@@ -87,29 +112,35 @@ export async function importExecutionPayload(
|
|
|
87
112
|
});
|
|
88
113
|
}
|
|
89
114
|
|
|
90
|
-
//
|
|
115
|
+
// 3. Apply backpressure from the write queue early, before doing verification work.
|
|
91
116
|
// The actual DB write is deferred until after verification succeeds.
|
|
92
117
|
await this.unfinalizedPayloadEnvelopeWrites.waitForSpace();
|
|
93
118
|
|
|
94
|
-
//
|
|
119
|
+
// 4. Get pre-state for processExecutionPayloadEnvelope
|
|
95
120
|
// We need the block state (post-block, pre-payload) to process the envelope
|
|
96
|
-
const blockState =
|
|
121
|
+
const blockState = await this.regen.getBlockSlotState(
|
|
97
122
|
protoBlock,
|
|
98
123
|
protoBlock.slot,
|
|
99
124
|
{dontTransferCache: true},
|
|
100
125
|
RegenCaller.processBlock
|
|
101
|
-
)
|
|
126
|
+
);
|
|
127
|
+
if (!isStatePostGloas(blockState)) {
|
|
128
|
+
throw new PayloadError({
|
|
129
|
+
code: PayloadErrorCode.STATE_TRANSITION_ERROR,
|
|
130
|
+
message: `Expected gloas+ block state for payload import, got fork=${blockState.forkName}`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
102
133
|
|
|
103
|
-
//
|
|
134
|
+
// 5. Run verification steps in parallel
|
|
104
135
|
// Note: No data availability check needed here - importExecutionPayload is only
|
|
105
136
|
// called when payloadInput.isComplete() is true, so all data is already available.
|
|
106
137
|
const [execResult, signatureValid, postPayloadResult] = await Promise.all([
|
|
107
138
|
this.executionEngine.notifyNewPayload(
|
|
108
|
-
|
|
109
|
-
envelope.
|
|
139
|
+
fork,
|
|
140
|
+
envelope.payload,
|
|
110
141
|
payloadInput.getVersionedHashes(),
|
|
111
142
|
fromHex(protoBlock.parentRoot),
|
|
112
|
-
envelope.
|
|
143
|
+
envelope.executionRequests
|
|
113
144
|
),
|
|
114
145
|
|
|
115
146
|
opts.validSignature === true
|
|
@@ -117,9 +148,9 @@ export async function importExecutionPayload(
|
|
|
117
148
|
: (async () => {
|
|
118
149
|
const signatureSet = getExecutionPayloadEnvelopeSignatureSet(
|
|
119
150
|
this.config,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
151
|
+
this.pubkeyCache,
|
|
152
|
+
blockState,
|
|
153
|
+
signedEnvelope,
|
|
123
154
|
payloadInput.proposerIndex
|
|
124
155
|
);
|
|
125
156
|
return this.bls.verifySignatureSets([signatureSet]);
|
|
@@ -130,7 +161,7 @@ export async function importExecutionPayload(
|
|
|
130
161
|
(async () => {
|
|
131
162
|
try {
|
|
132
163
|
return {
|
|
133
|
-
postPayloadState: processExecutionPayloadEnvelope(
|
|
164
|
+
postPayloadState: blockState.processExecutionPayloadEnvelope(signedEnvelope, {
|
|
134
165
|
verifySignature: false,
|
|
135
166
|
verifyStateRoot: false,
|
|
136
167
|
}),
|
|
@@ -147,12 +178,12 @@ export async function importExecutionPayload(
|
|
|
147
178
|
})(),
|
|
148
179
|
]);
|
|
149
180
|
|
|
150
|
-
//
|
|
181
|
+
// 5a. Check signature verification result
|
|
151
182
|
if (!signatureValid) {
|
|
152
183
|
throw new PayloadError({code: PayloadErrorCode.INVALID_SIGNATURE});
|
|
153
184
|
}
|
|
154
185
|
|
|
155
|
-
//
|
|
186
|
+
// 5b. Handle EL response
|
|
156
187
|
switch (execResult.status) {
|
|
157
188
|
case ExecutionPayloadStatus.VALID:
|
|
158
189
|
break;
|
|
@@ -166,12 +197,7 @@ export async function importExecutionPayload(
|
|
|
166
197
|
|
|
167
198
|
case ExecutionPayloadStatus.ACCEPTED:
|
|
168
199
|
case ExecutionPayloadStatus.SYNCING:
|
|
169
|
-
|
|
170
|
-
throw new PayloadError({
|
|
171
|
-
code: PayloadErrorCode.EXECUTION_ENGINE_ERROR,
|
|
172
|
-
execStatus: execResult.status,
|
|
173
|
-
errorMessage: execResult.validationError ?? "EL syncing, payload not yet validated",
|
|
174
|
-
});
|
|
200
|
+
break;
|
|
175
201
|
|
|
176
202
|
case ExecutionPayloadStatus.INVALID_BLOCK_HASH:
|
|
177
203
|
case ExecutionPayloadStatus.ELERROR:
|
|
@@ -183,59 +209,69 @@ export async function importExecutionPayload(
|
|
|
183
209
|
});
|
|
184
210
|
}
|
|
185
211
|
|
|
186
|
-
//
|
|
212
|
+
// 5c. Verify envelope state root matches post-state
|
|
187
213
|
const postPayloadState = postPayloadResult.postPayloadState;
|
|
188
214
|
const postPayloadStateRoot = postPayloadState.hashTreeRoot();
|
|
189
|
-
if (!byteArrayEquals(envelope.
|
|
215
|
+
if (!byteArrayEquals(envelope.stateRoot, postPayloadStateRoot)) {
|
|
190
216
|
throw new PayloadError({
|
|
191
217
|
code: PayloadErrorCode.STATE_TRANSITION_ERROR,
|
|
192
|
-
message: `Envelope state root mismatch expected=${toRootHex(envelope.
|
|
218
|
+
message: `Envelope state root mismatch expected=${toRootHex(envelope.stateRoot)} actual=${toRootHex(postPayloadStateRoot)}`,
|
|
193
219
|
});
|
|
194
220
|
}
|
|
195
221
|
|
|
196
|
-
//
|
|
222
|
+
// 6. Persist payload envelope to hot DB (performed asynchronously to avoid blocking)
|
|
197
223
|
this.unfinalizedPayloadEnvelopeWrites.push(payloadInput).catch((e) => {
|
|
198
224
|
if (!isQueueErrorAborted(e)) {
|
|
199
225
|
this.logger.error(
|
|
200
226
|
"Error pushing payload envelope to unfinalized write queue",
|
|
201
|
-
{slot:
|
|
227
|
+
{slot: envelope.slot, blockRoot: blockRootHex},
|
|
202
228
|
e as Error
|
|
203
229
|
);
|
|
204
230
|
}
|
|
205
231
|
});
|
|
206
232
|
|
|
207
|
-
//
|
|
233
|
+
// 7. Update fork choice
|
|
208
234
|
this.forkChoice.onExecutionPayload(
|
|
209
235
|
blockRootHex,
|
|
210
|
-
|
|
211
|
-
envelope.
|
|
212
|
-
toRootHex(postPayloadStateRoot)
|
|
236
|
+
blockHashHex,
|
|
237
|
+
envelope.payload.blockNumber,
|
|
238
|
+
toRootHex(postPayloadStateRoot),
|
|
239
|
+
toForkChoiceExecutionStatus(execResult.status)
|
|
213
240
|
);
|
|
214
241
|
|
|
215
|
-
//
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
242
|
+
// 8. Cache payload state
|
|
243
|
+
this.regen.processPayloadState(postPayloadState);
|
|
244
|
+
if (postPayloadState.slot % SLOTS_PER_EPOCH === 0) {
|
|
245
|
+
const {checkpoint} = postPayloadState.computeAnchorCheckpoint();
|
|
246
|
+
this.regen.addCheckpointState(checkpoint, postPayloadState, true);
|
|
247
|
+
}
|
|
220
248
|
|
|
221
|
-
//
|
|
249
|
+
// 9. Record metrics for payload envelope and column sources
|
|
222
250
|
this.metrics?.importPayload.bySource.inc({source: payloadInput.getPayloadEnvelopeSource().source});
|
|
223
251
|
for (const {source} of payloadInput.getSampledColumnsWithSource()) {
|
|
224
252
|
this.metrics?.importPayload.columnsBySource.inc({source});
|
|
225
253
|
}
|
|
226
254
|
|
|
227
|
-
|
|
228
|
-
slot: payloadInput.slot,
|
|
229
|
-
root: blockRootHex,
|
|
230
|
-
blockHash: payloadInput.getBlockHashHex(),
|
|
231
|
-
});
|
|
255
|
+
const stateRootHex = toRootHex(envelope.stateRoot);
|
|
232
256
|
|
|
233
|
-
//
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
257
|
+
// 10. Emit event after payload is fully verified and imported to fork choice, only for recent enough payloads
|
|
258
|
+
if (this.clock.currentSlot - envelope.slot < EVENTSTREAM_EMIT_RECENT_EXECUTION_PAYLOAD_SLOTS) {
|
|
259
|
+
this.emitter.emit(routes.events.EventType.executionPayload, {
|
|
260
|
+
slot: envelope.slot,
|
|
261
|
+
builderIndex: envelope.builderIndex,
|
|
262
|
+
blockHash: blockHashHex,
|
|
238
263
|
blockRoot: blockRootHex,
|
|
264
|
+
stateRoot: stateRootHex,
|
|
265
|
+
// TODO GLOAS: revisit once we support optimistic import
|
|
266
|
+
executionOptimistic: false,
|
|
239
267
|
});
|
|
240
268
|
}
|
|
269
|
+
|
|
270
|
+
this.logger.verbose("Execution payload imported", {
|
|
271
|
+
slot: envelope.slot,
|
|
272
|
+
builderIndex: envelope.builderIndex,
|
|
273
|
+
blockRoot: blockRootHex,
|
|
274
|
+
blockHash: blockHashHex,
|
|
275
|
+
stateRoot: stateRootHex,
|
|
276
|
+
});
|
|
241
277
|
}
|
|
@@ -88,7 +88,8 @@ export async function processBlocks(
|
|
|
88
88
|
const fullyVerifiedBlocks = relevantBlocks.map(
|
|
89
89
|
(block, i): FullyVerifiedBlock => ({
|
|
90
90
|
blockInput: block,
|
|
91
|
-
|
|
91
|
+
postBlockState: postStates[i],
|
|
92
|
+
postPayloadState: null,
|
|
92
93
|
parentBlockSlot: parentSlots[i],
|
|
93
94
|
executionStatus: executionStatuses[i],
|
|
94
95
|
// start supporting optimistic syncing/processing
|
|
@@ -126,7 +127,7 @@ export async function processBlocks(
|
|
|
126
127
|
const {state} = err.type;
|
|
127
128
|
const forkTypes = this.config.getForkTypes(blockSlot);
|
|
128
129
|
this.persistInvalidSszValue(forkTypes.SignedBeaconBlock, signedBlock, `${blockSlot}_invalid_signature`);
|
|
129
|
-
this.
|
|
130
|
+
this.persistInvalidSszBytes("BeaconState", state.serialize(), `${state.slot}_invalid_signature`);
|
|
130
131
|
} else if (err.type.code === BlockErrorCode.INVALID_STATE_ROOT) {
|
|
131
132
|
const {signedBlock} = err;
|
|
132
133
|
const blockSlot = signedBlock.message.slot;
|