@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
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IBeaconStateView,
|
|
4
|
+
SyncCommitteeCacheEmpty,
|
|
5
|
+
getBlockSignatureSets,
|
|
6
|
+
isStatePostAltair,
|
|
7
|
+
} from "@lodestar/state-transition";
|
|
3
8
|
import {IndexedAttestation, SignedBeaconBlock} from "@lodestar/types";
|
|
4
9
|
import {Logger} from "@lodestar/utils";
|
|
5
10
|
import {Metrics} from "../../metrics/metrics.js";
|
|
@@ -20,14 +25,16 @@ export async function verifyBlocksSignatures(
|
|
|
20
25
|
bls: IBlsVerifier,
|
|
21
26
|
logger: Logger,
|
|
22
27
|
metrics: Metrics | null,
|
|
23
|
-
preState0:
|
|
28
|
+
preState0: IBeaconStateView,
|
|
24
29
|
blocks: SignedBeaconBlock[],
|
|
25
30
|
indexedAttestationsByBlock: IndexedAttestation[][],
|
|
26
31
|
opts: ImportBlockOpts
|
|
27
32
|
): Promise<{verifySignaturesTime: number}> {
|
|
28
33
|
const isValidPromises: Promise<boolean>[] = [];
|
|
29
34
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
30
|
-
const currentSyncCommitteeIndexed = preState0
|
|
35
|
+
const currentSyncCommitteeIndexed = isStatePostAltair(preState0)
|
|
36
|
+
? preState0.currentSyncCommitteeIndexed
|
|
37
|
+
: new SyncCommitteeCacheEmpty();
|
|
31
38
|
|
|
32
39
|
// Verifies signatures after running state transition, so all SyncCommittee signed roots are known at this point.
|
|
33
40
|
// We must ensure block.slot <= state.slot before running getAllBlockSignatureSets().
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CachedBeaconStateAllForks,
|
|
3
2
|
DataAvailabilityStatus,
|
|
4
3
|
ExecutionPayloadStatus,
|
|
4
|
+
IBeaconStateView,
|
|
5
5
|
StateHashTreeRootSource,
|
|
6
|
-
stateTransition,
|
|
7
6
|
} from "@lodestar/state-transition";
|
|
8
7
|
import {ErrorAborted, Logger, byteArrayEquals} from "@lodestar/utils";
|
|
9
8
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -23,7 +22,7 @@ import {ImportBlockOpts} from "./types.js";
|
|
|
23
22
|
* - Check state root matches
|
|
24
23
|
*/
|
|
25
24
|
export async function verifyBlocksStateTransitionOnly(
|
|
26
|
-
preState0:
|
|
25
|
+
preState0: IBeaconStateView,
|
|
27
26
|
blocks: IBlockInput[],
|
|
28
27
|
dataAvailabilityStatuses: DataAvailabilityStatus[],
|
|
29
28
|
logger: Logger,
|
|
@@ -31,8 +30,8 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
31
30
|
validatorMonitor: ValidatorMonitor | null,
|
|
32
31
|
signal: AbortSignal,
|
|
33
32
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
34
|
-
): Promise<{postStates:
|
|
35
|
-
const postStates:
|
|
33
|
+
): Promise<{postStates: IBeaconStateView[]; proposerBalanceDeltas: number[]; verifyStateTime: number}> {
|
|
34
|
+
const postStates: IBeaconStateView[] = [];
|
|
36
35
|
const proposerBalanceDeltas: number[] = [];
|
|
37
36
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
38
37
|
|
|
@@ -45,8 +44,7 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
45
44
|
// STFN - per_slot_processing() + per_block_processing()
|
|
46
45
|
// NOTE: `regen.getPreState()` should have dialed forward the state already caching checkpoint states
|
|
47
46
|
const useBlsBatchVerify = !opts?.disableBlsBatchVerify;
|
|
48
|
-
const postState = stateTransition(
|
|
49
|
-
preState,
|
|
47
|
+
const postState = preState.stateTransition(
|
|
50
48
|
block,
|
|
51
49
|
{
|
|
52
50
|
// NOTE: Assume valid for now while sending payload to execution engine in parallel
|
|
@@ -84,7 +82,7 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
84
82
|
|
|
85
83
|
// For metric block profitability
|
|
86
84
|
const proposerIndex = block.message.proposerIndex;
|
|
87
|
-
proposerBalanceDeltas[i] = postState.
|
|
85
|
+
proposerBalanceDeltas[i] = postState.getBalance(proposerIndex) - preState.getBalance(proposerIndex);
|
|
88
86
|
|
|
89
87
|
// If blocks are invalid in execution the main promise could resolve before this loop ends.
|
|
90
88
|
// In that case stop processing blocks and return early.
|
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,36 +14,30 @@ 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
|
+
type ForkPostGloas,
|
|
18
19
|
GENESIS_SLOT,
|
|
19
20
|
SLOTS_PER_EPOCH,
|
|
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
|
-
|
|
32
|
+
isStatePostAltair,
|
|
33
|
+
isStatePostElectra,
|
|
34
|
+
isStatePostGloas,
|
|
41
35
|
} from "@lodestar/state-transition";
|
|
42
36
|
import {
|
|
43
37
|
BeaconBlock,
|
|
44
38
|
BlindedBeaconBlock,
|
|
45
39
|
BlindedBeaconBlockBody,
|
|
46
|
-
|
|
40
|
+
DataColumnSidecar,
|
|
47
41
|
Epoch,
|
|
48
42
|
Root,
|
|
49
43
|
RootHex,
|
|
@@ -283,7 +277,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
283
277
|
clock?: IClock;
|
|
284
278
|
metrics: Metrics | null;
|
|
285
279
|
validatorMonitor: ValidatorMonitor | null;
|
|
286
|
-
anchorState:
|
|
280
|
+
anchorState: IBeaconStateView;
|
|
287
281
|
isAnchorStateFinalized: boolean;
|
|
288
282
|
executionEngine: IExecutionEngine;
|
|
289
283
|
executionBuilder?: IExecutionBuilder;
|
|
@@ -359,16 +353,16 @@ export class BeaconChain implements IBeaconChain {
|
|
|
359
353
|
|
|
360
354
|
this.shufflingCache = new ShufflingCache(metrics, logger, this.opts, [
|
|
361
355
|
{
|
|
362
|
-
shuffling: anchorState.
|
|
363
|
-
decisionRoot: anchorState.
|
|
356
|
+
shuffling: anchorState.getPreviousShuffling(),
|
|
357
|
+
decisionRoot: anchorState.previousDecisionRoot,
|
|
364
358
|
},
|
|
365
359
|
{
|
|
366
|
-
shuffling: anchorState.
|
|
367
|
-
decisionRoot: anchorState.
|
|
360
|
+
shuffling: anchorState.getCurrentShuffling(),
|
|
361
|
+
decisionRoot: anchorState.currentDecisionRoot,
|
|
368
362
|
},
|
|
369
363
|
{
|
|
370
|
-
shuffling: anchorState.
|
|
371
|
-
decisionRoot: anchorState.
|
|
364
|
+
shuffling: anchorState.getNextShuffling(),
|
|
365
|
+
decisionRoot: anchorState.nextDecisionRoot,
|
|
372
366
|
},
|
|
373
367
|
]);
|
|
374
368
|
|
|
@@ -377,7 +371,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
377
371
|
|
|
378
372
|
const fileDataStore = opts.nHistoricalStatesFileDataStore ?? true;
|
|
379
373
|
const blockStateCache = new FIFOBlockStateCache(this.opts, {metrics});
|
|
380
|
-
this.bufferPool = new BufferPool(anchorState.
|
|
374
|
+
this.bufferPool = new BufferPool(anchorState.serializedSize(), metrics);
|
|
381
375
|
|
|
382
376
|
this.cpStateDatastore = fileDataStore ? new FileCPStateDatastore(dataDir) : new DbCPStateDatastore(this.db);
|
|
383
377
|
const checkpointStateCache: CheckpointStateCache = new PersistentCheckpointStateCache(
|
|
@@ -393,10 +387,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
393
387
|
this.opts
|
|
394
388
|
);
|
|
395
389
|
|
|
396
|
-
const {checkpoint} = computeAnchorCheckpoint(
|
|
390
|
+
const {checkpoint} = anchorState.computeAnchorCheckpoint();
|
|
397
391
|
blockStateCache.add(anchorState);
|
|
398
392
|
blockStateCache.setHeadState(anchorState);
|
|
399
|
-
const payloadPresent = getCheckpointPayloadStatus(anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
393
|
+
const payloadPresent = getCheckpointPayloadStatus(config, anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
400
394
|
checkpointStateCache.add(checkpoint, anchorState, payloadPresent);
|
|
401
395
|
|
|
402
396
|
const forkChoice = initializeForkChoice(
|
|
@@ -513,7 +507,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
513
507
|
}
|
|
514
508
|
|
|
515
509
|
seenBlock(blockRoot: RootHex): boolean {
|
|
516
|
-
return this.seenBlockInputCache.
|
|
510
|
+
return this.seenBlockInputCache.hasBlock(blockRoot) || this.forkChoice.hasBlockHexUnsafe(blockRoot);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
seenPayloadEnvelope(blockRoot: RootHex): boolean {
|
|
514
|
+
return this.seenPayloadEnvelopeInputCache.hasPayload(blockRoot) || this.forkChoice.hasPayloadHexUnsafe(blockRoot);
|
|
517
515
|
}
|
|
518
516
|
|
|
519
517
|
regenCanAcceptWork(): boolean {
|
|
@@ -557,7 +555,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
557
555
|
await this.opPool.toPersisted(this.db);
|
|
558
556
|
}
|
|
559
557
|
|
|
560
|
-
getHeadState():
|
|
558
|
+
getHeadState(): IBeaconStateView {
|
|
561
559
|
// head state should always exist
|
|
562
560
|
const head = this.forkChoice.getHead();
|
|
563
561
|
const headState = this.regen.getClosestHeadState(head);
|
|
@@ -567,11 +565,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
567
565
|
return headState;
|
|
568
566
|
}
|
|
569
567
|
|
|
570
|
-
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<
|
|
568
|
+
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
571
569
|
return this.getHeadStateAtEpoch(this.clock.currentEpoch, regenCaller);
|
|
572
570
|
}
|
|
573
571
|
|
|
574
|
-
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<
|
|
572
|
+
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
575
573
|
// using getHeadState() means we'll use checkpointStateCache if it's available
|
|
576
574
|
const headState = this.getHeadState();
|
|
577
575
|
// head state is in the same epoch, or we pulled up head state already from past epoch
|
|
@@ -588,7 +586,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
588
586
|
async getStateBySlot(
|
|
589
587
|
slot: Slot,
|
|
590
588
|
opts?: StateGetOpts
|
|
591
|
-
): Promise<{state:
|
|
589
|
+
): Promise<{state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
592
590
|
const finalizedBlock = this.forkChoice.getFinalizedBlock();
|
|
593
591
|
|
|
594
592
|
if (slot < finalizedBlock.slot) {
|
|
@@ -638,15 +636,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
638
636
|
async getStateByStateRoot(
|
|
639
637
|
stateRoot: RootHex,
|
|
640
638
|
opts?: StateGetOpts
|
|
641
|
-
): Promise<{state:
|
|
639
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
642
640
|
if (opts?.allowRegen) {
|
|
643
641
|
const state = await this.regen.getState(stateRoot, RegenCaller.restApi);
|
|
644
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
642
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
643
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(state.latestBlockHeader)
|
|
644
|
+
);
|
|
645
645
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
646
646
|
return {
|
|
647
647
|
state,
|
|
648
648
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
649
|
-
finalized: state.
|
|
649
|
+
finalized: state.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
652
|
|
|
@@ -657,12 +657,14 @@ export class BeaconChain implements IBeaconChain {
|
|
|
657
657
|
// TODO: This is very inneficient for debug requests of serialized content, since it deserializes to serialize again
|
|
658
658
|
const cachedStateCtx = this.regen.getStateSync(stateRoot);
|
|
659
659
|
if (cachedStateCtx) {
|
|
660
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
660
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
661
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
662
|
+
);
|
|
661
663
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
662
664
|
return {
|
|
663
665
|
state: cachedStateCtx,
|
|
664
666
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
665
|
-
finalized: cachedStateCtx.
|
|
667
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
666
668
|
};
|
|
667
669
|
}
|
|
668
670
|
|
|
@@ -689,17 +691,19 @@ export class BeaconChain implements IBeaconChain {
|
|
|
689
691
|
|
|
690
692
|
getStateByCheckpoint(
|
|
691
693
|
checkpoint: CheckpointWithPayloadStatus
|
|
692
|
-
): {state:
|
|
694
|
+
): {state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null {
|
|
693
695
|
// finalized or justified checkpoint states maynot be available with PersistentCheckpointStateCache, use getCheckpointStateOrBytes() api to get Uint8Array
|
|
694
696
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
695
697
|
const cachedStateCtx = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
696
698
|
if (cachedStateCtx) {
|
|
697
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
699
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
700
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
701
|
+
);
|
|
698
702
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
699
703
|
return {
|
|
700
704
|
state: cachedStateCtx,
|
|
701
705
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
702
|
-
finalized: cachedStateCtx.
|
|
706
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
703
707
|
};
|
|
704
708
|
}
|
|
705
709
|
|
|
@@ -708,7 +712,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
708
712
|
|
|
709
713
|
async getStateOrBytesByCheckpoint(
|
|
710
714
|
checkpoint: CheckpointWithPayloadStatus
|
|
711
|
-
): Promise<{state:
|
|
715
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
712
716
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
713
717
|
const cachedStateCtx = await this.regen.getCheckpointStateOrBytes(checkpointHexPayload);
|
|
714
718
|
if (cachedStateCtx) {
|
|
@@ -858,20 +862,50 @@ export class BeaconChain implements IBeaconChain {
|
|
|
858
862
|
return null;
|
|
859
863
|
}
|
|
860
864
|
|
|
861
|
-
async
|
|
862
|
-
const
|
|
863
|
-
if (
|
|
864
|
-
|
|
865
|
-
|
|
865
|
+
async getSerializedExecutionPayloadEnvelope(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null> {
|
|
866
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
867
|
+
if (payloadInput?.hasPayloadEnvelope()) {
|
|
868
|
+
const envelope = payloadInput.getPayloadEnvelope();
|
|
869
|
+
const serialized = this.serializedCache.get(envelope);
|
|
870
|
+
if (serialized) {
|
|
871
|
+
return serialized;
|
|
872
|
+
}
|
|
873
|
+
return ssz.gloas.SignedExecutionPayloadEnvelope.serialize(envelope);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
return (
|
|
877
|
+
(await this.db.executionPayloadEnvelope.getBinary(fromHex(blockRootHex))) ??
|
|
878
|
+
(await this.db.executionPayloadEnvelopeArchive.getBinary(blockSlot)) ??
|
|
879
|
+
null
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
async getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecar[]> {
|
|
884
|
+
const fork = this.config.getForkName(blockSlot);
|
|
885
|
+
|
|
886
|
+
if (isForkPostGloas(fork)) {
|
|
887
|
+
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
888
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
889
|
+
if (payloadInput) {
|
|
890
|
+
return payloadInput.getAllColumns();
|
|
891
|
+
}
|
|
892
|
+
} else {
|
|
893
|
+
// Before gloas, columns are tracked in BlockInput
|
|
894
|
+
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
895
|
+
if (blockInput) {
|
|
896
|
+
if (!isBlockInputColumns(blockInput)) {
|
|
897
|
+
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
898
|
+
}
|
|
899
|
+
return blockInput.getAllColumns();
|
|
866
900
|
}
|
|
867
|
-
return blockInput.getAllColumns();
|
|
868
901
|
}
|
|
902
|
+
|
|
869
903
|
const sidecarsUnfinalized = await this.db.dataColumnSidecar.values(fromHex(blockRootHex));
|
|
870
904
|
if (sidecarsUnfinalized.length > 0) {
|
|
871
|
-
return sidecarsUnfinalized
|
|
905
|
+
return sidecarsUnfinalized;
|
|
872
906
|
}
|
|
873
907
|
const sidecarsFinalized = await this.db.dataColumnSidecarArchive.values(blockSlot);
|
|
874
|
-
return sidecarsFinalized
|
|
908
|
+
return sidecarsFinalized;
|
|
875
909
|
}
|
|
876
910
|
|
|
877
911
|
async getSerializedDataColumnSidecars(
|
|
@@ -879,23 +913,45 @@ export class BeaconChain implements IBeaconChain {
|
|
|
879
913
|
blockRootHex: string,
|
|
880
914
|
indices: number[]
|
|
881
915
|
): Promise<(Uint8Array | undefined)[]> {
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
916
|
+
const fork = this.config.getForkName(blockSlot);
|
|
917
|
+
|
|
918
|
+
if (isForkPostGloas(fork)) {
|
|
919
|
+
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
920
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
921
|
+
if (payloadInput) {
|
|
922
|
+
return indices.map((index) => {
|
|
923
|
+
const sidecar = payloadInput.getColumn(index);
|
|
924
|
+
if (!sidecar) {
|
|
925
|
+
return undefined;
|
|
926
|
+
}
|
|
927
|
+
const serialized = this.serializedCache.get(sidecar);
|
|
928
|
+
if (serialized) {
|
|
929
|
+
return serialized;
|
|
930
|
+
}
|
|
931
|
+
return sszTypesFor(fork as ForkPostGloas).DataColumnSidecar.serialize(sidecar);
|
|
932
|
+
});
|
|
886
933
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
if (serialized) {
|
|
894
|
-
return serialized;
|
|
934
|
+
} else {
|
|
935
|
+
// Before gloas, columns are tracked in BlockInput
|
|
936
|
+
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
937
|
+
if (blockInput) {
|
|
938
|
+
if (!isBlockInputColumns(blockInput)) {
|
|
939
|
+
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
895
940
|
}
|
|
896
|
-
return
|
|
897
|
-
|
|
941
|
+
return indices.map((index) => {
|
|
942
|
+
const sidecar = blockInput.getColumn(index);
|
|
943
|
+
if (!sidecar) {
|
|
944
|
+
return undefined;
|
|
945
|
+
}
|
|
946
|
+
const serialized = this.serializedCache.get(sidecar);
|
|
947
|
+
if (serialized) {
|
|
948
|
+
return serialized;
|
|
949
|
+
}
|
|
950
|
+
return sszTypesFor(blockInput.forkName as ForkPostFulu).DataColumnSidecar.serialize(sidecar);
|
|
951
|
+
});
|
|
952
|
+
}
|
|
898
953
|
}
|
|
954
|
+
|
|
899
955
|
const sidecarsUnfinalized = await this.db.dataColumnSidecar.getManyBinary(fromHex(blockRootHex), indices);
|
|
900
956
|
if (sidecarsUnfinalized.some((sidecar) => sidecar != null)) {
|
|
901
957
|
return sidecarsUnfinalized;
|
|
@@ -952,14 +1008,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
952
1008
|
consensusBlockValue: Wei;
|
|
953
1009
|
shouldOverrideBuilder?: boolean;
|
|
954
1010
|
}> {
|
|
955
|
-
const fork = this.config.getForkName(slot);
|
|
956
1011
|
const state = await this.regen.getBlockSlotState(
|
|
957
1012
|
parentBlock,
|
|
958
1013
|
slot,
|
|
959
1014
|
{dontTransferCache: true},
|
|
960
1015
|
RegenCaller.produceBlock
|
|
961
1016
|
);
|
|
962
|
-
const proposerIndex = state.
|
|
1017
|
+
const proposerIndex = state.getBeaconProposer(slot);
|
|
963
1018
|
const proposerPubKey = this.pubkeyCache.getOrThrow(proposerIndex).toBytes();
|
|
964
1019
|
|
|
965
1020
|
const {body, produceResult, executionPayloadValue, shouldOverrideBuilder} = await produceBlockBody.call(
|
|
@@ -981,7 +1036,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
981
1036
|
// The hashtree root computed here for debug log will get cached and hence won't introduce additional delays
|
|
982
1037
|
const bodyRoot =
|
|
983
1038
|
produceResult.type === BlockType.Full
|
|
984
|
-
?
|
|
1039
|
+
? this.config.getForkTypes(slot).BeaconBlockBody.hashTreeRoot(body)
|
|
985
1040
|
: this.config
|
|
986
1041
|
.getPostBellatrixForkTypes(slot)
|
|
987
1042
|
.BlindedBeaconBlockBody.hashTreeRoot(body as BlindedBeaconBlockBody);
|
|
@@ -1003,10 +1058,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1003
1058
|
block.stateRoot = newStateRoot;
|
|
1004
1059
|
const blockRoot =
|
|
1005
1060
|
produceResult.type === BlockType.Full
|
|
1006
|
-
?
|
|
1061
|
+
? this.config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block)
|
|
1007
1062
|
: this.config.getPostBellatrixForkTypes(slot).BlindedBeaconBlock.hashTreeRoot(block as BlindedBeaconBlock);
|
|
1008
1063
|
const blockRootHex = toRootHex(blockRoot);
|
|
1009
1064
|
|
|
1065
|
+
const fork = this.config.getForkName(slot);
|
|
1010
1066
|
if (isForkPostGloas(fork)) {
|
|
1011
1067
|
// TODO GLOAS: we should retire BlockType post-gloas, may need a new enum for self vs non-self built
|
|
1012
1068
|
if (produceResult.type !== BlockType.Full) {
|
|
@@ -1022,7 +1078,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1022
1078
|
slot,
|
|
1023
1079
|
stateRoot: ZERO_HASH,
|
|
1024
1080
|
};
|
|
1025
|
-
|
|
1081
|
+
if (!isStatePostGloas(postState)) {
|
|
1082
|
+
throw Error(`Expected gloas+ post-state for execution payload envelope, got fork=${postState.forkName}`);
|
|
1083
|
+
}
|
|
1084
|
+
const envelopeStateRoot = computeEnvelopeStateRoot(this.metrics, postState, envelope);
|
|
1026
1085
|
gloasResult.envelopeStateRoot = envelopeStateRoot;
|
|
1027
1086
|
}
|
|
1028
1087
|
|
|
@@ -1143,8 +1202,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1143
1202
|
* persist preState, postState and block for further investigation.
|
|
1144
1203
|
*/
|
|
1145
1204
|
async persistInvalidStateRoot(
|
|
1146
|
-
preState:
|
|
1147
|
-
postState:
|
|
1205
|
+
preState: IBeaconStateView,
|
|
1206
|
+
postState: IBeaconStateView,
|
|
1148
1207
|
block: SignedBeaconBlock
|
|
1149
1208
|
): Promise<void> {
|
|
1150
1209
|
const blockSlot = block.message.slot;
|
|
@@ -1159,13 +1218,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1159
1218
|
`${logStr}_block`
|
|
1160
1219
|
),
|
|
1161
1220
|
this.persistSszObject(
|
|
1162
|
-
`preState_slot_${preState.slot}
|
|
1221
|
+
`preState_slot_${preState.slot}_BeaconState`,
|
|
1163
1222
|
preState.serialize(),
|
|
1164
1223
|
preState.hashTreeRoot(),
|
|
1165
1224
|
`${logStr}_pre_state`
|
|
1166
1225
|
),
|
|
1167
1226
|
this.persistSszObject(
|
|
1168
|
-
`postState_slot_${postState.slot}
|
|
1227
|
+
`postState_slot_${postState.slot}_BeaconState`,
|
|
1169
1228
|
postState.serialize(),
|
|
1170
1229
|
postState.hashTreeRoot(),
|
|
1171
1230
|
`${logStr}_post_state`
|
|
@@ -1185,12 +1244,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1185
1244
|
}
|
|
1186
1245
|
}
|
|
1187
1246
|
|
|
1188
|
-
persistInvalidSszView(view: TreeView<CompositeTypeAny>, suffix?: string): void {
|
|
1189
|
-
if (this.opts.persistInvalidSszObjects) {
|
|
1190
|
-
void this.persistSszObject(view.type.typeName, view.serialize(), view.hashTreeRoot(), suffix);
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
1247
|
/**
|
|
1195
1248
|
* Regenerate state for attestation verification, this does not happen with default chain option of maxSkipSlots = 32 .
|
|
1196
1249
|
* However, need to handle just in case. Lodestar doesn't support multiple regen state requests for attestation verification
|
|
@@ -1208,7 +1261,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1208
1261
|
this.shufflingCache.insertPromise(attEpoch, shufflingDependentRoot);
|
|
1209
1262
|
const blockEpoch = computeEpochAtSlot(attHeadBlock.slot);
|
|
1210
1263
|
|
|
1211
|
-
let state:
|
|
1264
|
+
let state: IBeaconStateView;
|
|
1212
1265
|
if (blockEpoch < attEpoch - 1) {
|
|
1213
1266
|
// thanks to one epoch look ahead, we don't need to dial up to attEpoch
|
|
1214
1267
|
const targetSlot = computeStartSlotAtEpoch(attEpoch - 1);
|
|
@@ -1226,7 +1279,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1226
1279
|
}
|
|
1227
1280
|
// resolve the promise to unblock other calls of the same epoch and dependent root
|
|
1228
1281
|
this.shufflingCache.processState(state);
|
|
1229
|
-
return state.
|
|
1282
|
+
return state.getShufflingAtEpoch(attEpoch);
|
|
1230
1283
|
}
|
|
1231
1284
|
|
|
1232
1285
|
/**
|
|
@@ -1236,7 +1289,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1236
1289
|
*/
|
|
1237
1290
|
private justifiedBalancesGetter(
|
|
1238
1291
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1239
|
-
blockState:
|
|
1292
|
+
blockState: IBeaconStateView
|
|
1240
1293
|
): EffectiveBalanceIncrements {
|
|
1241
1294
|
this.metrics?.balancesCache.requests.inc();
|
|
1242
1295
|
|
|
@@ -1263,7 +1316,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1263
1316
|
});
|
|
1264
1317
|
}
|
|
1265
1318
|
|
|
1266
|
-
return getEffectiveBalanceIncrementsZeroInactive(
|
|
1319
|
+
return state.getEffectiveBalanceIncrementsZeroInactive();
|
|
1267
1320
|
}
|
|
1268
1321
|
|
|
1269
1322
|
/**
|
|
@@ -1275,8 +1328,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1275
1328
|
*/
|
|
1276
1329
|
private closestJustifiedBalancesStateToCheckpoint(
|
|
1277
1330
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1278
|
-
blockState:
|
|
1279
|
-
): {state:
|
|
1331
|
+
blockState: IBeaconStateView
|
|
1332
|
+
): {state: IBeaconStateView; stateId: string; shouldWarn: boolean} {
|
|
1280
1333
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
1281
1334
|
const state = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
1282
1335
|
if (state) {
|
|
@@ -1356,13 +1409,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1356
1409
|
metrics.chain.blacklistedBlocks.set(this.blacklistedBlocks.size);
|
|
1357
1410
|
|
|
1358
1411
|
const headState = this.getHeadState();
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
metrics.pendingDeposits.set(headStateElectra.pendingDeposits.length);
|
|
1364
|
-
metrics.pendingPartialWithdrawals.set(headStateElectra.pendingPartialWithdrawals.length);
|
|
1365
|
-
metrics.pendingConsolidations.set(headStateElectra.pendingConsolidations.length);
|
|
1412
|
+
if (isStatePostElectra(headState)) {
|
|
1413
|
+
metrics.pendingDeposits.set(headState.pendingDepositsCount);
|
|
1414
|
+
metrics.pendingPartialWithdrawals.set(headState.pendingPartialWithdrawalsCount);
|
|
1415
|
+
metrics.pendingConsolidations.set(headState.pendingConsolidationsCount);
|
|
1366
1416
|
}
|
|
1367
1417
|
}
|
|
1368
1418
|
|
|
@@ -1426,7 +1476,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1426
1476
|
this.logger.verbose("Fork choice justified", {epoch: cp.epoch, root: cp.rootHex});
|
|
1427
1477
|
}
|
|
1428
1478
|
|
|
1429
|
-
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state:
|
|
1479
|
+
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state: IBeaconStateView): void {
|
|
1430
1480
|
// Defer to not block other checkpoint event handlers, which can cause lightclient update delays
|
|
1431
1481
|
callInNextEventLoop(() => {
|
|
1432
1482
|
this.shufflingCache.processState(state);
|
|
@@ -1512,7 +1562,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1512
1562
|
if (stateOrBytes instanceof Uint8Array) {
|
|
1513
1563
|
effectiveBalances = getEffectiveBalancesFromStateBytes(this.config, stateOrBytes, validatorIndices);
|
|
1514
1564
|
} else {
|
|
1515
|
-
effectiveBalances = validatorIndices.map((index) => stateOrBytes.
|
|
1565
|
+
effectiveBalances = validatorIndices.map((index) => stateOrBytes.getValidator(index).effectiveBalance ?? 0);
|
|
1516
1566
|
}
|
|
1517
1567
|
}
|
|
1518
1568
|
|
|
@@ -1562,11 +1612,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1562
1612
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1563
1613
|
}
|
|
1564
1614
|
|
|
1565
|
-
preState = processSlots(
|
|
1615
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1566
1616
|
|
|
1567
1617
|
const proposerRewards = this.regen.getStateSync(toRootHex(block.stateRoot))?.proposerRewards ?? undefined;
|
|
1568
1618
|
|
|
1569
|
-
return computeBlockRewards(
|
|
1619
|
+
return preState.computeBlockRewards(block, proposerRewards);
|
|
1570
1620
|
}
|
|
1571
1621
|
|
|
1572
1622
|
async getAttestationsRewards(
|
|
@@ -1590,7 +1640,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1590
1640
|
throw Error(`State is not in cache for slot ${slot}`);
|
|
1591
1641
|
}
|
|
1592
1642
|
|
|
1593
|
-
const rewards = await computeAttestationsRewards(
|
|
1643
|
+
const rewards = await cachedState.computeAttestationsRewards(validatorIds);
|
|
1594
1644
|
|
|
1595
1645
|
return {rewards, executionOptimistic, finalized};
|
|
1596
1646
|
}
|
|
@@ -1605,8 +1655,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1605
1655
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1606
1656
|
}
|
|
1607
1657
|
|
|
1608
|
-
preState = processSlots(
|
|
1658
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1659
|
+
if (!isStatePostAltair(preState)) {
|
|
1660
|
+
throw new Error("Sync committee rewards are not supported before Altair");
|
|
1661
|
+
}
|
|
1609
1662
|
|
|
1610
|
-
return computeSyncCommitteeRewards(
|
|
1663
|
+
return preState.computeSyncCommitteeRewards(block, validatorIds ?? []);
|
|
1611
1664
|
}
|
|
1612
1665
|
}
|