@lodestar/beacon-node 1.42.0-dev.f6213da56d → 1.42.0-dev.fb8f8a700e
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 +33 -27
- 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 +5 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.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 +110 -62
- 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 +4 -4
- package/lib/chain/errors/blockError.d.ts.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 +4 -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 +3 -4
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +21 -16
- 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 +3 -3
- 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 +5 -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 +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +17 -12
- 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 +32 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +52 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +2 -729
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/interface.d.ts +7 -4
- 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 +7 -4
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +12 -3
- 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 +269 -80
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +22 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +313 -80
- 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.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +10 -43
- 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 +36 -41
- 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 +5 -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 +148 -95
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +4 -4
- 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 +9 -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 +7 -10
- package/src/chain/produceBlock/produceBlockBody.ts +38 -45
- 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 +3 -4
- 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 +5 -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 +25 -20
- 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 +57 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +18 -4
- package/src/network/libp2p/index.ts +24 -13
- package/src/network/network.ts +39 -8
- package/src/network/options.ts +7 -2
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +334 -94
- package/src/network/processor/index.ts +395 -92
- 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 +13 -53
- 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
|
@@ -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
|
+
postEnvelopeState: 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;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {NUMBER_OF_COLUMNS} from "@lodestar/params";
|
|
2
|
-
import {ColumnIndex,
|
|
1
|
+
import {ForkName, NUMBER_OF_COLUMNS} from "@lodestar/params";
|
|
2
|
+
import {ColumnIndex, RootHex, Slot, ValidatorIndex, deneb, gloas} from "@lodestar/types";
|
|
3
3
|
import {toRootHex, withTimeout} from "@lodestar/utils";
|
|
4
4
|
import {VersionedHashes} from "../../../execution/index.js";
|
|
5
5
|
import {kzgCommitmentToVersionedHash} from "../../../util/blobs.js";
|
|
6
|
+
import {MissingColumnMeta} from "../blockInput/types.js";
|
|
6
7
|
import {AddPayloadEnvelopeProps, ColumnWithSource, CreateFromBlockProps, SourceMeta} from "./types.js";
|
|
7
8
|
|
|
8
9
|
export type PayloadEnvelopeInputState =
|
|
@@ -59,6 +60,7 @@ function createPromise<T>(): PromiseParts<T> {
|
|
|
59
60
|
export class PayloadEnvelopeInput {
|
|
60
61
|
readonly blockRootHex: RootHex;
|
|
61
62
|
readonly slot: Slot;
|
|
63
|
+
readonly forkName: ForkName;
|
|
62
64
|
readonly proposerIndex: ValidatorIndex;
|
|
63
65
|
readonly bid: gloas.ExecutionPayloadBid;
|
|
64
66
|
readonly versionedHashes: VersionedHashes;
|
|
@@ -71,13 +73,14 @@ export class PayloadEnvelopeInput {
|
|
|
71
73
|
private timeCreatedSec: number;
|
|
72
74
|
|
|
73
75
|
private readonly payloadEnvelopeDataPromise: PromiseParts<gloas.SignedExecutionPayloadEnvelope>;
|
|
74
|
-
private readonly columnsDataPromise: PromiseParts<
|
|
76
|
+
private readonly columnsDataPromise: PromiseParts<gloas.DataColumnSidecar[]>;
|
|
75
77
|
|
|
76
78
|
state: PayloadEnvelopeInputState;
|
|
77
79
|
|
|
78
80
|
private constructor(props: {
|
|
79
81
|
blockRootHex: RootHex;
|
|
80
82
|
slot: Slot;
|
|
83
|
+
forkName: ForkName;
|
|
81
84
|
proposerIndex: ValidatorIndex;
|
|
82
85
|
bid: gloas.ExecutionPayloadBid;
|
|
83
86
|
sampledColumns: ColumnIndex[];
|
|
@@ -86,6 +89,7 @@ export class PayloadEnvelopeInput {
|
|
|
86
89
|
}) {
|
|
87
90
|
this.blockRootHex = props.blockRootHex;
|
|
88
91
|
this.slot = props.slot;
|
|
92
|
+
this.forkName = props.forkName;
|
|
89
93
|
this.proposerIndex = props.proposerIndex;
|
|
90
94
|
this.bid = props.bid;
|
|
91
95
|
this.versionedHashes = props.bid.blobKzgCommitments.map(kzgCommitmentToVersionedHash);
|
|
@@ -112,6 +116,7 @@ export class PayloadEnvelopeInput {
|
|
|
112
116
|
return new PayloadEnvelopeInput({
|
|
113
117
|
blockRootHex: props.blockRootHex,
|
|
114
118
|
slot: props.block.message.slot,
|
|
119
|
+
forkName: props.forkName,
|
|
115
120
|
proposerIndex: props.block.message.proposerIndex,
|
|
116
121
|
bid,
|
|
117
122
|
sampledColumns: props.sampledColumns,
|
|
@@ -173,8 +178,12 @@ export class PayloadEnvelopeInput {
|
|
|
173
178
|
}
|
|
174
179
|
}
|
|
175
180
|
|
|
176
|
-
addColumn(columnWithSource: ColumnWithSource):
|
|
181
|
+
addColumn(columnWithSource: ColumnWithSource): boolean {
|
|
177
182
|
const {columnSidecar, seenTimestampSec} = columnWithSource;
|
|
183
|
+
if (this.columnsCache.has(columnSidecar.index)) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
|
|
178
187
|
this.columnsCache.set(columnSidecar.index, columnWithSource);
|
|
179
188
|
|
|
180
189
|
const sampledColumns = this.getSampledColumns();
|
|
@@ -191,7 +200,7 @@ export class PayloadEnvelopeInput {
|
|
|
191
200
|
sampledColumns.length === this.sampledColumns.length;
|
|
192
201
|
|
|
193
202
|
if (!hasAllData) {
|
|
194
|
-
return;
|
|
203
|
+
return true;
|
|
195
204
|
}
|
|
196
205
|
|
|
197
206
|
if (hasComputedAllData) {
|
|
@@ -217,6 +226,20 @@ export class PayloadEnvelopeInput {
|
|
|
217
226
|
hasComputedAllData: hasComputedAllData || this.state.hasComputedAllData,
|
|
218
227
|
};
|
|
219
228
|
}
|
|
229
|
+
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
hasColumn(index: ColumnIndex): boolean {
|
|
234
|
+
return this.columnsCache.has(index);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
getColumn(index: ColumnIndex): gloas.DataColumnSidecar | undefined {
|
|
238
|
+
return this.columnsCache.get(index)?.columnSidecar;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
getAllColumns(): gloas.DataColumnSidecar[] {
|
|
242
|
+
return [...this.columnsCache.values()].map(({columnSidecar}) => columnSidecar);
|
|
220
243
|
}
|
|
221
244
|
|
|
222
245
|
getVersionedHashes(): VersionedHashes {
|
|
@@ -237,8 +260,8 @@ export class PayloadEnvelopeInput {
|
|
|
237
260
|
return this.state.payloadEnvelopeSource;
|
|
238
261
|
}
|
|
239
262
|
|
|
240
|
-
getSampledColumns(): gloas.
|
|
241
|
-
const columns: gloas.
|
|
263
|
+
getSampledColumns(): gloas.DataColumnSidecar[] {
|
|
264
|
+
const columns: gloas.DataColumnSidecar[] = [];
|
|
242
265
|
for (const index of this.sampledColumns) {
|
|
243
266
|
const column = this.columnsCache.get(index);
|
|
244
267
|
if (column) {
|
|
@@ -259,8 +282,8 @@ export class PayloadEnvelopeInput {
|
|
|
259
282
|
return columns;
|
|
260
283
|
}
|
|
261
284
|
|
|
262
|
-
getCustodyColumns(): gloas.
|
|
263
|
-
const columns: gloas.
|
|
285
|
+
getCustodyColumns(): gloas.DataColumnSidecar[] {
|
|
286
|
+
const columns: gloas.DataColumnSidecar[] = [];
|
|
264
287
|
for (const index of this.custodyColumns) {
|
|
265
288
|
const column = this.columnsCache.get(index);
|
|
266
289
|
if (column) {
|
|
@@ -270,11 +293,29 @@ export class PayloadEnvelopeInput {
|
|
|
270
293
|
return columns;
|
|
271
294
|
}
|
|
272
295
|
|
|
296
|
+
hasAllData(): boolean {
|
|
297
|
+
return this.state.hasAllData;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
getMissingSampledColumnMeta(): MissingColumnMeta {
|
|
301
|
+
if (this.state.hasAllData) {
|
|
302
|
+
return {missing: [], versionedHashes: this.versionedHashes};
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const missing: ColumnIndex[] = [];
|
|
306
|
+
for (const index of this.sampledColumns) {
|
|
307
|
+
if (!this.columnsCache.has(index)) {
|
|
308
|
+
missing.push(index);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return {missing, versionedHashes: this.versionedHashes};
|
|
312
|
+
}
|
|
313
|
+
|
|
273
314
|
hasComputedAllData(): boolean {
|
|
274
315
|
return this.state.hasComputedAllData;
|
|
275
316
|
}
|
|
276
317
|
|
|
277
|
-
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<
|
|
318
|
+
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<gloas.DataColumnSidecar[]> {
|
|
278
319
|
if (this.state.hasComputedAllData) {
|
|
279
320
|
return Promise.resolve(this.getSampledColumns());
|
|
280
321
|
}
|
|
@@ -319,7 +360,7 @@ export class PayloadEnvelopeInput {
|
|
|
319
360
|
hasAllData: boolean;
|
|
320
361
|
hasComputedAllData: boolean;
|
|
321
362
|
isComplete: boolean;
|
|
322
|
-
|
|
363
|
+
receivedColumns: number;
|
|
323
364
|
sampledColumnsCount: number;
|
|
324
365
|
} {
|
|
325
366
|
return {
|
|
@@ -329,7 +370,7 @@ export class PayloadEnvelopeInput {
|
|
|
329
370
|
hasAllData: this.state.hasAllData,
|
|
330
371
|
hasComputedAllData: this.state.hasComputedAllData,
|
|
331
372
|
isComplete: this.isComplete(),
|
|
332
|
-
|
|
373
|
+
receivedColumns: this.columnsCache.size,
|
|
333
374
|
sampledColumnsCount: this.sampledColumns.length,
|
|
334
375
|
};
|
|
335
376
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ForkPostGloas} from "@lodestar/params";
|
|
1
|
+
import {ForkName, ForkPostGloas} from "@lodestar/params";
|
|
2
2
|
import {ColumnIndex, RootHex, SignedBeaconBlock, gloas} from "@lodestar/types";
|
|
3
3
|
|
|
4
4
|
export enum PayloadEnvelopeInputSource {
|
|
@@ -23,6 +23,7 @@ export type ColumnWithSource = SourceMeta & {
|
|
|
23
23
|
export type CreateFromBlockProps = {
|
|
24
24
|
blockRootHex: RootHex;
|
|
25
25
|
block: SignedBeaconBlock<ForkPostGloas>;
|
|
26
|
+
forkName: ForkName;
|
|
26
27
|
sampledColumns: ColumnIndex[];
|
|
27
28
|
custodyColumns: ColumnIndex[];
|
|
28
29
|
timeCreatedSec: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {BlockExecutionStatus, PayloadExecutionStatus} from "@lodestar/fork-choice";
|
|
3
3
|
import {ForkSeq} from "@lodestar/params";
|
|
4
|
-
import {
|
|
4
|
+
import {DataAvailabilityStatus, IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
5
5
|
import type {IndexedAttestation, Slot, fulu} from "@lodestar/types";
|
|
6
6
|
import {IBlockInput} from "./blockInput/types.js";
|
|
7
7
|
|
|
@@ -88,24 +88,35 @@ export type ImportBlockOpts = {
|
|
|
88
88
|
seenTimestampSec?: number;
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
* A wrapper around a `SignedBeaconBlock` that indicates that this block is fully verified and ready to import
|
|
93
|
-
*/
|
|
94
|
-
export type FullyVerifiedBlock = {
|
|
91
|
+
type FullyVerifiedBlockBase = {
|
|
95
92
|
blockInput: IBlockInput;
|
|
96
|
-
|
|
93
|
+
postBlockState: IBeaconStateView;
|
|
97
94
|
parentBlockSlot: Slot;
|
|
98
95
|
proposerBalanceDelta: number;
|
|
99
|
-
/**
|
|
100
|
-
* If the execution payload couldnt be verified because of EL syncing status,
|
|
101
|
-
* used in optimistic sync or for merge block
|
|
102
|
-
*/
|
|
103
|
-
executionStatus: MaybeValidExecutionStatus;
|
|
104
96
|
dataAvailabilityStatus: DataAvailabilityStatus;
|
|
105
|
-
/**
|
|
106
|
-
* Pre-computed indexed attestations from signature verification to avoid duplicate work
|
|
107
|
-
*/
|
|
97
|
+
/** Pre-computed indexed attestations from signature verification to avoid duplicate work */
|
|
108
98
|
indexedAttestations: IndexedAttestation[];
|
|
109
99
|
/** Seen timestamp seconds */
|
|
110
100
|
seenTimestampSec: number;
|
|
111
101
|
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A wrapper around a `SignedBeaconBlock` that indicates that this block is fully verified and ready to import.
|
|
105
|
+
*
|
|
106
|
+
* Discriminated union on `postEnvelopeState`:
|
|
107
|
+
* - `null` → block has no pre-verified envelope; `executionStatus` is any `BlockExecutionStatus`
|
|
108
|
+
* - non-null → envelope was pre-verified during state transition; `executionStatus` is narrowed to
|
|
109
|
+
* `Valid | Syncing` (matching what `forkChoice.onExecutionPayload` expects)
|
|
110
|
+
*/
|
|
111
|
+
export type FullyVerifiedBlock = FullyVerifiedBlockBase &
|
|
112
|
+
(
|
|
113
|
+
| {
|
|
114
|
+
postEnvelopeState: null;
|
|
115
|
+
/** If the execution payload couldn't be verified because of EL syncing status, used in optimistic sync or for merge block */
|
|
116
|
+
executionStatus: BlockExecutionStatus;
|
|
117
|
+
}
|
|
118
|
+
| {
|
|
119
|
+
postEnvelopeState: IBeaconStateView;
|
|
120
|
+
executionStatus: PayloadExecutionStatus;
|
|
121
|
+
}
|
|
122
|
+
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
3
3
|
import {phase0, ssz} from "@lodestar/types";
|
|
4
4
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Compute a Checkpoint type from `state.latestBlockHeader`
|
|
8
8
|
*/
|
|
9
|
-
export function getCheckpointFromState(checkpointState:
|
|
9
|
+
export function getCheckpointFromState(checkpointState: IBeaconStateView): phase0.Checkpoint {
|
|
10
10
|
const slot = checkpointState.slot;
|
|
11
11
|
|
|
12
12
|
if (slot % SLOTS_PER_EPOCH !== 0) {
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
2
|
import {ForkName, isForkPostFulu} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
|
-
DataAvailabilityStatus,
|
|
6
|
-
computeEpochAtSlot,
|
|
7
|
-
isStateValidatorsNodesPopulated,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
3
|
+
import {DataAvailabilityStatus, IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
9
4
|
import {IndexedAttestation, deneb} from "@lodestar/types";
|
|
10
5
|
import type {BeaconChain} from "../chain.js";
|
|
11
6
|
import {BlockError, BlockErrorCode} from "../errors/index.js";
|
|
@@ -39,7 +34,7 @@ export async function verifyBlocksInEpoch(
|
|
|
39
34
|
blockInputs: IBlockInput[],
|
|
40
35
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
41
36
|
): Promise<{
|
|
42
|
-
postStates:
|
|
37
|
+
postStates: IBeaconStateView[];
|
|
43
38
|
proposerBalanceDeltas: number[];
|
|
44
39
|
segmentExecStatus: SegmentExecStatus;
|
|
45
40
|
dataAvailabilityStatuses: DataAvailabilityStatus[];
|
|
@@ -78,10 +73,10 @@ export async function verifyBlocksInEpoch(
|
|
|
78
73
|
// otherwise it may fail to get indexed attestations from shuffling cache later
|
|
79
74
|
this.shufflingCache.processState(preState0);
|
|
80
75
|
|
|
81
|
-
if (!isStateValidatorsNodesPopulated(
|
|
76
|
+
if (!preState0.isStateValidatorsNodesPopulated()) {
|
|
82
77
|
this.logger.verbose("verifyBlocksInEpoch preState0 SSZ cache stats", {
|
|
83
78
|
slot: preState0.slot,
|
|
84
|
-
cache: isStateValidatorsNodesPopulated(
|
|
79
|
+
cache: preState0.isStateValidatorsNodesPopulated(),
|
|
85
80
|
clonedCount: preState0.clonedCount,
|
|
86
81
|
clonedCountWithTransferCache: preState0.clonedCountWithTransferCache,
|
|
87
82
|
createdWithTransferCache: preState0.createdWithTransferCache,
|
|
@@ -110,7 +105,7 @@ export async function verifyBlocksInEpoch(
|
|
|
110
105
|
for (const [i, block] of blocks.entries()) {
|
|
111
106
|
indexedAttestationsByBlock[i] = block.message.body.attestations.map((attestation) => {
|
|
112
107
|
const attEpoch = computeEpochAtSlot(attestation.data.slot);
|
|
113
|
-
const decisionRoot = preState0.
|
|
108
|
+
const decisionRoot = preState0.getShufflingDecisionRoot(attEpoch);
|
|
114
109
|
return this.shufflingCache.getIndexedAttestation(attEpoch, decisionRoot, fork, attestation);
|
|
115
110
|
});
|
|
116
111
|
}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {
|
|
3
|
+
BlockExecutionStatus,
|
|
3
4
|
ExecutionStatus,
|
|
4
5
|
IForkChoice,
|
|
5
6
|
LVHInvalidResponse,
|
|
6
7
|
LVHValidResponse,
|
|
7
|
-
MaybeValidExecutionStatus,
|
|
8
8
|
ProtoBlock,
|
|
9
9
|
} from "@lodestar/fork-choice";
|
|
10
10
|
import {ForkSeq} from "@lodestar/params";
|
|
11
|
-
import {
|
|
12
|
-
CachedBeaconStateAllForks,
|
|
13
|
-
isExecutionBlockBodyType,
|
|
14
|
-
isExecutionEnabled,
|
|
15
|
-
isExecutionStateType,
|
|
16
|
-
} from "@lodestar/state-transition";
|
|
11
|
+
import {IBeaconStateView, isExecutionBlockBodyType, isStatePostBellatrix} from "@lodestar/state-transition";
|
|
17
12
|
import {bellatrix, electra} from "@lodestar/types";
|
|
18
13
|
import {ErrorAborted, Logger, toRootHex} from "@lodestar/utils";
|
|
19
14
|
import {ExecutionPayloadStatus, IExecutionEngine} from "../../execution/engine/interface.js";
|
|
@@ -38,7 +33,7 @@ type ExecAbortType = {blockIndex: number; execError: BlockError};
|
|
|
38
33
|
export type SegmentExecStatus =
|
|
39
34
|
| {
|
|
40
35
|
execAborted: null;
|
|
41
|
-
executionStatuses:
|
|
36
|
+
executionStatuses: BlockExecutionStatus[];
|
|
42
37
|
executionTime: number;
|
|
43
38
|
}
|
|
44
39
|
| {execAborted: ExecAbortType; invalidSegmentLVH?: LVHInvalidResponse};
|
|
@@ -63,11 +58,11 @@ export async function verifyBlocksExecutionPayload(
|
|
|
63
58
|
chain: VerifyBlockExecutionPayloadModules,
|
|
64
59
|
parentBlock: ProtoBlock,
|
|
65
60
|
blockInputs: IBlockInput[],
|
|
66
|
-
preState0:
|
|
61
|
+
preState0: IBeaconStateView,
|
|
67
62
|
signal: AbortSignal,
|
|
68
63
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
69
64
|
): Promise<SegmentExecStatus> {
|
|
70
|
-
const executionStatuses:
|
|
65
|
+
const executionStatuses: BlockExecutionStatus[] = [];
|
|
71
66
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
72
67
|
const lastBlock = blockInputs.at(-1);
|
|
73
68
|
|
|
@@ -108,7 +103,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
108
103
|
return getSegmentErrorResponse({verifyResponse, blockIndex}, parentBlock, blockInputs);
|
|
109
104
|
}
|
|
110
105
|
|
|
111
|
-
// If we are here then its because executionStatus is one of
|
|
106
|
+
// If we are here then its because executionStatus is one of BlockExecutionStatus
|
|
112
107
|
const {executionStatus} = verifyResponse;
|
|
113
108
|
executionStatuses.push(executionStatus);
|
|
114
109
|
}
|
|
@@ -146,7 +141,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
146
141
|
export async function verifyBlockExecutionPayload(
|
|
147
142
|
chain: VerifyBlockExecutionPayloadModules,
|
|
148
143
|
blockInput: IBlockInput,
|
|
149
|
-
preState0:
|
|
144
|
+
preState0: IBeaconStateView
|
|
150
145
|
): Promise<VerifyBlockExecutionResponse> {
|
|
151
146
|
const block = blockInput.getBlock();
|
|
152
147
|
|
|
@@ -157,9 +152,10 @@ export async function verifyBlockExecutionPayload(
|
|
|
157
152
|
|
|
158
153
|
/** Not null if execution is enabled */
|
|
159
154
|
const executionPayloadEnabled =
|
|
160
|
-
|
|
155
|
+
isStatePostBellatrix(preState0) &&
|
|
156
|
+
preState0.isExecutionStateType &&
|
|
161
157
|
isExecutionBlockBodyType(block.message.body) &&
|
|
162
|
-
isExecutionEnabled(
|
|
158
|
+
preState0.isExecutionEnabled(block.message)
|
|
163
159
|
? block.message.body.executionPayload
|
|
164
160
|
: null;
|
|
165
161
|
|