@lodestar/beacon-node 1.42.0-dev.f6213da56d → 1.42.0-dev.f866249fa3
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 +84 -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/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 +7 -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 +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/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 +265 -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 +95 -63
- 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/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 +7 -7
- 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 +329 -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
|
@@ -19,16 +19,15 @@ import {
|
|
|
19
19
|
isForkPostElectra,
|
|
20
20
|
} from "@lodestar/params";
|
|
21
21
|
import {
|
|
22
|
-
CachedBeaconStateAllForks,
|
|
23
|
-
CachedBeaconStateAltair,
|
|
24
|
-
CachedBeaconStateGloas,
|
|
25
22
|
EffectiveBalanceIncrements,
|
|
23
|
+
IBeaconStateView,
|
|
26
24
|
RootCache,
|
|
27
25
|
computeEpochAtSlot,
|
|
28
26
|
computeSlotsSinceEpochStart,
|
|
29
27
|
computeStartSlotAtEpoch,
|
|
30
28
|
getAttestationParticipationStatus,
|
|
31
|
-
|
|
29
|
+
isStatePostAltair,
|
|
30
|
+
isStatePostGloas,
|
|
32
31
|
} from "@lodestar/state-transition";
|
|
33
32
|
import {Attestation, Epoch, RootHex, Slot, electra, isElectraAttestation, phase0, ssz} from "@lodestar/types";
|
|
34
33
|
import {MapDef, assert, toRootHex} from "@lodestar/utils";
|
|
@@ -212,7 +211,7 @@ export class AggregatedAttestationPool {
|
|
|
212
211
|
fork: ForkName,
|
|
213
212
|
forkChoice: IForkChoice,
|
|
214
213
|
shufflingCache: ShufflingCache,
|
|
215
|
-
state:
|
|
214
|
+
state: IBeaconStateView
|
|
216
215
|
): Attestation[] {
|
|
217
216
|
const forkSeq = ForkSeq[fork];
|
|
218
217
|
if (forkSeq < ForkSeq.electra) {
|
|
@@ -229,10 +228,10 @@ export class AggregatedAttestationPool {
|
|
|
229
228
|
fork: ForkName,
|
|
230
229
|
forkChoice: IForkChoice,
|
|
231
230
|
shufflingCache: ShufflingCache,
|
|
232
|
-
state:
|
|
231
|
+
state: IBeaconStateView
|
|
233
232
|
): electra.Attestation[] {
|
|
234
233
|
const stateSlot = state.slot;
|
|
235
|
-
const stateEpoch = state.
|
|
234
|
+
const stateEpoch = state.epoch;
|
|
236
235
|
const statePrevEpoch = stateEpoch - 1;
|
|
237
236
|
const rootCache = new RootCache(state);
|
|
238
237
|
|
|
@@ -312,7 +311,7 @@ export class AggregatedAttestationPool {
|
|
|
312
311
|
// The committeeCountPerSlot can be precomputed once per slot
|
|
313
312
|
const getAttestationGroupResult = attestationGroup.getAttestationsForBlock(
|
|
314
313
|
fork,
|
|
315
|
-
state.
|
|
314
|
+
state.effectiveBalanceIncrements,
|
|
316
315
|
notSeenCommitteeMembers,
|
|
317
316
|
MAX_ATTESTATIONS_PER_GROUP_ELECTRA
|
|
318
317
|
);
|
|
@@ -362,9 +361,7 @@ export class AggregatedAttestationPool {
|
|
|
362
361
|
inclusionDistance,
|
|
363
362
|
stateEpoch,
|
|
364
363
|
rootCache,
|
|
365
|
-
|
|
366
|
-
? (state as CachedBeaconStateGloas).executionPayloadAvailability.toBoolArray()
|
|
367
|
-
: null
|
|
364
|
+
isStatePostGloas(state) ? state.executionPayloadAvailability : null
|
|
368
365
|
);
|
|
369
366
|
|
|
370
367
|
const weight =
|
|
@@ -735,27 +732,29 @@ export function aggregateConsolidation({byCommittee, attData}: AttestationsConso
|
|
|
735
732
|
}
|
|
736
733
|
|
|
737
734
|
/**
|
|
738
|
-
* Pre-compute participation from a
|
|
735
|
+
* Pre-compute participation from a IBeaconStateView, for use to check if an attestation's committee
|
|
739
736
|
* has already attested or not.
|
|
740
737
|
*/
|
|
741
738
|
export function getNotSeenValidatorsFn(
|
|
742
739
|
config: BeaconConfig,
|
|
743
740
|
shufflingCache: ShufflingCache,
|
|
744
|
-
state:
|
|
741
|
+
state: IBeaconStateView
|
|
745
742
|
): GetNotSeenValidatorsFn {
|
|
746
743
|
const stateSlot = state.slot;
|
|
747
744
|
if (config.getForkName(stateSlot) === ForkName.phase0) {
|
|
748
745
|
throw new Error("getNotSeenValidatorsFn is not supported phase0 state");
|
|
749
746
|
}
|
|
747
|
+
if (!isStatePostAltair(state)) {
|
|
748
|
+
throw new Error("Expected Altair state for participation tracking");
|
|
749
|
+
}
|
|
750
750
|
|
|
751
751
|
// altair and future forks
|
|
752
752
|
// Get attestations to be included in an altair block.
|
|
753
753
|
// Attestations are sorted by inclusion distance then number of attesters.
|
|
754
754
|
// Attestations should pass the validation when processing attestations in state-transition.
|
|
755
755
|
// check for altair block already
|
|
756
|
-
const
|
|
757
|
-
const
|
|
758
|
-
const currentParticipation = altairState.currentEpochParticipation.getAll();
|
|
756
|
+
const previousParticipation = state.previousEpochParticipation;
|
|
757
|
+
const currentParticipation = state.currentEpochParticipation;
|
|
759
758
|
const stateEpoch = computeEpochAtSlot(stateSlot);
|
|
760
759
|
// this function could be called multiple times with same slot + committeeIndex
|
|
761
760
|
const cachedNotSeenValidators = new Map<string, Set<number>>();
|
|
@@ -774,7 +773,7 @@ export function getNotSeenValidatorsFn(
|
|
|
774
773
|
return notSeenCommitteeMembers.size === 0 ? null : notSeenCommitteeMembers;
|
|
775
774
|
}
|
|
776
775
|
|
|
777
|
-
const decisionRoot = state.
|
|
776
|
+
const decisionRoot = state.getShufflingDecisionRoot(computeEpochAtSlot(slot));
|
|
778
777
|
const committee = shufflingCache.getBeaconCommittee(epoch, decisionRoot, slot, committeeIndex);
|
|
779
778
|
notSeenCommitteeMembers = new Set<number>();
|
|
780
779
|
for (const [i, validatorIndex] of committee.entries()) {
|
|
@@ -804,11 +803,11 @@ export function getNotSeenValidatorsFn(
|
|
|
804
803
|
*/
|
|
805
804
|
export function getValidateAttestationDataFn(
|
|
806
805
|
forkChoice: IForkChoice,
|
|
807
|
-
state:
|
|
806
|
+
state: IBeaconStateView
|
|
808
807
|
): ValidateAttestationDataFn {
|
|
809
808
|
const cachedValidatedAttestationData = new Map<string, InvalidAttestationData | null>();
|
|
810
809
|
const {previousJustifiedCheckpoint, currentJustifiedCheckpoint} = state;
|
|
811
|
-
const stateEpoch = state.
|
|
810
|
+
const stateEpoch = state.epoch;
|
|
812
811
|
return (attData: phase0.AttestationData) => {
|
|
813
812
|
const targetEpoch = attData.target.epoch;
|
|
814
813
|
let justifiedCheckpoint: phase0.Checkpoint;
|
|
@@ -850,14 +849,14 @@ export function getValidateAttestationDataFn(
|
|
|
850
849
|
*/
|
|
851
850
|
function isValidShuffling(
|
|
852
851
|
forkChoice: IForkChoice,
|
|
853
|
-
state:
|
|
852
|
+
state: IBeaconStateView,
|
|
854
853
|
blockRootHex: RootHex,
|
|
855
854
|
targetEpoch: Epoch
|
|
856
855
|
): InvalidAttestationData | null {
|
|
857
856
|
// Otherwise the shuffling is determined by the block at the end of the target epoch
|
|
858
857
|
// minus the shuffling lookahead (usually 2). We call this the "pivot".
|
|
859
858
|
const pivotSlot = computeStartSlotAtEpoch(targetEpoch - 1) - 1;
|
|
860
|
-
const stateDependentRoot = toRootHex(getBlockRootAtSlot(
|
|
859
|
+
const stateDependentRoot = toRootHex(state.getBlockRootAtSlot(pivotSlot));
|
|
861
860
|
|
|
862
861
|
// Use fork choice's view of the block DAG to quickly evaluate whether the attestation's
|
|
863
862
|
// pivot block is the same as the current state's pivot block. If it is, then the
|
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
MAX_VOLUNTARY_EXITS,
|
|
12
12
|
} from "@lodestar/params";
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
IBeaconStateView,
|
|
15
15
|
computeEpochAtSlot,
|
|
16
16
|
computeStartSlotAtEpoch,
|
|
17
17
|
getAttesterSlashableIndices,
|
|
18
|
-
isValidVoluntaryExit,
|
|
19
18
|
} from "@lodestar/state-transition";
|
|
20
19
|
import {
|
|
21
20
|
AttesterSlashing,
|
|
@@ -185,7 +184,7 @@ export class OpPool {
|
|
|
185
184
|
* slashings included earlier in the block.
|
|
186
185
|
*/
|
|
187
186
|
getSlashingsAndExits(
|
|
188
|
-
state:
|
|
187
|
+
state: IBeaconStateView,
|
|
189
188
|
blockType: BlockType,
|
|
190
189
|
metrics: Metrics | null
|
|
191
190
|
): [
|
|
@@ -207,7 +206,7 @@ export class OpPool {
|
|
|
207
206
|
const endProposerSlashing = stepsMetrics?.startTimer();
|
|
208
207
|
for (const proposerSlashing of this.proposerSlashings.values()) {
|
|
209
208
|
const index = proposerSlashing.signedHeader1.message.proposerIndex;
|
|
210
|
-
const validator = state.
|
|
209
|
+
const validator = state.getValidator(index);
|
|
211
210
|
if (!validator.slashed && validator.activationEpoch <= stateEpoch && stateEpoch < validator.withdrawableEpoch) {
|
|
212
211
|
proposerSlashings.push(proposerSlashing);
|
|
213
212
|
// Set of validators to be slashed, so we don't attempt to construct invalid attester slashings.
|
|
@@ -234,7 +233,7 @@ export class OpPool {
|
|
|
234
233
|
continue attesterSlashing;
|
|
235
234
|
}
|
|
236
235
|
|
|
237
|
-
const validator = state.
|
|
236
|
+
const validator = state.getValidator(index);
|
|
238
237
|
if (isSlashableAtEpoch(validator, stateEpoch)) {
|
|
239
238
|
slashableIndices.add(index);
|
|
240
239
|
}
|
|
@@ -261,7 +260,7 @@ export class OpPool {
|
|
|
261
260
|
for (const voluntaryExit of this.voluntaryExits.values()) {
|
|
262
261
|
if (
|
|
263
262
|
!toBeSlashedIndices.has(voluntaryExit.message.validatorIndex) &&
|
|
264
|
-
isValidVoluntaryExit(
|
|
263
|
+
state.isValidVoluntaryExit(voluntaryExit, false) &&
|
|
265
264
|
// Signature validation is skipped in `isValidVoluntaryExit(,,false)` since it was already validated in gossip
|
|
266
265
|
// However we must make sure that the signature fork is the same, or it will become invalid if included through
|
|
267
266
|
// a future fork.
|
|
@@ -320,7 +319,7 @@ export class OpPool {
|
|
|
320
319
|
/**
|
|
321
320
|
* Prune all types of transactions given the latest head state
|
|
322
321
|
*/
|
|
323
|
-
pruneAll(headBlock: SignedBeaconBlock, headState:
|
|
322
|
+
pruneAll(headBlock: SignedBeaconBlock, headState: IBeaconStateView): void {
|
|
324
323
|
this.pruneAttesterSlashings(headState);
|
|
325
324
|
this.pruneProposerSlashings(headState);
|
|
326
325
|
this.pruneVoluntaryExits(headState);
|
|
@@ -330,7 +329,7 @@ export class OpPool {
|
|
|
330
329
|
/**
|
|
331
330
|
* Prune attester slashings for all slashed or withdrawn validators.
|
|
332
331
|
*/
|
|
333
|
-
private pruneAttesterSlashings(headState:
|
|
332
|
+
private pruneAttesterSlashings(headState: IBeaconStateView): void {
|
|
334
333
|
const finalizedEpoch = headState.finalizedCheckpoint.epoch;
|
|
335
334
|
attesterSlashing: for (const [key, attesterSlashing] of this.attesterSlashings.entries()) {
|
|
336
335
|
// Slashings that don't slash any validators can be dropped
|
|
@@ -342,7 +341,7 @@ export class OpPool {
|
|
|
342
341
|
//
|
|
343
342
|
// We cannot check the `slashed` field since the `head` is not finalized and
|
|
344
343
|
// a fork could un-slash someone.
|
|
345
|
-
if (headState.
|
|
344
|
+
if (headState.getValidator(index).exitEpoch > finalizedEpoch) {
|
|
346
345
|
continue attesterSlashing;
|
|
347
346
|
}
|
|
348
347
|
}
|
|
@@ -355,11 +354,11 @@ export class OpPool {
|
|
|
355
354
|
/**
|
|
356
355
|
* Prune proposer slashings for validators which are exited in the finalized epoch.
|
|
357
356
|
*/
|
|
358
|
-
private pruneProposerSlashings(headState:
|
|
357
|
+
private pruneProposerSlashings(headState: IBeaconStateView): void {
|
|
359
358
|
const finalizedEpoch = headState.finalizedCheckpoint.epoch;
|
|
360
359
|
for (const [key, proposerSlashing] of this.proposerSlashings.entries()) {
|
|
361
360
|
const index = proposerSlashing.signedHeader1.message.proposerIndex;
|
|
362
|
-
if (headState.
|
|
361
|
+
if (headState.getValidator(index).exitEpoch <= finalizedEpoch) {
|
|
363
362
|
this.proposerSlashings.delete(key);
|
|
364
363
|
}
|
|
365
364
|
}
|
|
@@ -369,7 +368,7 @@ export class OpPool {
|
|
|
369
368
|
* Call after finalizing
|
|
370
369
|
* Prune if validator has already exited at or before the finalized checkpoint of the head.
|
|
371
370
|
*/
|
|
372
|
-
private pruneVoluntaryExits(headState:
|
|
371
|
+
private pruneVoluntaryExits(headState: IBeaconStateView): void {
|
|
373
372
|
const headStateFork = this.config.getForkSeq(headState.slot);
|
|
374
373
|
const finalizedEpoch = headState.finalizedCheckpoint.epoch;
|
|
375
374
|
|
|
@@ -392,7 +391,7 @@ export class OpPool {
|
|
|
392
391
|
* In the worse case where head block is reorged, the same BlsToExecutionChange message can be re-added
|
|
393
392
|
* to opPool once gossipsub seen cache TTL passes.
|
|
394
393
|
*/
|
|
395
|
-
private pruneBlsToExecutionChanges(headBlock: SignedBeaconBlock, headState:
|
|
394
|
+
private pruneBlsToExecutionChanges(headBlock: SignedBeaconBlock, headState: IBeaconStateView): void {
|
|
396
395
|
const recentBlsToExecutionChanges =
|
|
397
396
|
this.config.getForkSeq(headBlock.message.slot) >= ForkSeq.capella
|
|
398
397
|
? (headBlock as capella.SignedBeaconBlock).message.body.blsToExecutionChanges
|
|
@@ -405,7 +404,7 @@ export class OpPool {
|
|
|
405
404
|
for (const [key, blsToExecutionChange] of this.blsToExecutionChanges.entries()) {
|
|
406
405
|
const {validatorIndex} = blsToExecutionChange.data.message;
|
|
407
406
|
if (!recentBlsToExecutionChangeIndexes.has(validatorIndex)) {
|
|
408
|
-
const validator = headState.
|
|
407
|
+
const validator = headState.getValidator(validatorIndex);
|
|
409
408
|
if (validator.withdrawalCredentials[0] !== BLS_WITHDRAWAL_PREFIX) {
|
|
410
409
|
this.blsToExecutionChanges.delete(key);
|
|
411
410
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Signature} from "@chainsafe/blst";
|
|
2
2
|
import {BLS_WITHDRAWAL_PREFIX} from "@lodestar/params";
|
|
3
|
-
import {
|
|
3
|
+
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
4
4
|
import {Slot, capella} from "@lodestar/types";
|
|
5
5
|
import {AggregateFast, AggregateFastElectra} from "./attestationPool.js";
|
|
6
6
|
|
|
@@ -38,7 +38,7 @@ export function signatureFromBytesNoCheck(signature: Uint8Array): Signature {
|
|
|
38
38
|
* can become invalid for certain forks.
|
|
39
39
|
*/
|
|
40
40
|
export function isValidBlsToExecutionChangeForBlockInclusion(
|
|
41
|
-
state:
|
|
41
|
+
state: IBeaconStateView,
|
|
42
42
|
signedBLSToExecutionChange: capella.SignedBLSToExecutionChange
|
|
43
43
|
): boolean {
|
|
44
44
|
// For each condition from https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/capella/beacon-chain.md#new-process_bls_to_execution_change
|
|
@@ -48,7 +48,7 @@ export function isValidBlsToExecutionChangeForBlockInclusion(
|
|
|
48
48
|
//
|
|
49
49
|
// 2. assert validator.withdrawal_credentials[:1] == BLS_WITHDRAWAL_PREFIX:
|
|
50
50
|
// Must be checked again, since it can already be changed by now.
|
|
51
|
-
const validator = state.
|
|
51
|
+
const validator = state.getValidator(signedBLSToExecutionChange.message.validatorIndex);
|
|
52
52
|
const {withdrawalCredentials} = validator;
|
|
53
53
|
if (withdrawalCredentials[0] !== BLS_WITHDRAWAL_PREFIX) {
|
|
54
54
|
return false;
|
package/src/chain/options.ts
CHANGED
|
@@ -47,6 +47,7 @@ export type IChainOptions = BlockProcessOpts &
|
|
|
47
47
|
minSameMessageSignatureSetsToBatch: number;
|
|
48
48
|
archiveDateEpochs?: number;
|
|
49
49
|
nHistoricalStatesFileDataStore?: boolean;
|
|
50
|
+
nativeStateView?: boolean;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export type BlockProcessOpts = {
|
|
@@ -124,6 +125,7 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
124
125
|
// - users can prune the persisted checkpoint state files manually to save disc space
|
|
125
126
|
// - it helps debug easier when network is unfinalized
|
|
126
127
|
nHistoricalStatesFileDataStore: true,
|
|
128
|
+
nativeStateView: false,
|
|
127
129
|
maxBlockStates: DEFAULT_MAX_BLOCK_STATES,
|
|
128
130
|
maxCPStateEpochsInMemory: DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY,
|
|
129
131
|
maxCPStateEpochsOnDisk: DEFAULT_MAX_CP_STATE_ON_DISK,
|
|
@@ -3,12 +3,11 @@ import {ChainForkConfig} from "@lodestar/config";
|
|
|
3
3
|
import {PayloadStatus, getSafeExecutionBlockHash} from "@lodestar/fork-choice";
|
|
4
4
|
import {ForkPostBellatrix, ForkSeq, SLOTS_PER_EPOCH, isForkPostBellatrix} from "@lodestar/params";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
CachedBeaconStateExecutions,
|
|
8
|
-
CachedBeaconStateGloas,
|
|
6
|
+
IBeaconStateView,
|
|
9
7
|
StateHashTreeRootSource,
|
|
10
8
|
computeEpochAtSlot,
|
|
11
9
|
computeTimeAtSlot,
|
|
10
|
+
isStatePostBellatrix,
|
|
12
11
|
} from "@lodestar/state-transition";
|
|
13
12
|
import {Slot} from "@lodestar/types";
|
|
14
13
|
import {Logger, fromHex, isErrorAborted, sleep} from "@lodestar/utils";
|
|
@@ -121,9 +120,9 @@ export class PrepareNextSlotScheduler {
|
|
|
121
120
|
);
|
|
122
121
|
|
|
123
122
|
if (isForkPostBellatrix(fork)) {
|
|
124
|
-
const proposerIndex = prepareState.
|
|
123
|
+
const proposerIndex = prepareState.getBeaconProposer(prepareSlot);
|
|
125
124
|
const feeRecipient = this.chain.beaconProposerCache.get(proposerIndex);
|
|
126
|
-
let updatedPrepareState = prepareState
|
|
125
|
+
let updatedPrepareState = prepareState;
|
|
127
126
|
let updatedHeadRoot = headRoot;
|
|
128
127
|
|
|
129
128
|
if (feeRecipient) {
|
|
@@ -140,13 +139,13 @@ export class PrepareNextSlotScheduler {
|
|
|
140
139
|
headRoot,
|
|
141
140
|
});
|
|
142
141
|
this.metrics?.weakHeadDetected.inc();
|
|
143
|
-
updatedPrepareState =
|
|
142
|
+
updatedPrepareState = await this.chain.regen.getBlockSlotState(
|
|
144
143
|
proposerHead,
|
|
145
144
|
prepareSlot,
|
|
146
145
|
// only transfer cache if epoch transition because that's the state we will use to stateTransition() the 1st block of epoch
|
|
147
146
|
{dontTransferCache: !isEpochTransition},
|
|
148
147
|
RegenCaller.predictProposerHead
|
|
149
|
-
)
|
|
148
|
+
);
|
|
150
149
|
updatedHeadRoot = proposerHeadRoot;
|
|
151
150
|
}
|
|
152
151
|
|
|
@@ -161,6 +160,9 @@ export class PrepareNextSlotScheduler {
|
|
|
161
160
|
const preparationTime =
|
|
162
161
|
computeTimeAtSlot(this.config, prepareSlot, this.chain.genesisTime) - Date.now() / 1000;
|
|
163
162
|
this.metrics?.blockPayload.payloadAdvancePrepTime.observe(preparationTime);
|
|
163
|
+
if (!isStatePostBellatrix(updatedPrepareState)) {
|
|
164
|
+
throw new Error("Expected Bellatrix state for payload preparation");
|
|
165
|
+
}
|
|
164
166
|
|
|
165
167
|
const safeBlockHash = getSafeExecutionBlockHash(this.chain.forkChoice);
|
|
166
168
|
const finalizedBlockHash =
|
|
@@ -185,6 +187,10 @@ export class PrepareNextSlotScheduler {
|
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
189
|
|
|
190
|
+
if (!isStatePostBellatrix(updatedPrepareState)) {
|
|
191
|
+
throw new Error("Expected Bellatrix state for payload attributes");
|
|
192
|
+
}
|
|
193
|
+
|
|
188
194
|
this.computeStateHashTreeRoot(updatedPrepareState, isEpochTransition);
|
|
189
195
|
|
|
190
196
|
// If emitPayloadAttributes is true emit a SSE payloadAttributes event
|
|
@@ -239,7 +245,7 @@ export class PrepareNextSlotScheduler {
|
|
|
239
245
|
}
|
|
240
246
|
};
|
|
241
247
|
|
|
242
|
-
computeStateHashTreeRoot(state:
|
|
248
|
+
computeStateHashTreeRoot(state: IBeaconStateView, isEpochTransition: boolean): void {
|
|
243
249
|
// cache HashObjects for faster hashTreeRoot() later, especially for computeNewStateRoot() if we need to produce a block at slot 0 of epoch
|
|
244
250
|
// see https://github.com/ChainSafe/lodestar/issues/6194
|
|
245
251
|
const hashTreeRootTimer = this.metrics?.stateHashTreeRootTime.startTimer({
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CachedBeaconStateAllForks,
|
|
3
|
-
CachedBeaconStateGloas,
|
|
4
2
|
DataAvailabilityStatus,
|
|
5
3
|
ExecutionPayloadStatus,
|
|
6
4
|
G2_POINT_AT_INFINITY,
|
|
5
|
+
IBeaconStateView,
|
|
6
|
+
IBeaconStateViewGloas,
|
|
7
7
|
StateHashTreeRootSource,
|
|
8
|
-
stateTransition,
|
|
9
8
|
} from "@lodestar/state-transition";
|
|
10
|
-
import {processExecutionPayloadEnvelope} from "@lodestar/state-transition/block";
|
|
11
9
|
import {BeaconBlock, BlindedBeaconBlock, Gwei, Root, gloas} from "@lodestar/types";
|
|
12
10
|
import {ZERO_HASH} from "../../constants/index.js";
|
|
13
11
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -19,14 +17,13 @@ import {Metrics} from "../../metrics/index.js";
|
|
|
19
17
|
*/
|
|
20
18
|
export function computeNewStateRoot(
|
|
21
19
|
metrics: Metrics | null,
|
|
22
|
-
state:
|
|
20
|
+
state: IBeaconStateView,
|
|
23
21
|
block: BeaconBlock | BlindedBeaconBlock
|
|
24
|
-
): {newStateRoot: Root; proposerReward: Gwei; postState:
|
|
22
|
+
): {newStateRoot: Root; proposerReward: Gwei; postState: IBeaconStateView} {
|
|
25
23
|
// Set signature to zero to re-use stateTransition() function which requires the SignedBeaconBlock type
|
|
26
24
|
const blockEmptySig = {message: block, signature: ZERO_HASH};
|
|
27
25
|
|
|
28
|
-
const postState = stateTransition(
|
|
29
|
-
state,
|
|
26
|
+
const postState = state.stateTransition(
|
|
30
27
|
blockEmptySig,
|
|
31
28
|
{
|
|
32
29
|
// ExecutionPayloadStatus.valid: Assume payload valid, it has been produced by a trusted EL
|
|
@@ -64,7 +61,7 @@ export function computeNewStateRoot(
|
|
|
64
61
|
*/
|
|
65
62
|
export function computeEnvelopeStateRoot(
|
|
66
63
|
metrics: Metrics | null,
|
|
67
|
-
postBlockState:
|
|
64
|
+
postBlockState: IBeaconStateViewGloas,
|
|
68
65
|
envelope: gloas.ExecutionPayloadEnvelope
|
|
69
66
|
): Root {
|
|
70
67
|
const signedEnvelope: gloas.SignedExecutionPayloadEnvelope = {
|
|
@@ -73,7 +70,7 @@ export function computeEnvelopeStateRoot(
|
|
|
73
70
|
};
|
|
74
71
|
|
|
75
72
|
const processEnvelopeTimer = metrics?.blockPayload.executionPayloadEnvelopeProcessingTime.startTimer();
|
|
76
|
-
const postEnvelopeState = processExecutionPayloadEnvelope(
|
|
73
|
+
const postEnvelopeState = postBlockState.processExecutionPayloadEnvelope(signedEnvelope, {
|
|
77
74
|
// Signature is zero-ed (G2_POINT_AT_INFINITY), skip verification
|
|
78
75
|
verifySignature: false,
|
|
79
76
|
// State root is being computed here, the envelope doesn't have it yet
|
|
@@ -15,15 +15,13 @@ import {
|
|
|
15
15
|
isForkPostGloas,
|
|
16
16
|
} from "@lodestar/params";
|
|
17
17
|
import {
|
|
18
|
-
CachedBeaconStateAllForks,
|
|
19
|
-
CachedBeaconStateBellatrix,
|
|
20
|
-
CachedBeaconStateCapella,
|
|
21
|
-
CachedBeaconStateExecutions,
|
|
22
|
-
CachedBeaconStateGloas,
|
|
23
18
|
G2_POINT_AT_INFINITY,
|
|
19
|
+
IBeaconStateView,
|
|
20
|
+
type IBeaconStateViewBellatrix,
|
|
24
21
|
computeTimeAtSlot,
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
isStatePostBellatrix,
|
|
23
|
+
isStatePostCapella,
|
|
24
|
+
isStatePostGloas,
|
|
27
25
|
} from "@lodestar/state-transition";
|
|
28
26
|
import {
|
|
29
27
|
BLSPubkey,
|
|
@@ -161,7 +159,7 @@ export type ProduceResult =
|
|
|
161
159
|
export async function produceBlockBody<T extends BlockType>(
|
|
162
160
|
this: BeaconChain,
|
|
163
161
|
blockType: T,
|
|
164
|
-
currentState:
|
|
162
|
+
currentState: IBeaconStateView,
|
|
165
163
|
blockAttr: BlockAttributes & {
|
|
166
164
|
proposerIndex: ValidatorIndex;
|
|
167
165
|
proposerPubKey: BLSPubkey;
|
|
@@ -201,10 +199,13 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
201
199
|
this.logger.verbose("Producing beacon block body", logMeta);
|
|
202
200
|
|
|
203
201
|
if (isForkPostGloas(fork)) {
|
|
202
|
+
if (!isStatePostGloas(currentState)) {
|
|
203
|
+
throw new Error("Expected Gloas state for Gloas block production");
|
|
204
|
+
}
|
|
205
|
+
|
|
204
206
|
// TODO GLOAS: support non self-building here, the block type differentiation between
|
|
205
207
|
// full and blinded no longer makes sense in gloas, it might be a good idea to move
|
|
206
208
|
// this into a completely separate function and have pre/post gloas more separated
|
|
207
|
-
const gloasState = currentState as CachedBeaconStateGloas;
|
|
208
209
|
const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice);
|
|
209
210
|
const finalizedBlockHash = this.forkChoice.getFinalizedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
|
|
210
211
|
const feeRecipient = requestedFeeRecipient ?? this.beaconProposerCache.getOrDefault(proposerIndex);
|
|
@@ -225,7 +226,7 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
225
226
|
parentBlockRoot,
|
|
226
227
|
safeBlockHash,
|
|
227
228
|
finalizedBlockHash ?? ZERO_HASH_HEX,
|
|
228
|
-
|
|
229
|
+
currentState,
|
|
229
230
|
feeRecipient
|
|
230
231
|
);
|
|
231
232
|
|
|
@@ -259,10 +260,10 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
259
260
|
|
|
260
261
|
// Create self-build execution payload bid
|
|
261
262
|
const bid: gloas.ExecutionPayloadBid = {
|
|
262
|
-
parentBlockHash:
|
|
263
|
+
parentBlockHash: currentState.latestBlockHash,
|
|
263
264
|
parentBlockRoot: parentBlockRoot,
|
|
264
265
|
blockHash: executionPayload.blockHash,
|
|
265
|
-
prevRandao: getRandaoMix(
|
|
266
|
+
prevRandao: currentState.getRandaoMix(currentState.epoch),
|
|
266
267
|
feeRecipient: executionPayload.feeRecipient,
|
|
267
268
|
gasLimit: BigInt(executionPayload.gasLimit),
|
|
268
269
|
builderIndex: BUILDER_INDEX_SELF_BUILD,
|
|
@@ -308,6 +309,10 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
308
309
|
shouldOverrideBuilder,
|
|
309
310
|
});
|
|
310
311
|
} else if (isForkPostBellatrix(fork)) {
|
|
312
|
+
if (!isStatePostBellatrix(currentState)) {
|
|
313
|
+
throw new Error("Expected Bellatrix state for execution block production");
|
|
314
|
+
}
|
|
315
|
+
|
|
311
316
|
const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice);
|
|
312
317
|
const finalizedBlockHash = this.forkChoice.getFinalizedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
|
|
313
318
|
const feeRecipient = requestedFeeRecipient ?? this.beaconProposerCache.getOrDefault(proposerIndex);
|
|
@@ -336,7 +341,7 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
336
341
|
parentBlockRoot,
|
|
337
342
|
safeBlockHash,
|
|
338
343
|
finalizedBlockHash ?? ZERO_HASH_HEX,
|
|
339
|
-
currentState
|
|
344
|
+
currentState,
|
|
340
345
|
executionBuilder.issueLocalFcUWithFeeRecipient
|
|
341
346
|
);
|
|
342
347
|
}
|
|
@@ -348,12 +353,7 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
348
353
|
slot: blockSlot,
|
|
349
354
|
proposerPubKey: toHex(proposerPubKey),
|
|
350
355
|
});
|
|
351
|
-
const headerRes = await prepareExecutionPayloadHeader(
|
|
352
|
-
this,
|
|
353
|
-
fork,
|
|
354
|
-
currentState as CachedBeaconStateBellatrix,
|
|
355
|
-
proposerPubKey
|
|
356
|
-
);
|
|
356
|
+
const headerRes = await prepareExecutionPayloadHeader(this, fork, currentState, proposerPubKey);
|
|
357
357
|
|
|
358
358
|
endExecutionPayloadHeader?.({
|
|
359
359
|
step: BlockProductionStep.executionPayload,
|
|
@@ -388,7 +388,7 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
388
388
|
});
|
|
389
389
|
} else {
|
|
390
390
|
const headerGasLimit = builderRes.header.gasLimit;
|
|
391
|
-
const parentGasLimit =
|
|
391
|
+
const parentGasLimit = currentState.latestExecutionPayloadHeader.gasLimit;
|
|
392
392
|
const expectedGasLimit = getExpectedGasLimit(parentGasLimit, targetGasLimit);
|
|
393
393
|
|
|
394
394
|
const lowerBound = Math.min(parentGasLimit, expectedGasLimit);
|
|
@@ -449,7 +449,7 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
449
449
|
parentBlockRoot,
|
|
450
450
|
safeBlockHash,
|
|
451
451
|
finalizedBlockHash ?? ZERO_HASH_HEX,
|
|
452
|
-
currentState
|
|
452
|
+
currentState,
|
|
453
453
|
feeRecipient
|
|
454
454
|
);
|
|
455
455
|
|
|
@@ -614,14 +614,12 @@ export async function prepareExecutionPayload(
|
|
|
614
614
|
parentBlockRoot: Root,
|
|
615
615
|
safeBlockHash: RootHex,
|
|
616
616
|
finalizedBlockHash: RootHex,
|
|
617
|
-
state:
|
|
617
|
+
state: IBeaconStateViewBellatrix,
|
|
618
618
|
suggestedFeeRecipient: string
|
|
619
619
|
): Promise<{prepType: PayloadPreparationType; payloadId: PayloadId}> {
|
|
620
|
-
const parentHash =
|
|
621
|
-
? (state as CachedBeaconStateGloas).latestBlockHash
|
|
622
|
-
: (state as CachedBeaconStateExecutions).latestExecutionPayloadHeader.blockHash;
|
|
620
|
+
const parentHash = state.latestBlockHash;
|
|
623
621
|
const timestamp = computeTimeAtSlot(chain.config, state.slot, state.genesisTime);
|
|
624
|
-
const prevRandao = getRandaoMix(state
|
|
622
|
+
const prevRandao = state.getRandaoMix(state.epoch);
|
|
625
623
|
|
|
626
624
|
const payloadIdCached = chain.executionEngine.payloadIdCache.get({
|
|
627
625
|
headBlockHash: toRootHex(parentHash),
|
|
@@ -684,7 +682,7 @@ async function prepareExecutionPayloadHeader(
|
|
|
684
682
|
config: ChainForkConfig;
|
|
685
683
|
},
|
|
686
684
|
fork: ForkPostBellatrix,
|
|
687
|
-
state:
|
|
685
|
+
state: IBeaconStateViewBellatrix,
|
|
688
686
|
proposerPubKey: BLSPubkey
|
|
689
687
|
): Promise<{
|
|
690
688
|
header: ExecutionPayloadHeader;
|
|
@@ -711,16 +709,9 @@ export function getPayloadAttributesForSSE(
|
|
|
711
709
|
prepareSlot,
|
|
712
710
|
parentBlockRoot,
|
|
713
711
|
feeRecipient,
|
|
714
|
-
}: {
|
|
715
|
-
prepareState: CachedBeaconStateExecutions | CachedBeaconStateGloas;
|
|
716
|
-
prepareSlot: Slot;
|
|
717
|
-
parentBlockRoot: Root;
|
|
718
|
-
feeRecipient: string;
|
|
719
|
-
}
|
|
712
|
+
}: {prepareState: IBeaconStateViewBellatrix; prepareSlot: Slot; parentBlockRoot: Root; feeRecipient: string}
|
|
720
713
|
): SSEPayloadAttributes {
|
|
721
|
-
const parentHash =
|
|
722
|
-
? (prepareState as CachedBeaconStateGloas).latestBlockHash
|
|
723
|
-
: (prepareState as CachedBeaconStateExecutions).latestExecutionPayloadHeader.blockHash;
|
|
714
|
+
const parentHash = prepareState.latestBlockHash;
|
|
724
715
|
const payloadAttributes = preparePayloadAttributes(fork, chain, {
|
|
725
716
|
prepareState,
|
|
726
717
|
prepareSlot,
|
|
@@ -736,11 +727,11 @@ export function getPayloadAttributesForSSE(
|
|
|
736
727
|
}
|
|
737
728
|
parentBlockNumber = parentBlock.executionPayloadNumber;
|
|
738
729
|
} else {
|
|
739
|
-
parentBlockNumber =
|
|
730
|
+
parentBlockNumber = prepareState.payloadBlockNumber;
|
|
740
731
|
}
|
|
741
732
|
|
|
742
733
|
const ssePayloadAttributes: SSEPayloadAttributes = {
|
|
743
|
-
proposerIndex: prepareState.
|
|
734
|
+
proposerIndex: prepareState.getBeaconProposer(prepareSlot),
|
|
744
735
|
proposalSlot: prepareSlot,
|
|
745
736
|
parentBlockNumber,
|
|
746
737
|
parentBlockRoot,
|
|
@@ -761,14 +752,14 @@ function preparePayloadAttributes(
|
|
|
761
752
|
parentBlockRoot,
|
|
762
753
|
feeRecipient,
|
|
763
754
|
}: {
|
|
764
|
-
prepareState:
|
|
755
|
+
prepareState: IBeaconStateViewBellatrix;
|
|
765
756
|
prepareSlot: Slot;
|
|
766
757
|
parentBlockRoot: Root;
|
|
767
758
|
feeRecipient: string;
|
|
768
759
|
}
|
|
769
760
|
): SSEPayloadAttributes["payloadAttributes"] {
|
|
770
761
|
const timestamp = computeTimeAtSlot(chain.config, prepareSlot, prepareState.genesisTime);
|
|
771
|
-
const prevRandao = getRandaoMix(prepareState
|
|
762
|
+
const prevRandao = prepareState.getRandaoMix(prepareState.epoch);
|
|
772
763
|
const payloadAttributes = {
|
|
773
764
|
timestamp,
|
|
774
765
|
prevRandao,
|
|
@@ -776,11 +767,13 @@ function preparePayloadAttributes(
|
|
|
776
767
|
};
|
|
777
768
|
|
|
778
769
|
if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
770
|
+
if (!isStatePostCapella(prepareState)) {
|
|
771
|
+
throw new Error("Expected Capella state for withdrawals");
|
|
772
|
+
}
|
|
773
|
+
|
|
779
774
|
// withdrawals logic is now fork aware as it changes on electra fork post capella
|
|
780
|
-
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
|
|
781
|
-
|
|
782
|
-
prepareState as CachedBeaconStateCapella
|
|
783
|
-
).expectedWithdrawals;
|
|
775
|
+
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
|
|
776
|
+
prepareState.getExpectedWithdrawals().expectedWithdrawals;
|
|
784
777
|
}
|
|
785
778
|
|
|
786
779
|
if (ForkSeq[fork] >= ForkSeq.deneb) {
|
|
@@ -793,7 +786,7 @@ function preparePayloadAttributes(
|
|
|
793
786
|
export async function produceCommonBlockBody<T extends BlockType>(
|
|
794
787
|
this: BeaconChain,
|
|
795
788
|
blockType: T,
|
|
796
|
-
currentState:
|
|
789
|
+
currentState: IBeaconStateView,
|
|
797
790
|
{randaoReveal, graffiti, slot, parentBlock}: BlockAttributes
|
|
798
791
|
): Promise<CommonBlockBody> {
|
|
799
792
|
const stepsMetrics =
|