@lodestar/beacon-node 1.42.0-dev.d73eccfa56 → 1.42.0-dev.e8407e9657
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.js +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +27 -32
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +4 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +27 -27
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/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 +34 -22
- 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 +78 -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 +4 -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 +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +15 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +102 -59
- 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 +27 -23
- 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 +10 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +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 +3 -3
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +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 +12 -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/attestation.js +3 -3
- package/lib/chain/validation/attestation.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 +4 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +2 -3
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +1 -2
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +13 -12
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +3 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +9 -7
- 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 +311 -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 +1 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +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 +19 -2
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +173 -3
- 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 +1 -1
- package/src/api/impl/beacon/state/index.ts +29 -41
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +4 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +29 -41
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/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 +41 -26
- package/src/chain/blocks/importExecutionPayload.ts +89 -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 +9 -14
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +138 -91
- 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 +33 -42
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +16 -15
- package/src/chain/lightClient/index.ts +9 -22
- package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +6 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +6 -10
- package/src/chain/produceBlock/produceBlockBody.ts +22 -49
- 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/attestation.ts +3 -3
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +2 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +3 -7
- package/src/chain/validation/executionPayloadEnvelope.ts +2 -8
- package/src/chain/validation/payloadAttestationMessage.ts +2 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +21 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +12 -11
- 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 +393 -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 +3 -5
- package/src/node/notifier.ts +4 -10
- 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 +223 -7
- package/src/util/types.ts +6 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, getBlockSignatureSets} from "@lodestar/state-transition";
|
|
3
3
|
import {IndexedAttestation, SignedBeaconBlock} from "@lodestar/types";
|
|
4
4
|
import {Logger} from "@lodestar/utils";
|
|
5
5
|
import {Metrics} from "../../metrics/metrics.js";
|
|
@@ -20,14 +20,14 @@ export async function verifyBlocksSignatures(
|
|
|
20
20
|
bls: IBlsVerifier,
|
|
21
21
|
logger: Logger,
|
|
22
22
|
metrics: Metrics | null,
|
|
23
|
-
preState0:
|
|
23
|
+
preState0: IBeaconStateView,
|
|
24
24
|
blocks: SignedBeaconBlock[],
|
|
25
25
|
indexedAttestationsByBlock: IndexedAttestation[][],
|
|
26
26
|
opts: ImportBlockOpts
|
|
27
27
|
): Promise<{verifySignaturesTime: number}> {
|
|
28
28
|
const isValidPromises: Promise<boolean>[] = [];
|
|
29
29
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
30
|
-
const currentSyncCommitteeIndexed = preState0.
|
|
30
|
+
const currentSyncCommitteeIndexed = preState0.currentSyncCommitteeIndexed;
|
|
31
31
|
|
|
32
32
|
// Verifies signatures after running state transition, so all SyncCommittee signed roots are known at this point.
|
|
33
33
|
// 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,28 @@ 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
21
|
isForkPostElectra,
|
|
21
22
|
isForkPostGloas,
|
|
22
23
|
} from "@lodestar/params";
|
|
23
24
|
import {
|
|
24
|
-
BeaconStateAllForks,
|
|
25
|
-
BeaconStateElectra,
|
|
26
|
-
CachedBeaconStateAllForks,
|
|
27
|
-
CachedBeaconStateGloas,
|
|
28
25
|
EffectiveBalanceIncrements,
|
|
29
26
|
EpochShuffling,
|
|
27
|
+
IBeaconStateView,
|
|
30
28
|
PubkeyCache,
|
|
31
|
-
computeAnchorCheckpoint,
|
|
32
|
-
computeAttestationsRewards,
|
|
33
|
-
computeBlockRewards,
|
|
34
29
|
computeEndSlotAtEpoch,
|
|
35
30
|
computeEpochAtSlot,
|
|
36
31
|
computeStartSlotAtEpoch,
|
|
37
|
-
computeSyncCommitteeRewards,
|
|
38
|
-
getEffectiveBalanceIncrementsZeroInactive,
|
|
39
32
|
getEffectiveBalancesFromStateBytes,
|
|
40
|
-
processSlots,
|
|
41
33
|
} from "@lodestar/state-transition";
|
|
42
34
|
import {
|
|
43
35
|
BeaconBlock,
|
|
44
36
|
BlindedBeaconBlock,
|
|
45
37
|
BlindedBeaconBlockBody,
|
|
46
|
-
|
|
38
|
+
DataColumnSidecar,
|
|
47
39
|
Epoch,
|
|
48
40
|
Root,
|
|
49
41
|
RootHex,
|
|
@@ -283,7 +275,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
283
275
|
clock?: IClock;
|
|
284
276
|
metrics: Metrics | null;
|
|
285
277
|
validatorMonitor: ValidatorMonitor | null;
|
|
286
|
-
anchorState:
|
|
278
|
+
anchorState: IBeaconStateView;
|
|
287
279
|
isAnchorStateFinalized: boolean;
|
|
288
280
|
executionEngine: IExecutionEngine;
|
|
289
281
|
executionBuilder?: IExecutionBuilder;
|
|
@@ -359,16 +351,16 @@ export class BeaconChain implements IBeaconChain {
|
|
|
359
351
|
|
|
360
352
|
this.shufflingCache = new ShufflingCache(metrics, logger, this.opts, [
|
|
361
353
|
{
|
|
362
|
-
shuffling: anchorState.
|
|
363
|
-
decisionRoot: anchorState.
|
|
354
|
+
shuffling: anchorState.getPreviousShuffling(),
|
|
355
|
+
decisionRoot: anchorState.previousDecisionRoot,
|
|
364
356
|
},
|
|
365
357
|
{
|
|
366
|
-
shuffling: anchorState.
|
|
367
|
-
decisionRoot: anchorState.
|
|
358
|
+
shuffling: anchorState.getCurrentShuffling(),
|
|
359
|
+
decisionRoot: anchorState.currentDecisionRoot,
|
|
368
360
|
},
|
|
369
361
|
{
|
|
370
|
-
shuffling: anchorState.
|
|
371
|
-
decisionRoot: anchorState.
|
|
362
|
+
shuffling: anchorState.getNextShuffling(),
|
|
363
|
+
decisionRoot: anchorState.nextDecisionRoot,
|
|
372
364
|
},
|
|
373
365
|
]);
|
|
374
366
|
|
|
@@ -377,7 +369,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
377
369
|
|
|
378
370
|
const fileDataStore = opts.nHistoricalStatesFileDataStore ?? true;
|
|
379
371
|
const blockStateCache = new FIFOBlockStateCache(this.opts, {metrics});
|
|
380
|
-
this.bufferPool = new BufferPool(anchorState.
|
|
372
|
+
this.bufferPool = new BufferPool(anchorState.serializedSize(), metrics);
|
|
381
373
|
|
|
382
374
|
this.cpStateDatastore = fileDataStore ? new FileCPStateDatastore(dataDir) : new DbCPStateDatastore(this.db);
|
|
383
375
|
const checkpointStateCache: CheckpointStateCache = new PersistentCheckpointStateCache(
|
|
@@ -393,10 +385,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
393
385
|
this.opts
|
|
394
386
|
);
|
|
395
387
|
|
|
396
|
-
const {checkpoint} = computeAnchorCheckpoint(
|
|
388
|
+
const {checkpoint} = anchorState.computeAnchorCheckpoint();
|
|
397
389
|
blockStateCache.add(anchorState);
|
|
398
390
|
blockStateCache.setHeadState(anchorState);
|
|
399
|
-
const payloadPresent = getCheckpointPayloadStatus(anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
391
|
+
const payloadPresent = getCheckpointPayloadStatus(config, anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
400
392
|
checkpointStateCache.add(checkpoint, anchorState, payloadPresent);
|
|
401
393
|
|
|
402
394
|
const forkChoice = initializeForkChoice(
|
|
@@ -513,7 +505,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
513
505
|
}
|
|
514
506
|
|
|
515
507
|
seenBlock(blockRoot: RootHex): boolean {
|
|
516
|
-
return this.seenBlockInputCache.
|
|
508
|
+
return this.seenBlockInputCache.hasBlock(blockRoot) || this.forkChoice.hasBlockHexUnsafe(blockRoot);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
seenPayloadEnvelope(blockRoot: RootHex): boolean {
|
|
512
|
+
return this.seenPayloadEnvelopeInputCache.hasPayload(blockRoot) || this.forkChoice.hasPayloadHexUnsafe(blockRoot);
|
|
517
513
|
}
|
|
518
514
|
|
|
519
515
|
regenCanAcceptWork(): boolean {
|
|
@@ -557,7 +553,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
557
553
|
await this.opPool.toPersisted(this.db);
|
|
558
554
|
}
|
|
559
555
|
|
|
560
|
-
getHeadState():
|
|
556
|
+
getHeadState(): IBeaconStateView {
|
|
561
557
|
// head state should always exist
|
|
562
558
|
const head = this.forkChoice.getHead();
|
|
563
559
|
const headState = this.regen.getClosestHeadState(head);
|
|
@@ -567,11 +563,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
567
563
|
return headState;
|
|
568
564
|
}
|
|
569
565
|
|
|
570
|
-
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<
|
|
566
|
+
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
571
567
|
return this.getHeadStateAtEpoch(this.clock.currentEpoch, regenCaller);
|
|
572
568
|
}
|
|
573
569
|
|
|
574
|
-
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<
|
|
570
|
+
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
575
571
|
// using getHeadState() means we'll use checkpointStateCache if it's available
|
|
576
572
|
const headState = this.getHeadState();
|
|
577
573
|
// head state is in the same epoch, or we pulled up head state already from past epoch
|
|
@@ -588,7 +584,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
588
584
|
async getStateBySlot(
|
|
589
585
|
slot: Slot,
|
|
590
586
|
opts?: StateGetOpts
|
|
591
|
-
): Promise<{state:
|
|
587
|
+
): Promise<{state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
592
588
|
const finalizedBlock = this.forkChoice.getFinalizedBlock();
|
|
593
589
|
|
|
594
590
|
if (slot < finalizedBlock.slot) {
|
|
@@ -638,15 +634,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
638
634
|
async getStateByStateRoot(
|
|
639
635
|
stateRoot: RootHex,
|
|
640
636
|
opts?: StateGetOpts
|
|
641
|
-
): Promise<{state:
|
|
637
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
642
638
|
if (opts?.allowRegen) {
|
|
643
639
|
const state = await this.regen.getState(stateRoot, RegenCaller.restApi);
|
|
644
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
640
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
641
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(state.latestBlockHeader)
|
|
642
|
+
);
|
|
645
643
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
646
644
|
return {
|
|
647
645
|
state,
|
|
648
646
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
649
|
-
finalized: state.
|
|
647
|
+
finalized: state.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
650
648
|
};
|
|
651
649
|
}
|
|
652
650
|
|
|
@@ -657,12 +655,14 @@ export class BeaconChain implements IBeaconChain {
|
|
|
657
655
|
// TODO: This is very inneficient for debug requests of serialized content, since it deserializes to serialize again
|
|
658
656
|
const cachedStateCtx = this.regen.getStateSync(stateRoot);
|
|
659
657
|
if (cachedStateCtx) {
|
|
660
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
658
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
659
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
660
|
+
);
|
|
661
661
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
662
662
|
return {
|
|
663
663
|
state: cachedStateCtx,
|
|
664
664
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
665
|
-
finalized: cachedStateCtx.
|
|
665
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
666
666
|
};
|
|
667
667
|
}
|
|
668
668
|
|
|
@@ -689,17 +689,19 @@ export class BeaconChain implements IBeaconChain {
|
|
|
689
689
|
|
|
690
690
|
getStateByCheckpoint(
|
|
691
691
|
checkpoint: CheckpointWithPayloadStatus
|
|
692
|
-
): {state:
|
|
692
|
+
): {state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null {
|
|
693
693
|
// finalized or justified checkpoint states maynot be available with PersistentCheckpointStateCache, use getCheckpointStateOrBytes() api to get Uint8Array
|
|
694
694
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
695
695
|
const cachedStateCtx = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
696
696
|
if (cachedStateCtx) {
|
|
697
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
697
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
698
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
699
|
+
);
|
|
698
700
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
699
701
|
return {
|
|
700
702
|
state: cachedStateCtx,
|
|
701
703
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
702
|
-
finalized: cachedStateCtx.
|
|
704
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
703
705
|
};
|
|
704
706
|
}
|
|
705
707
|
|
|
@@ -708,7 +710,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
708
710
|
|
|
709
711
|
async getStateOrBytesByCheckpoint(
|
|
710
712
|
checkpoint: CheckpointWithPayloadStatus
|
|
711
|
-
): Promise<{state:
|
|
713
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
712
714
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
713
715
|
const cachedStateCtx = await this.regen.getCheckpointStateOrBytes(checkpointHexPayload);
|
|
714
716
|
if (cachedStateCtx) {
|
|
@@ -858,20 +860,50 @@ export class BeaconChain implements IBeaconChain {
|
|
|
858
860
|
return null;
|
|
859
861
|
}
|
|
860
862
|
|
|
861
|
-
async
|
|
862
|
-
const
|
|
863
|
-
if (
|
|
864
|
-
|
|
865
|
-
|
|
863
|
+
async getSerializedExecutionPayloadEnvelope(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null> {
|
|
864
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
865
|
+
if (payloadInput?.hasPayloadEnvelope()) {
|
|
866
|
+
const envelope = payloadInput.getPayloadEnvelope();
|
|
867
|
+
const serialized = this.serializedCache.get(envelope);
|
|
868
|
+
if (serialized) {
|
|
869
|
+
return serialized;
|
|
870
|
+
}
|
|
871
|
+
return ssz.gloas.SignedExecutionPayloadEnvelope.serialize(envelope);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
return (
|
|
875
|
+
(await this.db.executionPayloadEnvelope.getBinary(fromHex(blockRootHex))) ??
|
|
876
|
+
(await this.db.executionPayloadEnvelopeArchive.getBinary(blockSlot)) ??
|
|
877
|
+
null
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
async getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecar[]> {
|
|
882
|
+
const fork = this.config.getForkName(blockSlot);
|
|
883
|
+
|
|
884
|
+
if (isForkPostGloas(fork)) {
|
|
885
|
+
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
886
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
887
|
+
if (payloadInput) {
|
|
888
|
+
return payloadInput.getAllColumns();
|
|
889
|
+
}
|
|
890
|
+
} else {
|
|
891
|
+
// Before gloas, columns are tracked in BlockInput
|
|
892
|
+
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
893
|
+
if (blockInput) {
|
|
894
|
+
if (!isBlockInputColumns(blockInput)) {
|
|
895
|
+
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
896
|
+
}
|
|
897
|
+
return blockInput.getAllColumns();
|
|
866
898
|
}
|
|
867
|
-
return blockInput.getAllColumns();
|
|
868
899
|
}
|
|
900
|
+
|
|
869
901
|
const sidecarsUnfinalized = await this.db.dataColumnSidecar.values(fromHex(blockRootHex));
|
|
870
902
|
if (sidecarsUnfinalized.length > 0) {
|
|
871
|
-
return sidecarsUnfinalized
|
|
903
|
+
return sidecarsUnfinalized;
|
|
872
904
|
}
|
|
873
905
|
const sidecarsFinalized = await this.db.dataColumnSidecarArchive.values(blockSlot);
|
|
874
|
-
return sidecarsFinalized
|
|
906
|
+
return sidecarsFinalized;
|
|
875
907
|
}
|
|
876
908
|
|
|
877
909
|
async getSerializedDataColumnSidecars(
|
|
@@ -879,23 +911,45 @@ export class BeaconChain implements IBeaconChain {
|
|
|
879
911
|
blockRootHex: string,
|
|
880
912
|
indices: number[]
|
|
881
913
|
): Promise<(Uint8Array | undefined)[]> {
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
914
|
+
const fork = this.config.getForkName(blockSlot);
|
|
915
|
+
|
|
916
|
+
if (isForkPostGloas(fork)) {
|
|
917
|
+
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
918
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
919
|
+
if (payloadInput) {
|
|
920
|
+
return indices.map((index) => {
|
|
921
|
+
const sidecar = payloadInput.getColumn(index);
|
|
922
|
+
if (!sidecar) {
|
|
923
|
+
return undefined;
|
|
924
|
+
}
|
|
925
|
+
const serialized = this.serializedCache.get(sidecar);
|
|
926
|
+
if (serialized) {
|
|
927
|
+
return serialized;
|
|
928
|
+
}
|
|
929
|
+
return sszTypesFor(fork as ForkPostGloas).DataColumnSidecar.serialize(sidecar);
|
|
930
|
+
});
|
|
886
931
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
if (serialized) {
|
|
894
|
-
return serialized;
|
|
932
|
+
} else {
|
|
933
|
+
// Before gloas, columns are tracked in BlockInput
|
|
934
|
+
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
935
|
+
if (blockInput) {
|
|
936
|
+
if (!isBlockInputColumns(blockInput)) {
|
|
937
|
+
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
895
938
|
}
|
|
896
|
-
return
|
|
897
|
-
|
|
939
|
+
return indices.map((index) => {
|
|
940
|
+
const sidecar = blockInput.getColumn(index);
|
|
941
|
+
if (!sidecar) {
|
|
942
|
+
return undefined;
|
|
943
|
+
}
|
|
944
|
+
const serialized = this.serializedCache.get(sidecar);
|
|
945
|
+
if (serialized) {
|
|
946
|
+
return serialized;
|
|
947
|
+
}
|
|
948
|
+
return sszTypesFor(blockInput.forkName as ForkPostFulu).DataColumnSidecar.serialize(sidecar);
|
|
949
|
+
});
|
|
950
|
+
}
|
|
898
951
|
}
|
|
952
|
+
|
|
899
953
|
const sidecarsUnfinalized = await this.db.dataColumnSidecar.getManyBinary(fromHex(blockRootHex), indices);
|
|
900
954
|
if (sidecarsUnfinalized.some((sidecar) => sidecar != null)) {
|
|
901
955
|
return sidecarsUnfinalized;
|
|
@@ -952,14 +1006,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
952
1006
|
consensusBlockValue: Wei;
|
|
953
1007
|
shouldOverrideBuilder?: boolean;
|
|
954
1008
|
}> {
|
|
955
|
-
const fork = this.config.getForkName(slot);
|
|
956
1009
|
const state = await this.regen.getBlockSlotState(
|
|
957
1010
|
parentBlock,
|
|
958
1011
|
slot,
|
|
959
1012
|
{dontTransferCache: true},
|
|
960
1013
|
RegenCaller.produceBlock
|
|
961
1014
|
);
|
|
962
|
-
const proposerIndex = state.
|
|
1015
|
+
const proposerIndex = state.getBeaconProposer(slot);
|
|
963
1016
|
const proposerPubKey = this.pubkeyCache.getOrThrow(proposerIndex).toBytes();
|
|
964
1017
|
|
|
965
1018
|
const {body, produceResult, executionPayloadValue, shouldOverrideBuilder} = await produceBlockBody.call(
|
|
@@ -981,7 +1034,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
981
1034
|
// The hashtree root computed here for debug log will get cached and hence won't introduce additional delays
|
|
982
1035
|
const bodyRoot =
|
|
983
1036
|
produceResult.type === BlockType.Full
|
|
984
|
-
?
|
|
1037
|
+
? this.config.getForkTypes(slot).BeaconBlockBody.hashTreeRoot(body)
|
|
985
1038
|
: this.config
|
|
986
1039
|
.getPostBellatrixForkTypes(slot)
|
|
987
1040
|
.BlindedBeaconBlockBody.hashTreeRoot(body as BlindedBeaconBlockBody);
|
|
@@ -1003,10 +1056,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1003
1056
|
block.stateRoot = newStateRoot;
|
|
1004
1057
|
const blockRoot =
|
|
1005
1058
|
produceResult.type === BlockType.Full
|
|
1006
|
-
?
|
|
1059
|
+
? this.config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block)
|
|
1007
1060
|
: this.config.getPostBellatrixForkTypes(slot).BlindedBeaconBlock.hashTreeRoot(block as BlindedBeaconBlock);
|
|
1008
1061
|
const blockRootHex = toRootHex(blockRoot);
|
|
1009
1062
|
|
|
1063
|
+
const fork = this.config.getForkName(slot);
|
|
1010
1064
|
if (isForkPostGloas(fork)) {
|
|
1011
1065
|
// TODO GLOAS: we should retire BlockType post-gloas, may need a new enum for self vs non-self built
|
|
1012
1066
|
if (produceResult.type !== BlockType.Full) {
|
|
@@ -1022,7 +1076,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1022
1076
|
slot,
|
|
1023
1077
|
stateRoot: ZERO_HASH,
|
|
1024
1078
|
};
|
|
1025
|
-
const envelopeStateRoot = computeEnvelopeStateRoot(this.metrics, postState
|
|
1079
|
+
const envelopeStateRoot = computeEnvelopeStateRoot(this.metrics, postState, envelope);
|
|
1026
1080
|
gloasResult.envelopeStateRoot = envelopeStateRoot;
|
|
1027
1081
|
}
|
|
1028
1082
|
|
|
@@ -1143,8 +1197,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1143
1197
|
* persist preState, postState and block for further investigation.
|
|
1144
1198
|
*/
|
|
1145
1199
|
async persistInvalidStateRoot(
|
|
1146
|
-
preState:
|
|
1147
|
-
postState:
|
|
1200
|
+
preState: IBeaconStateView,
|
|
1201
|
+
postState: IBeaconStateView,
|
|
1148
1202
|
block: SignedBeaconBlock
|
|
1149
1203
|
): Promise<void> {
|
|
1150
1204
|
const blockSlot = block.message.slot;
|
|
@@ -1159,13 +1213,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1159
1213
|
`${logStr}_block`
|
|
1160
1214
|
),
|
|
1161
1215
|
this.persistSszObject(
|
|
1162
|
-
`preState_slot_${preState.slot}
|
|
1216
|
+
`preState_slot_${preState.slot}_BeaconState`,
|
|
1163
1217
|
preState.serialize(),
|
|
1164
1218
|
preState.hashTreeRoot(),
|
|
1165
1219
|
`${logStr}_pre_state`
|
|
1166
1220
|
),
|
|
1167
1221
|
this.persistSszObject(
|
|
1168
|
-
`postState_slot_${postState.slot}
|
|
1222
|
+
`postState_slot_${postState.slot}_BeaconState`,
|
|
1169
1223
|
postState.serialize(),
|
|
1170
1224
|
postState.hashTreeRoot(),
|
|
1171
1225
|
`${logStr}_post_state`
|
|
@@ -1185,12 +1239,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1185
1239
|
}
|
|
1186
1240
|
}
|
|
1187
1241
|
|
|
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
1242
|
/**
|
|
1195
1243
|
* Regenerate state for attestation verification, this does not happen with default chain option of maxSkipSlots = 32 .
|
|
1196
1244
|
* However, need to handle just in case. Lodestar doesn't support multiple regen state requests for attestation verification
|
|
@@ -1208,7 +1256,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1208
1256
|
this.shufflingCache.insertPromise(attEpoch, shufflingDependentRoot);
|
|
1209
1257
|
const blockEpoch = computeEpochAtSlot(attHeadBlock.slot);
|
|
1210
1258
|
|
|
1211
|
-
let state:
|
|
1259
|
+
let state: IBeaconStateView;
|
|
1212
1260
|
if (blockEpoch < attEpoch - 1) {
|
|
1213
1261
|
// thanks to one epoch look ahead, we don't need to dial up to attEpoch
|
|
1214
1262
|
const targetSlot = computeStartSlotAtEpoch(attEpoch - 1);
|
|
@@ -1226,7 +1274,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1226
1274
|
}
|
|
1227
1275
|
// resolve the promise to unblock other calls of the same epoch and dependent root
|
|
1228
1276
|
this.shufflingCache.processState(state);
|
|
1229
|
-
return state.
|
|
1277
|
+
return state.getShufflingAtEpoch(attEpoch);
|
|
1230
1278
|
}
|
|
1231
1279
|
|
|
1232
1280
|
/**
|
|
@@ -1236,7 +1284,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1236
1284
|
*/
|
|
1237
1285
|
private justifiedBalancesGetter(
|
|
1238
1286
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1239
|
-
blockState:
|
|
1287
|
+
blockState: IBeaconStateView
|
|
1240
1288
|
): EffectiveBalanceIncrements {
|
|
1241
1289
|
this.metrics?.balancesCache.requests.inc();
|
|
1242
1290
|
|
|
@@ -1263,7 +1311,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1263
1311
|
});
|
|
1264
1312
|
}
|
|
1265
1313
|
|
|
1266
|
-
return getEffectiveBalanceIncrementsZeroInactive(
|
|
1314
|
+
return state.getEffectiveBalanceIncrementsZeroInactive();
|
|
1267
1315
|
}
|
|
1268
1316
|
|
|
1269
1317
|
/**
|
|
@@ -1275,8 +1323,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1275
1323
|
*/
|
|
1276
1324
|
private closestJustifiedBalancesStateToCheckpoint(
|
|
1277
1325
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1278
|
-
blockState:
|
|
1279
|
-
): {state:
|
|
1326
|
+
blockState: IBeaconStateView
|
|
1327
|
+
): {state: IBeaconStateView; stateId: string; shouldWarn: boolean} {
|
|
1280
1328
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
1281
1329
|
const state = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
1282
1330
|
if (state) {
|
|
@@ -1359,10 +1407,9 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1359
1407
|
const fork = this.config.getForkName(headState.slot);
|
|
1360
1408
|
|
|
1361
1409
|
if (isForkPostElectra(fork)) {
|
|
1362
|
-
|
|
1363
|
-
metrics.
|
|
1364
|
-
metrics.
|
|
1365
|
-
metrics.pendingConsolidations.set(headStateElectra.pendingConsolidations.length);
|
|
1410
|
+
metrics.pendingDeposits.set(headState.pendingDepositsCount);
|
|
1411
|
+
metrics.pendingPartialWithdrawals.set(headState.pendingPartialWithdrawalsCount);
|
|
1412
|
+
metrics.pendingConsolidations.set(headState.pendingConsolidationsCount);
|
|
1366
1413
|
}
|
|
1367
1414
|
}
|
|
1368
1415
|
|
|
@@ -1426,7 +1473,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1426
1473
|
this.logger.verbose("Fork choice justified", {epoch: cp.epoch, root: cp.rootHex});
|
|
1427
1474
|
}
|
|
1428
1475
|
|
|
1429
|
-
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state:
|
|
1476
|
+
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state: IBeaconStateView): void {
|
|
1430
1477
|
// Defer to not block other checkpoint event handlers, which can cause lightclient update delays
|
|
1431
1478
|
callInNextEventLoop(() => {
|
|
1432
1479
|
this.shufflingCache.processState(state);
|
|
@@ -1512,7 +1559,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1512
1559
|
if (stateOrBytes instanceof Uint8Array) {
|
|
1513
1560
|
effectiveBalances = getEffectiveBalancesFromStateBytes(this.config, stateOrBytes, validatorIndices);
|
|
1514
1561
|
} else {
|
|
1515
|
-
effectiveBalances = validatorIndices.map((index) => stateOrBytes.
|
|
1562
|
+
effectiveBalances = validatorIndices.map((index) => stateOrBytes.getValidator(index).effectiveBalance ?? 0);
|
|
1516
1563
|
}
|
|
1517
1564
|
}
|
|
1518
1565
|
|
|
@@ -1562,11 +1609,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1562
1609
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1563
1610
|
}
|
|
1564
1611
|
|
|
1565
|
-
preState = processSlots(
|
|
1612
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1566
1613
|
|
|
1567
1614
|
const proposerRewards = this.regen.getStateSync(toRootHex(block.stateRoot))?.proposerRewards ?? undefined;
|
|
1568
1615
|
|
|
1569
|
-
return computeBlockRewards(
|
|
1616
|
+
return preState.computeBlockRewards(block, proposerRewards);
|
|
1570
1617
|
}
|
|
1571
1618
|
|
|
1572
1619
|
async getAttestationsRewards(
|
|
@@ -1590,7 +1637,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1590
1637
|
throw Error(`State is not in cache for slot ${slot}`);
|
|
1591
1638
|
}
|
|
1592
1639
|
|
|
1593
|
-
const rewards = await computeAttestationsRewards(
|
|
1640
|
+
const rewards = await cachedState.computeAttestationsRewards(validatorIds);
|
|
1594
1641
|
|
|
1595
1642
|
return {rewards, executionOptimistic, finalized};
|
|
1596
1643
|
}
|
|
@@ -1605,8 +1652,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1605
1652
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1606
1653
|
}
|
|
1607
1654
|
|
|
1608
|
-
preState = processSlots(
|
|
1655
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1609
1656
|
|
|
1610
|
-
return computeSyncCommitteeRewards(
|
|
1657
|
+
return preState.computeSyncCommitteeRewards(block, validatorIds ?? []);
|
|
1611
1658
|
}
|
|
1612
1659
|
}
|