@lodestar/beacon-node 1.42.0-dev.5f2fffc2ce → 1.42.0-dev.6fa48cb5f2
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 +36 -17
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +1 -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 +27 -32
- 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/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +4 -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 +27 -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/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/types.d.ts +4 -3
- 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 +27 -11
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +48 -0
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -0
- package/lib/chain/blocks/importExecutionPayload.js +158 -0
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -0
- package/lib/chain/blocks/index.js +1 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.js +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +80 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +248 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +29 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.js +11 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +15 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +46 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -0
- package/lib/chain/blocks/types.d.ts +9 -2
- 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 +3 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +3 -3
- 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 +1 -1
- 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/blocks/writePayloadEnvelopeInputToDb.d.ts +12 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +40 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -0
- package/lib/chain/chain.d.ts +19 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +75 -42
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +2 -2
- package/lib/chain/emitter.d.ts.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/executionPayloadEnvelope.d.ts +12 -2
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +3 -1
- package/lib/chain/errors/executionPayloadEnvelope.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 +27 -33
- 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 +17 -15
- 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 +10 -13
- package/lib/chain/opPools/aggregatedAttestationPool.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 +2 -2
- 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 +3 -3
- 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 +8 -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 +13 -17
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +15 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +2 -0
- package/lib/chain/regen/interface.js.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/index.d.ts +1 -1
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +1 -1
- package/lib/chain/seenCache/index.js.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 +38 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +76 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -0
- 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.js +1 -1
- 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 +4 -4
- 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 +29 -19
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +1 -2
- 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 +13 -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 +1 -1
- 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 +5 -4
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +13 -8
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +2 -2
- package/lib/metrics/metrics/lodestar.d.ts +40 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +93 -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 +727 -0
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/interface.d.ts +4 -2
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +5 -0
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +4 -2
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +11 -5
- package/lib/network/network.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 +15 -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 +39 -9
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +12 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +99 -78
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +10 -1
- 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 +8 -2
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +7 -1
- 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 +1 -4
- 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 +3 -3
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +3 -3
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/constants.d.ts +1 -1
- package/lib/sync/constants.js +1 -1
- package/lib/sync/unknownBlock.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +8 -41
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/util/sszBytes.d.ts +4 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +69 -12
- 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 +37 -18
- package/src/api/impl/beacon/pool/index.ts +1 -1
- package/src/api/impl/beacon/state/index.ts +29 -41
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/lodestar/index.ts +4 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +29 -41
- package/src/api/impl/validator/utils.ts +4 -7
- 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/types.ts +4 -3
- package/src/chain/blocks/importBlock.ts +47 -16
- package/src/chain/blocks/importExecutionPayload.ts +236 -0
- package/src/chain/blocks/index.ts +1 -1
- package/src/chain/blocks/payloadEnvelopeInput/index.ts +2 -0
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +336 -0
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +33 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +61 -0
- package/src/chain/blocks/types.ts +10 -2
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +5 -10
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +55 -0
- package/src/chain/chain.ts +112 -70
- package/src/chain/emitter.ts +2 -2
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
- package/src/chain/forkChoice/index.ts +33 -52
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +18 -16
- package/src/chain/lightClient/index.ts +9 -22
- package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +4 -4
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +6 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +11 -10
- package/src/chain/produceBlock/produceBlockBody.ts +23 -50
- package/src/chain/regen/interface.ts +15 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/seenCache/index.ts +1 -1
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +106 -0
- 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 +2 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +3 -7
- package/src/chain/validation/executionPayloadEnvelope.ts +36 -29
- package/src/chain/validation/lightClientFinalityUpdate.ts +1 -1
- package/src/chain/validation/lightClientOptimisticUpdate.ts +1 -1
- package/src/chain/validation/payloadAttestationMessage.ts +2 -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 +21 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +23 -12
- package/src/execution/engine/interface.ts +2 -2
- package/src/metrics/metrics/lodestar.ts +100 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +15 -2
- package/src/network/libp2p/index.ts +5 -0
- package/src/network/network.ts +34 -6
- package/src/network/processor/extractSlotRootFns.ts +19 -6
- package/src/network/processor/gossipHandlers.ts +45 -8
- package/src/network/processor/index.ts +110 -89
- package/src/network/reqresp/ReqRespBeaconNode.ts +14 -1
- 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 +13 -0
- package/src/node/nodejs.ts +3 -5
- package/src/node/notifier.ts +4 -10
- package/src/sync/backfill/backfill.ts +4 -4
- package/src/sync/constants.ts +1 -1
- package/src/sync/unknownBlock.ts +10 -50
- package/src/util/sszBytes.ts +90 -10
- package/src/util/types.ts +6 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts +0 -15
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +0 -1
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js +0 -28
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +0 -1
- package/src/chain/seenCache/seenExecutionPayloadEnvelope.ts +0 -34
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {BeaconChain} from "../chain.js";
|
|
2
|
+
import {PayloadEnvelopeInput} from "../seenCache/seenPayloadEnvelopeInput.js";
|
|
3
|
+
import {writeDataColumnsToDb} from "./writeBlockInputToDb.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Persists payload envelope data to DB. This operation must be eventually completed if a payload is imported.
|
|
7
|
+
*
|
|
8
|
+
* TODO GLOAS: Persist envelope metadata (stateRoot, executionRequests, builderIndex, etc.) without the full
|
|
9
|
+
* execution payload body — only keep the blockHash reference. The EL already stores the payload.
|
|
10
|
+
* See https://github.com/ChainSafe/lodestar/issues/5671
|
|
11
|
+
*/
|
|
12
|
+
export async function writePayloadEnvelopeInputToDb(
|
|
13
|
+
this: BeaconChain,
|
|
14
|
+
payloadInput: PayloadEnvelopeInput
|
|
15
|
+
): Promise<void> {
|
|
16
|
+
const envelope = payloadInput.getPayloadEnvelope();
|
|
17
|
+
const blockRootHex = payloadInput.blockRootHex;
|
|
18
|
+
|
|
19
|
+
const envelopeBytes = this.serializedCache.get(envelope);
|
|
20
|
+
const envelopePromise = envelopeBytes
|
|
21
|
+
? this.db.executionPayloadEnvelope.putBinary(this.db.executionPayloadEnvelope.getId(envelope), envelopeBytes)
|
|
22
|
+
: this.db.executionPayloadEnvelope.add(envelope);
|
|
23
|
+
|
|
24
|
+
// Write envelope and data columns in parallel (reuses shared column writing logic)
|
|
25
|
+
await Promise.all([envelopePromise, writeDataColumnsToDb.call(this, payloadInput)]);
|
|
26
|
+
this.logger.debug("Persisted payload envelope to db", {
|
|
27
|
+
slot: payloadInput.slot,
|
|
28
|
+
root: blockRootHex,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function persistPayloadEnvelopeInput(
|
|
33
|
+
this: BeaconChain,
|
|
34
|
+
payloadInput: PayloadEnvelopeInput
|
|
35
|
+
): Promise<void> {
|
|
36
|
+
await writePayloadEnvelopeInputToDb
|
|
37
|
+
.call(this, payloadInput)
|
|
38
|
+
.catch((e) => {
|
|
39
|
+
this.logger.error(
|
|
40
|
+
"Error persisting payload envelope in hot db",
|
|
41
|
+
{
|
|
42
|
+
slot: payloadInput.slot,
|
|
43
|
+
root: payloadInput.blockRootHex,
|
|
44
|
+
},
|
|
45
|
+
e
|
|
46
|
+
);
|
|
47
|
+
})
|
|
48
|
+
.finally(() => {
|
|
49
|
+
this.seenPayloadEnvelopeInputCache.prune(payloadInput.blockRootHex);
|
|
50
|
+
this.logger.debug("Pruned payload envelope input", {
|
|
51
|
+
slot: payloadInput.slot,
|
|
52
|
+
root: payloadInput.blockRootHex,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
package/src/chain/chain.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import {PrivateKey} from "@libp2p/interface";
|
|
3
|
-
import {
|
|
3
|
+
import {Type} from "@chainsafe/ssz";
|
|
4
4
|
import {BeaconConfig} from "@lodestar/config";
|
|
5
5
|
import {
|
|
6
6
|
CheckpointWithPayloadStatus,
|
|
@@ -14,30 +14,21 @@ import {LoggerNode} from "@lodestar/logger/node";
|
|
|
14
14
|
import {
|
|
15
15
|
BUILDER_INDEX_SELF_BUILD,
|
|
16
16
|
EFFECTIVE_BALANCE_INCREMENT,
|
|
17
|
-
ForkPostFulu,
|
|
17
|
+
type ForkPostFulu,
|
|
18
18
|
GENESIS_SLOT,
|
|
19
19
|
SLOTS_PER_EPOCH,
|
|
20
20
|
isForkPostElectra,
|
|
21
21
|
isForkPostGloas,
|
|
22
22
|
} from "@lodestar/params";
|
|
23
23
|
import {
|
|
24
|
-
BeaconStateAllForks,
|
|
25
|
-
BeaconStateElectra,
|
|
26
|
-
CachedBeaconStateAllForks,
|
|
27
|
-
CachedBeaconStateGloas,
|
|
28
24
|
EffectiveBalanceIncrements,
|
|
29
25
|
EpochShuffling,
|
|
26
|
+
IBeaconStateView,
|
|
30
27
|
PubkeyCache,
|
|
31
|
-
computeAnchorCheckpoint,
|
|
32
|
-
computeAttestationsRewards,
|
|
33
|
-
computeBlockRewards,
|
|
34
28
|
computeEndSlotAtEpoch,
|
|
35
29
|
computeEpochAtSlot,
|
|
36
30
|
computeStartSlotAtEpoch,
|
|
37
|
-
computeSyncCommitteeRewards,
|
|
38
|
-
getEffectiveBalanceIncrementsZeroInactive,
|
|
39
31
|
getEffectiveBalancesFromStateBytes,
|
|
40
|
-
processSlots,
|
|
41
32
|
} from "@lodestar/state-transition";
|
|
42
33
|
import {
|
|
43
34
|
BeaconBlock,
|
|
@@ -84,7 +75,10 @@ import {CheckpointBalancesCache} from "./balancesCache.js";
|
|
|
84
75
|
import {BeaconProposerCache} from "./beaconProposerCache.js";
|
|
85
76
|
import {IBlockInput, isBlockInputBlobs, isBlockInputColumns} from "./blocks/blockInput/index.js";
|
|
86
77
|
import {BlockProcessor, ImportBlockOpts} from "./blocks/index.js";
|
|
78
|
+
import {PayloadEnvelopeProcessor} from "./blocks/payloadEnvelopeProcessor.js";
|
|
79
|
+
import {ImportPayloadOpts} from "./blocks/types.js";
|
|
87
80
|
import {persistBlockInput} from "./blocks/writeBlockInputToDb.js";
|
|
81
|
+
import {persistPayloadEnvelopeInput} from "./blocks/writePayloadEnvelopeInputToDb.js";
|
|
88
82
|
import {BlsMultiThreadWorkerPool, BlsSingleThreadVerifier, IBlsVerifier} from "./bls/index.js";
|
|
89
83
|
import {ColumnReconstructionTracker} from "./ColumnReconstructionTracker.js";
|
|
90
84
|
import {ChainEvent, ChainEventEmitter} from "./emitter.js";
|
|
@@ -109,13 +103,14 @@ import {BlockAttributes, produceBlockBody, produceCommonBlockBody} from "./produ
|
|
|
109
103
|
import {QueuedStateRegenerator, RegenCaller} from "./regen/index.js";
|
|
110
104
|
import {ReprocessController} from "./reprocess.js";
|
|
111
105
|
import {
|
|
106
|
+
PayloadEnvelopeInput,
|
|
112
107
|
SeenAggregators,
|
|
113
108
|
SeenAttesters,
|
|
114
109
|
SeenBlockProposers,
|
|
115
110
|
SeenContributionAndProof,
|
|
116
111
|
SeenExecutionPayloadBids,
|
|
117
|
-
SeenExecutionPayloadEnvelopes,
|
|
118
112
|
SeenPayloadAttesters,
|
|
113
|
+
SeenPayloadEnvelopeInput,
|
|
119
114
|
SeenSyncCommitteeMessages,
|
|
120
115
|
} from "./seenCache/index.js";
|
|
121
116
|
import {SeenAggregatedAttestations} from "./seenCache/seenAggregateAndProof.js";
|
|
@@ -148,6 +143,13 @@ const DEFAULT_MAX_CACHED_PRODUCED_RESULTS = 4;
|
|
|
148
143
|
*/
|
|
149
144
|
const DEFAULT_MAX_PENDING_UNFINALIZED_BLOCK_WRITES = 16;
|
|
150
145
|
|
|
146
|
+
/**
|
|
147
|
+
* The maximum number of pending unfinalized payload envelope writes to the database before backpressure is applied.
|
|
148
|
+
* Payload envelope write queue entries hold references to payload inputs (including columns),
|
|
149
|
+
* keeping them in memory. Keep moderate to avoid OOM during sync.
|
|
150
|
+
*/
|
|
151
|
+
const DEFAULT_MAX_PENDING_UNFINALIZED_PAYLOAD_ENVELOPE_WRITES = 16;
|
|
152
|
+
|
|
151
153
|
export class BeaconChain implements IBeaconChain {
|
|
152
154
|
readonly genesisTime: UintNum64;
|
|
153
155
|
readonly genesisValidatorsRoot: Root;
|
|
@@ -172,6 +174,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
172
174
|
readonly reprocessController: ReprocessController;
|
|
173
175
|
readonly archiveStore: ArchiveStore;
|
|
174
176
|
readonly unfinalizedBlockWrites: JobItemQueue<[IBlockInput], void>;
|
|
177
|
+
readonly unfinalizedPayloadEnvelopeWrites: JobItemQueue<[PayloadEnvelopeInput], void>;
|
|
175
178
|
|
|
176
179
|
// Ops pool
|
|
177
180
|
readonly attestationPool: AttestationPool;
|
|
@@ -187,13 +190,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
187
190
|
readonly seenAggregators = new SeenAggregators();
|
|
188
191
|
readonly seenPayloadAttesters = new SeenPayloadAttesters();
|
|
189
192
|
readonly seenAggregatedAttestations: SeenAggregatedAttestations;
|
|
190
|
-
readonly seenExecutionPayloadEnvelopes = new SeenExecutionPayloadEnvelopes();
|
|
191
193
|
readonly seenExecutionPayloadBids = new SeenExecutionPayloadBids();
|
|
192
194
|
readonly seenBlockProposers = new SeenBlockProposers();
|
|
193
195
|
readonly seenSyncCommitteeMessages = new SeenSyncCommitteeMessages();
|
|
194
196
|
readonly seenContributionAndProof: SeenContributionAndProof;
|
|
195
197
|
readonly seenAttestationDatas: SeenAttestationDatas;
|
|
196
198
|
readonly seenBlockInputCache: SeenBlockInput;
|
|
199
|
+
readonly seenPayloadEnvelopeInputCache: SeenPayloadEnvelopeInput;
|
|
197
200
|
// Seen cache for liveness checks
|
|
198
201
|
readonly seenBlockAttesters = new SeenBlockAttesters();
|
|
199
202
|
|
|
@@ -221,6 +224,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
221
224
|
readonly opts: IChainOptions;
|
|
222
225
|
|
|
223
226
|
protected readonly blockProcessor: BlockProcessor;
|
|
227
|
+
protected readonly payloadEnvelopeProcessor: PayloadEnvelopeProcessor;
|
|
224
228
|
protected readonly db: IBeaconDb;
|
|
225
229
|
// this is only available if nHistoricalStates is enabled
|
|
226
230
|
private readonly cpStateDatastore?: CPStateDatastore;
|
|
@@ -270,7 +274,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
270
274
|
clock?: IClock;
|
|
271
275
|
metrics: Metrics | null;
|
|
272
276
|
validatorMonitor: ValidatorMonitor | null;
|
|
273
|
-
anchorState:
|
|
277
|
+
anchorState: IBeaconStateView;
|
|
274
278
|
isAnchorStateFinalized: boolean;
|
|
275
279
|
executionEngine: IExecutionEngine;
|
|
276
280
|
executionBuilder?: IExecutionBuilder;
|
|
@@ -334,21 +338,28 @@ export class BeaconChain implements IBeaconChain {
|
|
|
334
338
|
metrics,
|
|
335
339
|
logger,
|
|
336
340
|
});
|
|
341
|
+
this.seenPayloadEnvelopeInputCache = new SeenPayloadEnvelopeInput({
|
|
342
|
+
chainEvents: emitter,
|
|
343
|
+
signal,
|
|
344
|
+
serializedCache: this.serializedCache,
|
|
345
|
+
metrics,
|
|
346
|
+
logger,
|
|
347
|
+
});
|
|
337
348
|
|
|
338
349
|
this._earliestAvailableSlot = anchorState.slot;
|
|
339
350
|
|
|
340
351
|
this.shufflingCache = new ShufflingCache(metrics, logger, this.opts, [
|
|
341
352
|
{
|
|
342
|
-
shuffling: anchorState.
|
|
343
|
-
decisionRoot: anchorState.
|
|
353
|
+
shuffling: anchorState.getPreviousShuffling(),
|
|
354
|
+
decisionRoot: anchorState.previousDecisionRoot,
|
|
344
355
|
},
|
|
345
356
|
{
|
|
346
|
-
shuffling: anchorState.
|
|
347
|
-
decisionRoot: anchorState.
|
|
357
|
+
shuffling: anchorState.getCurrentShuffling(),
|
|
358
|
+
decisionRoot: anchorState.currentDecisionRoot,
|
|
348
359
|
},
|
|
349
360
|
{
|
|
350
|
-
shuffling: anchorState.
|
|
351
|
-
decisionRoot: anchorState.
|
|
361
|
+
shuffling: anchorState.getNextShuffling(),
|
|
362
|
+
decisionRoot: anchorState.nextDecisionRoot,
|
|
352
363
|
},
|
|
353
364
|
]);
|
|
354
365
|
|
|
@@ -357,7 +368,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
357
368
|
|
|
358
369
|
const fileDataStore = opts.nHistoricalStatesFileDataStore ?? true;
|
|
359
370
|
const blockStateCache = new FIFOBlockStateCache(this.opts, {metrics});
|
|
360
|
-
this.bufferPool = new BufferPool(anchorState.
|
|
371
|
+
this.bufferPool = new BufferPool(anchorState.serializedSize(), metrics);
|
|
361
372
|
|
|
362
373
|
this.cpStateDatastore = fileDataStore ? new FileCPStateDatastore(dataDir) : new DbCPStateDatastore(this.db);
|
|
363
374
|
const checkpointStateCache: CheckpointStateCache = new PersistentCheckpointStateCache(
|
|
@@ -373,10 +384,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
373
384
|
this.opts
|
|
374
385
|
);
|
|
375
386
|
|
|
376
|
-
const {checkpoint} = computeAnchorCheckpoint(
|
|
387
|
+
const {checkpoint} = anchorState.computeAnchorCheckpoint();
|
|
377
388
|
blockStateCache.add(anchorState);
|
|
378
389
|
blockStateCache.setHeadState(anchorState);
|
|
379
|
-
const payloadPresent = getCheckpointPayloadStatus(anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
390
|
+
const payloadPresent = getCheckpointPayloadStatus(config, anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
380
391
|
checkpointStateCache.add(checkpoint, anchorState, payloadPresent);
|
|
381
392
|
|
|
382
393
|
const forkChoice = initializeForkChoice(
|
|
@@ -411,6 +422,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
411
422
|
this.reprocessController = new ReprocessController(this.metrics);
|
|
412
423
|
|
|
413
424
|
this.blockProcessor = new BlockProcessor(this, metrics, opts, signal);
|
|
425
|
+
this.payloadEnvelopeProcessor = new PayloadEnvelopeProcessor(this, metrics, signal);
|
|
414
426
|
|
|
415
427
|
this.forkChoice = forkChoice;
|
|
416
428
|
this.clock = clock;
|
|
@@ -447,6 +459,15 @@ export class BeaconChain implements IBeaconChain {
|
|
|
447
459
|
metrics?.unfinalizedBlockWritesQueue
|
|
448
460
|
);
|
|
449
461
|
|
|
462
|
+
this.unfinalizedPayloadEnvelopeWrites = new JobItemQueue(
|
|
463
|
+
persistPayloadEnvelopeInput.bind(this),
|
|
464
|
+
{
|
|
465
|
+
maxLength: DEFAULT_MAX_PENDING_UNFINALIZED_PAYLOAD_ENVELOPE_WRITES,
|
|
466
|
+
signal,
|
|
467
|
+
},
|
|
468
|
+
metrics?.unfinalizedPayloadEnvelopeWritesQueue
|
|
469
|
+
);
|
|
470
|
+
|
|
450
471
|
// always run PrepareNextSlotScheduler except for fork_choice spec tests
|
|
451
472
|
if (!opts?.disablePrepareNextSlot) {
|
|
452
473
|
new PrepareNextSlotScheduler(this, this.config, metrics, this.logger, signal);
|
|
@@ -477,6 +498,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
477
498
|
// we can abort any ongoing unfinalized block writes.
|
|
478
499
|
// TODO: persist fork choice to disk and allow unfinalized block writes to complete.
|
|
479
500
|
this.unfinalizedBlockWrites.dropAllJobs();
|
|
501
|
+
this.unfinalizedPayloadEnvelopeWrites.dropAllJobs();
|
|
480
502
|
|
|
481
503
|
this.abortController.abort();
|
|
482
504
|
}
|
|
@@ -526,7 +548,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
526
548
|
await this.opPool.toPersisted(this.db);
|
|
527
549
|
}
|
|
528
550
|
|
|
529
|
-
getHeadState():
|
|
551
|
+
getHeadState(): IBeaconStateView {
|
|
530
552
|
// head state should always exist
|
|
531
553
|
const head = this.forkChoice.getHead();
|
|
532
554
|
const headState = this.regen.getClosestHeadState(head);
|
|
@@ -536,11 +558,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
536
558
|
return headState;
|
|
537
559
|
}
|
|
538
560
|
|
|
539
|
-
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<
|
|
561
|
+
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
540
562
|
return this.getHeadStateAtEpoch(this.clock.currentEpoch, regenCaller);
|
|
541
563
|
}
|
|
542
564
|
|
|
543
|
-
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<
|
|
565
|
+
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
544
566
|
// using getHeadState() means we'll use checkpointStateCache if it's available
|
|
545
567
|
const headState = this.getHeadState();
|
|
546
568
|
// head state is in the same epoch, or we pulled up head state already from past epoch
|
|
@@ -557,7 +579,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
557
579
|
async getStateBySlot(
|
|
558
580
|
slot: Slot,
|
|
559
581
|
opts?: StateGetOpts
|
|
560
|
-
): Promise<{state:
|
|
582
|
+
): Promise<{state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
561
583
|
const finalizedBlock = this.forkChoice.getFinalizedBlock();
|
|
562
584
|
|
|
563
585
|
if (slot < finalizedBlock.slot) {
|
|
@@ -607,15 +629,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
607
629
|
async getStateByStateRoot(
|
|
608
630
|
stateRoot: RootHex,
|
|
609
631
|
opts?: StateGetOpts
|
|
610
|
-
): Promise<{state:
|
|
632
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
611
633
|
if (opts?.allowRegen) {
|
|
612
634
|
const state = await this.regen.getState(stateRoot, RegenCaller.restApi);
|
|
613
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
635
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
636
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(state.latestBlockHeader)
|
|
637
|
+
);
|
|
614
638
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
615
639
|
return {
|
|
616
640
|
state,
|
|
617
641
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
618
|
-
finalized: state.
|
|
642
|
+
finalized: state.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
619
643
|
};
|
|
620
644
|
}
|
|
621
645
|
|
|
@@ -626,12 +650,14 @@ export class BeaconChain implements IBeaconChain {
|
|
|
626
650
|
// TODO: This is very inneficient for debug requests of serialized content, since it deserializes to serialize again
|
|
627
651
|
const cachedStateCtx = this.regen.getStateSync(stateRoot);
|
|
628
652
|
if (cachedStateCtx) {
|
|
629
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
653
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
654
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
655
|
+
);
|
|
630
656
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
631
657
|
return {
|
|
632
658
|
state: cachedStateCtx,
|
|
633
659
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
634
|
-
finalized: cachedStateCtx.
|
|
660
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
635
661
|
};
|
|
636
662
|
}
|
|
637
663
|
|
|
@@ -658,17 +684,19 @@ export class BeaconChain implements IBeaconChain {
|
|
|
658
684
|
|
|
659
685
|
getStateByCheckpoint(
|
|
660
686
|
checkpoint: CheckpointWithPayloadStatus
|
|
661
|
-
): {state:
|
|
687
|
+
): {state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null {
|
|
662
688
|
// finalized or justified checkpoint states maynot be available with PersistentCheckpointStateCache, use getCheckpointStateOrBytes() api to get Uint8Array
|
|
663
689
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
664
690
|
const cachedStateCtx = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
665
691
|
if (cachedStateCtx) {
|
|
666
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
692
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
693
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
694
|
+
);
|
|
667
695
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
668
696
|
return {
|
|
669
697
|
state: cachedStateCtx,
|
|
670
698
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
671
|
-
finalized: cachedStateCtx.
|
|
699
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
672
700
|
};
|
|
673
701
|
}
|
|
674
702
|
|
|
@@ -677,7 +705,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
677
705
|
|
|
678
706
|
async getStateOrBytesByCheckpoint(
|
|
679
707
|
checkpoint: CheckpointWithPayloadStatus
|
|
680
|
-
): Promise<{state:
|
|
708
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
681
709
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
682
710
|
const cachedStateCtx = await this.regen.getCheckpointStateOrBytes(checkpointHexPayload);
|
|
683
711
|
if (cachedStateCtx) {
|
|
@@ -827,6 +855,24 @@ export class BeaconChain implements IBeaconChain {
|
|
|
827
855
|
return null;
|
|
828
856
|
}
|
|
829
857
|
|
|
858
|
+
async getSerializedExecutionPayloadEnvelope(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null> {
|
|
859
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
860
|
+
if (payloadInput?.hasPayloadEnvelope()) {
|
|
861
|
+
const envelope = payloadInput.getPayloadEnvelope();
|
|
862
|
+
const serialized = this.serializedCache.get(envelope);
|
|
863
|
+
if (serialized) {
|
|
864
|
+
return serialized;
|
|
865
|
+
}
|
|
866
|
+
return ssz.gloas.SignedExecutionPayloadEnvelope.serialize(envelope);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
return (
|
|
870
|
+
(await this.db.executionPayloadEnvelope.getBinary(fromHex(blockRootHex))) ??
|
|
871
|
+
(await this.db.executionPayloadEnvelopeArchive.getBinary(blockSlot)) ??
|
|
872
|
+
null
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
|
|
830
876
|
async getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecars> {
|
|
831
877
|
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
832
878
|
if (blockInput) {
|
|
@@ -921,14 +967,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
921
967
|
consensusBlockValue: Wei;
|
|
922
968
|
shouldOverrideBuilder?: boolean;
|
|
923
969
|
}> {
|
|
924
|
-
const fork = this.config.getForkName(slot);
|
|
925
970
|
const state = await this.regen.getBlockSlotState(
|
|
926
971
|
parentBlock,
|
|
927
972
|
slot,
|
|
928
973
|
{dontTransferCache: true},
|
|
929
974
|
RegenCaller.produceBlock
|
|
930
975
|
);
|
|
931
|
-
const proposerIndex = state.
|
|
976
|
+
const proposerIndex = state.getBeaconProposer(slot);
|
|
932
977
|
const proposerPubKey = this.pubkeyCache.getOrThrow(proposerIndex).toBytes();
|
|
933
978
|
|
|
934
979
|
const {body, produceResult, executionPayloadValue, shouldOverrideBuilder} = await produceBlockBody.call(
|
|
@@ -950,7 +995,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
950
995
|
// The hashtree root computed here for debug log will get cached and hence won't introduce additional delays
|
|
951
996
|
const bodyRoot =
|
|
952
997
|
produceResult.type === BlockType.Full
|
|
953
|
-
?
|
|
998
|
+
? this.config.getForkTypes(slot).BeaconBlockBody.hashTreeRoot(body)
|
|
954
999
|
: this.config
|
|
955
1000
|
.getPostBellatrixForkTypes(slot)
|
|
956
1001
|
.BlindedBeaconBlockBody.hashTreeRoot(body as BlindedBeaconBlockBody);
|
|
@@ -972,10 +1017,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
972
1017
|
block.stateRoot = newStateRoot;
|
|
973
1018
|
const blockRoot =
|
|
974
1019
|
produceResult.type === BlockType.Full
|
|
975
|
-
?
|
|
1020
|
+
? this.config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block)
|
|
976
1021
|
: this.config.getPostBellatrixForkTypes(slot).BlindedBeaconBlock.hashTreeRoot(block as BlindedBeaconBlock);
|
|
977
1022
|
const blockRootHex = toRootHex(blockRoot);
|
|
978
1023
|
|
|
1024
|
+
const fork = this.config.getForkName(slot);
|
|
979
1025
|
if (isForkPostGloas(fork)) {
|
|
980
1026
|
// TODO GLOAS: we should retire BlockType post-gloas, may need a new enum for self vs non-self built
|
|
981
1027
|
if (produceResult.type !== BlockType.Full) {
|
|
@@ -991,7 +1037,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
991
1037
|
slot,
|
|
992
1038
|
stateRoot: ZERO_HASH,
|
|
993
1039
|
};
|
|
994
|
-
const envelopeStateRoot = computeEnvelopeStateRoot(this.metrics, postState
|
|
1040
|
+
const envelopeStateRoot = computeEnvelopeStateRoot(this.metrics, postState, envelope);
|
|
995
1041
|
gloasResult.envelopeStateRoot = envelopeStateRoot;
|
|
996
1042
|
}
|
|
997
1043
|
|
|
@@ -1010,6 +1056,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1010
1056
|
return this.blockProcessor.processBlocksJob(blocks, opts);
|
|
1011
1057
|
}
|
|
1012
1058
|
|
|
1059
|
+
async processExecutionPayload(payloadInput: PayloadEnvelopeInput, opts?: ImportPayloadOpts): Promise<void> {
|
|
1060
|
+
return this.payloadEnvelopeProcessor.processPayloadEnvelopeJob(payloadInput, opts);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1013
1063
|
getStatus(): Status {
|
|
1014
1064
|
const head = this.forkChoice.getHead();
|
|
1015
1065
|
const finalizedCheckpoint = this.forkChoice.getFinalizedCheckpoint();
|
|
@@ -1108,8 +1158,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1108
1158
|
* persist preState, postState and block for further investigation.
|
|
1109
1159
|
*/
|
|
1110
1160
|
async persistInvalidStateRoot(
|
|
1111
|
-
preState:
|
|
1112
|
-
postState:
|
|
1161
|
+
preState: IBeaconStateView,
|
|
1162
|
+
postState: IBeaconStateView,
|
|
1113
1163
|
block: SignedBeaconBlock
|
|
1114
1164
|
): Promise<void> {
|
|
1115
1165
|
const blockSlot = block.message.slot;
|
|
@@ -1124,13 +1174,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1124
1174
|
`${logStr}_block`
|
|
1125
1175
|
),
|
|
1126
1176
|
this.persistSszObject(
|
|
1127
|
-
`preState_slot_${preState.slot}
|
|
1177
|
+
`preState_slot_${preState.slot}_BeaconState`,
|
|
1128
1178
|
preState.serialize(),
|
|
1129
1179
|
preState.hashTreeRoot(),
|
|
1130
1180
|
`${logStr}_pre_state`
|
|
1131
1181
|
),
|
|
1132
1182
|
this.persistSszObject(
|
|
1133
|
-
`postState_slot_${postState.slot}
|
|
1183
|
+
`postState_slot_${postState.slot}_BeaconState`,
|
|
1134
1184
|
postState.serialize(),
|
|
1135
1185
|
postState.hashTreeRoot(),
|
|
1136
1186
|
`${logStr}_post_state`
|
|
@@ -1150,12 +1200,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1150
1200
|
}
|
|
1151
1201
|
}
|
|
1152
1202
|
|
|
1153
|
-
persistInvalidSszView(view: TreeView<CompositeTypeAny>, suffix?: string): void {
|
|
1154
|
-
if (this.opts.persistInvalidSszObjects) {
|
|
1155
|
-
void this.persistSszObject(view.type.typeName, view.serialize(), view.hashTreeRoot(), suffix);
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
1203
|
/**
|
|
1160
1204
|
* Regenerate state for attestation verification, this does not happen with default chain option of maxSkipSlots = 32 .
|
|
1161
1205
|
* However, need to handle just in case. Lodestar doesn't support multiple regen state requests for attestation verification
|
|
@@ -1173,7 +1217,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1173
1217
|
this.shufflingCache.insertPromise(attEpoch, shufflingDependentRoot);
|
|
1174
1218
|
const blockEpoch = computeEpochAtSlot(attHeadBlock.slot);
|
|
1175
1219
|
|
|
1176
|
-
let state:
|
|
1220
|
+
let state: IBeaconStateView;
|
|
1177
1221
|
if (blockEpoch < attEpoch - 1) {
|
|
1178
1222
|
// thanks to one epoch look ahead, we don't need to dial up to attEpoch
|
|
1179
1223
|
const targetSlot = computeStartSlotAtEpoch(attEpoch - 1);
|
|
@@ -1191,7 +1235,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1191
1235
|
}
|
|
1192
1236
|
// resolve the promise to unblock other calls of the same epoch and dependent root
|
|
1193
1237
|
this.shufflingCache.processState(state);
|
|
1194
|
-
return state.
|
|
1238
|
+
return state.getShufflingAtEpoch(attEpoch);
|
|
1195
1239
|
}
|
|
1196
1240
|
|
|
1197
1241
|
/**
|
|
@@ -1201,7 +1245,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1201
1245
|
*/
|
|
1202
1246
|
private justifiedBalancesGetter(
|
|
1203
1247
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1204
|
-
blockState:
|
|
1248
|
+
blockState: IBeaconStateView
|
|
1205
1249
|
): EffectiveBalanceIncrements {
|
|
1206
1250
|
this.metrics?.balancesCache.requests.inc();
|
|
1207
1251
|
|
|
@@ -1228,7 +1272,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1228
1272
|
});
|
|
1229
1273
|
}
|
|
1230
1274
|
|
|
1231
|
-
return getEffectiveBalanceIncrementsZeroInactive(
|
|
1275
|
+
return state.getEffectiveBalanceIncrementsZeroInactive();
|
|
1232
1276
|
}
|
|
1233
1277
|
|
|
1234
1278
|
/**
|
|
@@ -1240,8 +1284,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1240
1284
|
*/
|
|
1241
1285
|
private closestJustifiedBalancesStateToCheckpoint(
|
|
1242
1286
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1243
|
-
blockState:
|
|
1244
|
-
): {state:
|
|
1287
|
+
blockState: IBeaconStateView
|
|
1288
|
+
): {state: IBeaconStateView; stateId: string; shouldWarn: boolean} {
|
|
1245
1289
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
1246
1290
|
const state = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
1247
1291
|
if (state) {
|
|
@@ -1324,10 +1368,9 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1324
1368
|
const fork = this.config.getForkName(headState.slot);
|
|
1325
1369
|
|
|
1326
1370
|
if (isForkPostElectra(fork)) {
|
|
1327
|
-
|
|
1328
|
-
metrics.
|
|
1329
|
-
metrics.
|
|
1330
|
-
metrics.pendingConsolidations.set(headStateElectra.pendingConsolidations.length);
|
|
1371
|
+
metrics.pendingDeposits.set(headState.pendingDepositsCount);
|
|
1372
|
+
metrics.pendingPartialWithdrawals.set(headState.pendingPartialWithdrawalsCount);
|
|
1373
|
+
metrics.pendingConsolidations.set(headState.pendingConsolidationsCount);
|
|
1331
1374
|
}
|
|
1332
1375
|
}
|
|
1333
1376
|
|
|
@@ -1391,7 +1434,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1391
1434
|
this.logger.verbose("Fork choice justified", {epoch: cp.epoch, root: cp.rootHex});
|
|
1392
1435
|
}
|
|
1393
1436
|
|
|
1394
|
-
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state:
|
|
1437
|
+
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state: IBeaconStateView): void {
|
|
1395
1438
|
// Defer to not block other checkpoint event handlers, which can cause lightclient update delays
|
|
1396
1439
|
callInNextEventLoop(() => {
|
|
1397
1440
|
this.shufflingCache.processState(state);
|
|
@@ -1402,7 +1445,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1402
1445
|
this.logger.verbose("Fork choice finalized", {epoch: cp.epoch, root: cp.rootHex});
|
|
1403
1446
|
const finalizedSlot = computeStartSlotAtEpoch(cp.epoch);
|
|
1404
1447
|
this.seenBlockProposers.prune(finalizedSlot);
|
|
1405
|
-
this.seenExecutionPayloadEnvelopes.prune(finalizedSlot);
|
|
1406
1448
|
|
|
1407
1449
|
// Update validator custody to account for effective balance changes
|
|
1408
1450
|
await this.updateValidatorsCustodyRequirement(cp);
|
|
@@ -1478,7 +1520,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1478
1520
|
if (stateOrBytes instanceof Uint8Array) {
|
|
1479
1521
|
effectiveBalances = getEffectiveBalancesFromStateBytes(this.config, stateOrBytes, validatorIndices);
|
|
1480
1522
|
} else {
|
|
1481
|
-
effectiveBalances = validatorIndices.map((index) => stateOrBytes.
|
|
1523
|
+
effectiveBalances = validatorIndices.map((index) => stateOrBytes.getValidator(index).effectiveBalance ?? 0);
|
|
1482
1524
|
}
|
|
1483
1525
|
}
|
|
1484
1526
|
|
|
@@ -1528,11 +1570,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1528
1570
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1529
1571
|
}
|
|
1530
1572
|
|
|
1531
|
-
preState = processSlots(
|
|
1573
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1532
1574
|
|
|
1533
1575
|
const proposerRewards = this.regen.getStateSync(toRootHex(block.stateRoot))?.proposerRewards ?? undefined;
|
|
1534
1576
|
|
|
1535
|
-
return computeBlockRewards(
|
|
1577
|
+
return preState.computeBlockRewards(block, proposerRewards);
|
|
1536
1578
|
}
|
|
1537
1579
|
|
|
1538
1580
|
async getAttestationsRewards(
|
|
@@ -1556,7 +1598,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1556
1598
|
throw Error(`State is not in cache for slot ${slot}`);
|
|
1557
1599
|
}
|
|
1558
1600
|
|
|
1559
|
-
const rewards = await computeAttestationsRewards(
|
|
1601
|
+
const rewards = await cachedState.computeAttestationsRewards(validatorIds);
|
|
1560
1602
|
|
|
1561
1603
|
return {rewards, executionOptimistic, finalized};
|
|
1562
1604
|
}
|
|
@@ -1571,8 +1613,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1571
1613
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1572
1614
|
}
|
|
1573
1615
|
|
|
1574
|
-
preState = processSlots(
|
|
1616
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1575
1617
|
|
|
1576
|
-
return computeSyncCommitteeRewards(
|
|
1618
|
+
return preState.computeSyncCommitteeRewards(block, validatorIds ?? []);
|
|
1577
1619
|
}
|
|
1578
1620
|
}
|
package/src/chain/emitter.ts
CHANGED
|
@@ -2,7 +2,7 @@ import {EventEmitter} from "node:events";
|
|
|
2
2
|
import {StrictEventEmitter} from "strict-event-emitter-types";
|
|
3
3
|
import {routes} from "@lodestar/api";
|
|
4
4
|
import {CheckpointWithPayloadStatus} from "@lodestar/fork-choice";
|
|
5
|
-
import {
|
|
5
|
+
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
6
6
|
import {DataColumnSidecars, RootHex, deneb, phase0} from "@lodestar/types";
|
|
7
7
|
import {PeerIdStr} from "../util/peerId.js";
|
|
8
8
|
import {BlockInputSource, IBlockInput} from "./blocks/blockInput/types.js";
|
|
@@ -81,7 +81,7 @@ export type ChainEventData = {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
export type IChainEvents = ApiEvents & {
|
|
84
|
-
[ChainEvent.checkpoint]: (checkpoint: phase0.Checkpoint, state:
|
|
84
|
+
[ChainEvent.checkpoint]: (checkpoint: phase0.Checkpoint, state: IBeaconStateView) => void;
|
|
85
85
|
|
|
86
86
|
[ChainEvent.forkChoiceJustified]: (checkpoint: CheckpointWithPayloadStatus) => void;
|
|
87
87
|
[ChainEvent.forkChoiceFinalized]: (checkpoint: CheckpointWithPayloadStatus) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
2
2
|
import {RootHex, SignedBeaconBlock, Slot, ValidatorIndex} from "@lodestar/types";
|
|
3
3
|
import {LodestarError, toRootHex} from "@lodestar/utils";
|
|
4
4
|
import {ExecutionPayloadStatus} from "../../execution/engine/interface.js";
|
|
@@ -91,13 +91,13 @@ export type BlockErrorType =
|
|
|
91
91
|
| {code: BlockErrorCode.INCORRECT_PROPOSER; proposerIndex: ValidatorIndex}
|
|
92
92
|
| {code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID; blockSlot: Slot}
|
|
93
93
|
| {code: BlockErrorCode.UNKNOWN_PROPOSER; proposerIndex: ValidatorIndex}
|
|
94
|
-
| {code: BlockErrorCode.INVALID_SIGNATURE; state:
|
|
94
|
+
| {code: BlockErrorCode.INVALID_SIGNATURE; state: IBeaconStateView}
|
|
95
95
|
| {
|
|
96
96
|
code: BlockErrorCode.INVALID_STATE_ROOT;
|
|
97
97
|
root: Uint8Array;
|
|
98
98
|
expectedRoot: Uint8Array;
|
|
99
|
-
preState:
|
|
100
|
-
postState:
|
|
99
|
+
preState: IBeaconStateView;
|
|
100
|
+
postState: IBeaconStateView;
|
|
101
101
|
}
|
|
102
102
|
| {code: BlockErrorCode.NOT_FINALIZED_DESCENDANT; parentRoot: RootHex}
|
|
103
103
|
| {code: BlockErrorCode.NOT_LATER_THAN_PARENT; parentSlot: Slot; slot: Slot}
|
|
@@ -4,17 +4,21 @@ import {GossipActionError} from "./gossipValidation.js";
|
|
|
4
4
|
export enum ExecutionPayloadEnvelopeErrorCode {
|
|
5
5
|
BELONG_TO_FINALIZED_BLOCK = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BELONG_TO_FINALIZED_BLOCK",
|
|
6
6
|
BLOCK_ROOT_UNKNOWN = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BLOCK_ROOT_UNKNOWN",
|
|
7
|
+
PARENT_UNKNOWN = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PARENT_UNKNOWN",
|
|
8
|
+
UNKNOWN_BLOCK_STATE = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_UNKNOWN_BLOCK_STATE",
|
|
7
9
|
ENVELOPE_ALREADY_KNOWN = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_ALREADY_KNOWN",
|
|
8
10
|
INVALID_BLOCK = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_BLOCK",
|
|
9
11
|
SLOT_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_SLOT_MISMATCH",
|
|
10
12
|
BUILDER_INDEX_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BUILDER_INDEX_MISMATCH",
|
|
11
13
|
BLOCK_HASH_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BLOCK_HASH_MISMATCH",
|
|
12
14
|
INVALID_SIGNATURE = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_SIGNATURE",
|
|
13
|
-
|
|
15
|
+
PAYLOAD_ENVELOPE_INPUT_MISSING = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PAYLOAD_ENVELOPE_INPUT_MISSING",
|
|
14
16
|
}
|
|
15
17
|
export type ExecutionPayloadEnvelopeErrorType =
|
|
16
18
|
| {code: ExecutionPayloadEnvelopeErrorCode.BELONG_TO_FINALIZED_BLOCK; envelopeSlot: Slot; finalizedSlot: Slot}
|
|
17
19
|
| {code: ExecutionPayloadEnvelopeErrorCode.BLOCK_ROOT_UNKNOWN; blockRoot: RootHex}
|
|
20
|
+
| {code: ExecutionPayloadEnvelopeErrorCode.PARENT_UNKNOWN; parentRoot: RootHex; slot: Slot}
|
|
21
|
+
| {code: ExecutionPayloadEnvelopeErrorCode.UNKNOWN_BLOCK_STATE; blockRoot: RootHex; slot: Slot}
|
|
18
22
|
| {
|
|
19
23
|
code: ExecutionPayloadEnvelopeErrorCode.ENVELOPE_ALREADY_KNOWN;
|
|
20
24
|
blockRoot: RootHex;
|
|
@@ -33,6 +37,6 @@ export type ExecutionPayloadEnvelopeErrorType =
|
|
|
33
37
|
bidBlockHash: RootHex | null;
|
|
34
38
|
}
|
|
35
39
|
| {code: ExecutionPayloadEnvelopeErrorCode.INVALID_SIGNATURE}
|
|
36
|
-
| {code: ExecutionPayloadEnvelopeErrorCode.
|
|
40
|
+
| {code: ExecutionPayloadEnvelopeErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING; blockRoot: RootHex};
|
|
37
41
|
|
|
38
42
|
export class ExecutionPayloadEnvelopeError extends GossipActionError<ExecutionPayloadEnvelopeErrorType> {}
|