@lodestar/beacon-node 1.42.0-dev.7b5ce3932d → 1.42.0-dev.7bdb87e586
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +25 -13
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +5 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +38 -40
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +8 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +33 -27
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -3
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +5 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +37 -23
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -8
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +87 -51
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +3 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.d.ts +21 -15
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +2 -2
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +4 -4
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +5 -5
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +5 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +4 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +15 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +110 -62
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +31 -9
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +12 -3
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +4 -4
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +30 -24
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +2 -2
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +15 -14
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +11 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +13 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +10 -4
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +3 -4
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +21 -16
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +13 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +14 -14
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +6 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +6 -6
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +14 -14
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +3 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +185 -6
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +10 -7
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +5 -3
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +5 -3
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +17 -12
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +5 -2
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +3 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +11 -9
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/buckets.d.ts +2 -2
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js +4 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +32 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +52 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/interface.d.ts +7 -4
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +22 -11
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +7 -4
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +12 -3
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +7 -2
- package/lib/network/options.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +25 -5
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +269 -80
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +22 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +313 -80
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +9 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +10 -4
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +16 -4
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +3 -3
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +2 -2
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -2
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +10 -43
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +3 -3
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +4 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +3 -3
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +10 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +3 -3
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +21 -10
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/dataColumns.d.ts +18 -11
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +51 -17
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +6 -2
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +49 -25
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +25 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +189 -2
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +33 -16
- package/src/api/impl/beacon/pool/index.ts +5 -1
- package/src/api/impl/beacon/state/index.ts +43 -55
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +8 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +36 -41
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -4
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +5 -4
- package/src/chain/blocks/importBlock.ts +50 -31
- package/src/chain/blocks/importExecutionPayload.ts +98 -62
- package/src/chain/blocks/index.ts +3 -2
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/types.ts +26 -15
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +10 -14
- package/src/chain/blocks/verifyBlocksSignatures.ts +10 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +148 -95
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/forkChoice/index.ts +35 -41
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +16 -15
- package/src/chain/lightClient/index.ts +17 -18
- package/src/chain/opPools/aggregatedAttestationPool.ts +20 -21
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +14 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +7 -10
- package/src/chain/produceBlock/produceBlockBody.ts +38 -45
- package/src/chain/regen/interface.ts +13 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
- package/src/chain/serializeState.ts +3 -3
- package/src/chain/shufflingCache.ts +5 -7
- package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
- package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
- package/src/chain/stateCache/types.ts +14 -18
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +3 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +10 -10
- package/src/chain/validation/executionPayloadEnvelope.ts +5 -4
- package/src/chain/validation/payloadAttestationMessage.ts +6 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +25 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +9 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +15 -13
- package/src/db/buckets.ts +2 -2
- package/src/db/repositories/dataColumnSidecar.ts +4 -2
- package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
- package/src/metrics/metrics/lodestar.ts +57 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +18 -4
- package/src/network/libp2p/index.ts +24 -13
- package/src/network/network.ts +39 -8
- package/src/network/options.ts +7 -2
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +334 -94
- package/src/network/processor/index.ts +395 -92
- package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +26 -5
- package/src/node/nodejs.ts +6 -5
- package/src/node/notifier.ts +5 -6
- package/src/sync/backfill/backfill.ts +3 -3
- package/src/sync/unknownBlock.ts +13 -53
- package/src/sync/utils/downloadByRange.ts +9 -7
- package/src/sync/utils/downloadByRoot.ts +16 -12
- package/src/util/blobs.ts +35 -15
- package/src/util/dataColumns.ts +69 -25
- package/src/util/execution.ts +49 -30
- package/src/util/sszBytes.ts +245 -3
- package/src/util/types.ts +6 -0
|
@@ -3,6 +3,7 @@ import {Logger, sleep} from "@lodestar/utils";
|
|
|
3
3
|
import {Metrics} from "../metrics/metrics.js";
|
|
4
4
|
import {DataColumnReconstructionCode, recoverDataColumnSidecars} from "../util/dataColumns.js";
|
|
5
5
|
import {BlockInputColumns} from "./blocks/blockInput/index.js";
|
|
6
|
+
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
6
7
|
import {ChainEventEmitter} from "./emitter.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -53,25 +54,25 @@ export class ColumnReconstructionTracker {
|
|
|
53
54
|
this.maxDelayMs = this.config.getSlotComponentDurationMs(RECONSTRUCTION_DELAY_MAX_BPS);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
triggerColumnReconstruction(
|
|
57
|
+
triggerColumnReconstruction(input: BlockInputColumns | PayloadEnvelopeInput): void {
|
|
57
58
|
if (this.running) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
if (this.lastBlockRootHex ===
|
|
62
|
+
if (this.lastBlockRootHex === input.blockRootHex) {
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
// We don't care about the outcome of this call,
|
|
66
67
|
// just that it has been triggered for this block root.
|
|
67
68
|
this.running = true;
|
|
68
|
-
this.lastBlockRootHex =
|
|
69
|
+
this.lastBlockRootHex = input.blockRootHex;
|
|
69
70
|
const delay = this.minDelayMs + Math.random() * (this.maxDelayMs - this.minDelayMs);
|
|
70
71
|
sleep(delay)
|
|
71
72
|
.then(() => {
|
|
72
|
-
const logCtx = {slot:
|
|
73
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
73
74
|
this.logger.debug("Attempting data column sidecar reconstruction", logCtx);
|
|
74
|
-
recoverDataColumnSidecars(
|
|
75
|
+
recoverDataColumnSidecars(input, this.emitter, this.metrics)
|
|
75
76
|
.then((result) => {
|
|
76
77
|
this.metrics?.recoverDataColumnSidecars.reconstructionResult.inc({result});
|
|
77
78
|
this.logger.debug("Data column sidecar reconstruction complete", {...logCtx, result});
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
getDataColumnSidecarsFromExecution,
|
|
12
12
|
} from "../util/execution.js";
|
|
13
13
|
import {IBlockInput, isBlockInputBlobs} from "./blocks/blockInput/index.js";
|
|
14
|
+
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
14
15
|
import {ChainEventEmitter} from "./emitter.js";
|
|
15
16
|
|
|
16
17
|
export type GetBlobsTrackerInit = {
|
|
@@ -43,22 +44,22 @@ export class GetBlobsTracker {
|
|
|
43
44
|
this.config = init.config;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
triggerGetBlobs(
|
|
47
|
-
if (this.activeReconstructions.has(
|
|
47
|
+
triggerGetBlobs(input: IBlockInput | PayloadEnvelopeInput, onComplete?: () => void): void {
|
|
48
|
+
if (this.activeReconstructions.has(input.blockRootHex)) {
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
if (isBlockInputBlobs(
|
|
52
|
+
if (!(input instanceof PayloadEnvelopeInput) && isBlockInputBlobs(input)) {
|
|
52
53
|
// there is not preallocation for blob sidecars like there is for columns sidecars so no need to
|
|
53
54
|
// store the index for the preallocated buffers
|
|
54
|
-
this.activeReconstructions.add(
|
|
55
|
+
this.activeReconstructions.add(input.blockRootHex);
|
|
55
56
|
callInNextEventLoop(() => {
|
|
56
|
-
const logCtx = {slot:
|
|
57
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
57
58
|
this.logger.verbose("Trigger getBlobsV1 for block", logCtx);
|
|
58
|
-
getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter,
|
|
59
|
+
getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter, input).finally(
|
|
59
60
|
() => {
|
|
60
61
|
this.logger.verbose("Completed getBlobsV1 for block", logCtx);
|
|
61
|
-
this.activeReconstructions.delete(
|
|
62
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
62
63
|
}
|
|
63
64
|
);
|
|
64
65
|
});
|
|
@@ -72,7 +73,7 @@ export class GetBlobsTracker {
|
|
|
72
73
|
this.blobsAndProofsBuffers[freeIndex] = {inUse: false, buffers: []};
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
const maxBlobs = this.config.getMaxBlobsPerBlock(computeEpochAtSlot(
|
|
76
|
+
const maxBlobs = this.config.getMaxBlobsPerBlock(computeEpochAtSlot(input.slot));
|
|
76
77
|
// double check that there is enough pre-allocated space (blob schedule may have changed since the last use)
|
|
77
78
|
const timer = this.metrics?.peerDas.getBlobsV2PreAllocationTime.startTimer();
|
|
78
79
|
for (let i = 0; i < maxBlobs; i++) {
|
|
@@ -84,22 +85,23 @@ export class GetBlobsTracker {
|
|
|
84
85
|
|
|
85
86
|
// We don't care about the outcome of this call,
|
|
86
87
|
// just that it has been triggered for this block root.
|
|
87
|
-
this.activeReconstructions.add(
|
|
88
|
+
this.activeReconstructions.add(input.blockRootHex);
|
|
88
89
|
this.blobsAndProofsBuffers[freeIndex].inUse = true;
|
|
89
90
|
callInNextEventLoop(() => {
|
|
90
|
-
const logCtx = {slot:
|
|
91
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
91
92
|
this.logger.verbose("Trigger getBlobsV2 for block", logCtx);
|
|
92
93
|
getDataColumnSidecarsFromExecution(
|
|
93
94
|
this.config,
|
|
94
95
|
this.executionEngine,
|
|
95
96
|
this.emitter,
|
|
96
|
-
|
|
97
|
+
input,
|
|
97
98
|
this.metrics,
|
|
98
99
|
this.blobsAndProofsBuffers[freeIndex].buffers
|
|
99
100
|
)
|
|
100
101
|
.then((result) => {
|
|
101
102
|
this.logger.debug("getBlobsV2 result for block", {...logCtx, result});
|
|
102
103
|
this.metrics?.dataColumns.dataColumnEngineResult.inc({result});
|
|
104
|
+
onComplete?.();
|
|
103
105
|
})
|
|
104
106
|
.catch((error) => {
|
|
105
107
|
this.logger.debug("Error during getBlobsV2 for block", logCtx, error as Error);
|
|
@@ -107,7 +109,7 @@ export class GetBlobsTracker {
|
|
|
107
109
|
})
|
|
108
110
|
.finally(() => {
|
|
109
111
|
this.logger.verbose("Completed getBlobsV2 for block", logCtx);
|
|
110
|
-
this.activeReconstructions.delete(
|
|
112
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
111
113
|
this.blobsAndProofsBuffers[freeIndex].inUse = false;
|
|
112
114
|
});
|
|
113
115
|
});
|
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {
|
|
3
|
-
BeaconStateAllForks,
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
3
|
DataAvailabilityStatus,
|
|
6
4
|
ExecutionPayloadStatus,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
stateTransition,
|
|
5
|
+
IBeaconStateView,
|
|
6
|
+
createBeaconStateViewForHistoricalRegen,
|
|
10
7
|
} from "@lodestar/state-transition";
|
|
11
8
|
import {byteArrayEquals} from "@lodestar/utils";
|
|
12
9
|
import {IBeaconDb} from "../../../db/index.js";
|
|
13
|
-
import {getStateTypeFromBytes} from "../../../util/multifork.js";
|
|
14
10
|
import {HistoricalStateRegenMetrics} from "./metrics.js";
|
|
15
11
|
import {RegenErrorType} from "./types.js";
|
|
16
12
|
|
|
17
|
-
/**
|
|
18
|
-
* Populate a PubkeyCache with any new entries based on a BeaconState
|
|
19
|
-
*/
|
|
20
|
-
export function syncPubkeyCache(state: BeaconStateAllForks, pubkeyCache: PubkeyCache): void {
|
|
21
|
-
// Get the validators sub tree once for all the loop
|
|
22
|
-
const validators = state.validators;
|
|
23
|
-
|
|
24
|
-
const newCount = state.validators.length;
|
|
25
|
-
for (let i = pubkeyCache.size; i < newCount; i++) {
|
|
26
|
-
const pubkey = validators.getReadonly(i).pubkey;
|
|
27
|
-
pubkeyCache.set(i, pubkey);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
13
|
/**
|
|
32
14
|
* Get the nearest BeaconState at or before a slot
|
|
33
15
|
*/
|
|
@@ -35,27 +17,17 @@ export async function getNearestState(
|
|
|
35
17
|
slot: number,
|
|
36
18
|
config: BeaconConfig,
|
|
37
19
|
db: IBeaconDb,
|
|
38
|
-
|
|
39
|
-
): Promise<
|
|
20
|
+
nativeStateView: boolean
|
|
21
|
+
): Promise<IBeaconStateView> {
|
|
40
22
|
const stateBytesArr = await db.stateArchive.binaries({limit: 1, lte: slot, reverse: true});
|
|
41
23
|
if (!stateBytesArr.length) {
|
|
42
24
|
throw new Error("No near state found in the database");
|
|
43
25
|
}
|
|
44
26
|
|
|
45
27
|
const stateBytes = stateBytesArr[0];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return createCachedBeaconState(
|
|
50
|
-
state,
|
|
51
|
-
{
|
|
52
|
-
config,
|
|
53
|
-
pubkeyCache,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
skipSyncPubkeys: true,
|
|
57
|
-
}
|
|
58
|
-
);
|
|
28
|
+
return nativeStateView
|
|
29
|
+
? createBeaconStateViewForHistoricalRegen({useNative: true, stateBytes})
|
|
30
|
+
: createBeaconStateViewForHistoricalRegen({useNative: false, config, stateBytes});
|
|
59
31
|
}
|
|
60
32
|
|
|
61
33
|
/**
|
|
@@ -65,13 +37,13 @@ export async function getHistoricalState(
|
|
|
65
37
|
slot: number,
|
|
66
38
|
config: BeaconConfig,
|
|
67
39
|
db: IBeaconDb,
|
|
68
|
-
|
|
40
|
+
nativeStateView: boolean,
|
|
69
41
|
metrics?: HistoricalStateRegenMetrics
|
|
70
42
|
): Promise<Uint8Array> {
|
|
71
43
|
const regenTimer = metrics?.regenTime.startTimer();
|
|
72
44
|
|
|
73
45
|
const loadStateTimer = metrics?.loadStateTime.startTimer();
|
|
74
|
-
let state = await getNearestState(slot, config, db,
|
|
46
|
+
let state = await getNearestState(slot, config, db, nativeStateView).catch((e) => {
|
|
75
47
|
metrics?.regenErrorCount.inc({reason: RegenErrorType.loadState});
|
|
76
48
|
throw e;
|
|
77
49
|
});
|
|
@@ -81,8 +53,7 @@ export async function getHistoricalState(
|
|
|
81
53
|
let blockCount = 0;
|
|
82
54
|
for await (const block of db.blockArchive.valuesStream({gt: state.slot, lte: slot})) {
|
|
83
55
|
try {
|
|
84
|
-
state = stateTransition(
|
|
85
|
-
state,
|
|
56
|
+
state = state.stateTransition(
|
|
86
57
|
block,
|
|
87
58
|
{
|
|
88
59
|
verifyProposer: false,
|
|
@@ -20,7 +20,7 @@ export class HistoricalStateRegen implements HistoricalStateWorkerApi {
|
|
|
20
20
|
private readonly api: ModuleThread<HistoricalStateWorkerApi>;
|
|
21
21
|
private readonly logger: LoggerNode;
|
|
22
22
|
|
|
23
|
-
constructor(modules: HistoricalStateRegenModules) {
|
|
23
|
+
private constructor(modules: HistoricalStateRegenModules) {
|
|
24
24
|
this.api = modules.api;
|
|
25
25
|
this.logger = modules.logger;
|
|
26
26
|
modules.signal?.addEventListener("abort", () => this.close(), {once: true});
|
|
@@ -35,6 +35,7 @@ export class HistoricalStateRegen implements HistoricalStateWorkerApi {
|
|
|
35
35
|
dbLocation: modules.opts.dbLocation,
|
|
36
36
|
metricsEnabled: Boolean(modules.metrics),
|
|
37
37
|
loggerOpts: modules.logger.toOpts(),
|
|
38
|
+
nativeStateView: modules.opts.nativeStateView,
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
const worker = new Worker(path.join(WORKER_DIR, "worker.js"), {
|
|
@@ -7,6 +7,7 @@ export type HistoricalStateRegenInitModules = {
|
|
|
7
7
|
opts: {
|
|
8
8
|
genesisTime: number;
|
|
9
9
|
dbLocation: string;
|
|
10
|
+
nativeStateView: boolean;
|
|
10
11
|
};
|
|
11
12
|
config: BeaconConfig;
|
|
12
13
|
logger: LoggerNode;
|
|
@@ -26,6 +27,7 @@ export type HistoricalStateWorkerData = {
|
|
|
26
27
|
dbLocation: string;
|
|
27
28
|
metricsEnabled: boolean;
|
|
28
29
|
loggerOpts: LoggerNodeOpts;
|
|
30
|
+
nativeStateView: boolean;
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export type HistoricalStateWorkerApi = {
|
|
@@ -3,7 +3,6 @@ import {Transfer, expose} from "@chainsafe/threads/worker";
|
|
|
3
3
|
import {chainConfigFromJson, createBeaconConfig} from "@lodestar/config";
|
|
4
4
|
import {LevelDbController} from "@lodestar/db/controller/level";
|
|
5
5
|
import {getNodeLogger} from "@lodestar/logger/node";
|
|
6
|
-
import {createPubkeyCache} from "@lodestar/state-transition";
|
|
7
6
|
import {BeaconDb} from "../../../db/index.js";
|
|
8
7
|
import {RegistryMetricCreator, collectNodeJSMetrics} from "../../../metrics/index.js";
|
|
9
8
|
import {JobFnQueue} from "../../../util/queue/fnQueue.js";
|
|
@@ -52,8 +51,6 @@ const queue = new JobFnQueue(
|
|
|
52
51
|
queueMetrics
|
|
53
52
|
);
|
|
54
53
|
|
|
55
|
-
const pubkeyCache = createPubkeyCache();
|
|
56
|
-
|
|
57
54
|
const api: HistoricalStateWorkerApi = {
|
|
58
55
|
async close() {
|
|
59
56
|
abortController.abort();
|
|
@@ -65,7 +62,7 @@ const api: HistoricalStateWorkerApi = {
|
|
|
65
62
|
historicalStateRegenMetrics?.regenRequestCount.inc();
|
|
66
63
|
|
|
67
64
|
const stateBytes = await queue.push<Uint8Array>(() =>
|
|
68
|
-
getHistoricalState(slot, config, db,
|
|
65
|
+
getHistoricalState(slot, config, db, workerData.nativeStateView, historicalStateRegenMetrics)
|
|
69
66
|
);
|
|
70
67
|
const result = Transfer(stateBytes, [stateBytes.buffer]) as unknown as Uint8Array;
|
|
71
68
|
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
2
|
-
import {
|
|
3
|
-
CachedBeaconStateAllForks,
|
|
4
|
-
EffectiveBalanceIncrements,
|
|
5
|
-
computeStartSlotAtEpoch,
|
|
6
|
-
getBlockRootAtSlot,
|
|
7
|
-
getEffectiveBalanceIncrementsZeroInactive,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
2
|
+
import {EffectiveBalanceIncrements, IBeaconStateView, computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
9
3
|
import {Epoch, RootHex} from "@lodestar/types";
|
|
10
4
|
import {toRootHex} from "@lodestar/utils";
|
|
11
5
|
|
|
@@ -29,11 +23,11 @@ export class CheckpointBalancesCache {
|
|
|
29
23
|
* `state.current_epoch`. If there is not already some entry for the given block root, then
|
|
30
24
|
* add the effective balances from the `state` to the cache.
|
|
31
25
|
*/
|
|
32
|
-
processState(blockRootHex: RootHex, state:
|
|
33
|
-
const epoch = state.
|
|
26
|
+
processState(blockRootHex: RootHex, state: IBeaconStateView): void {
|
|
27
|
+
const epoch = state.epoch;
|
|
34
28
|
const epochBoundarySlot = computeStartSlotAtEpoch(epoch);
|
|
35
29
|
const epochBoundaryRoot =
|
|
36
|
-
epochBoundarySlot === state.slot ? blockRootHex : toRootHex(getBlockRootAtSlot(
|
|
30
|
+
epochBoundarySlot === state.slot ? blockRootHex : toRootHex(state.getBlockRootAtSlot(epochBoundarySlot));
|
|
37
31
|
|
|
38
32
|
const index = this.items.findIndex((item) => item.epoch === epoch && item.rootHex === epochBoundaryRoot);
|
|
39
33
|
if (index === -1) {
|
|
@@ -41,7 +35,7 @@ export class CheckpointBalancesCache {
|
|
|
41
35
|
this.items.shift();
|
|
42
36
|
}
|
|
43
37
|
// expect to reach this once per epoch
|
|
44
|
-
this.items.push({epoch, rootHex: epochBoundaryRoot, balances: getEffectiveBalanceIncrementsZeroInactive(
|
|
38
|
+
this.items.push({epoch, rootHex: epochBoundaryRoot, balances: state.getEffectiveBalanceIncrementsZeroInactive()});
|
|
45
39
|
}
|
|
46
40
|
}
|
|
47
41
|
|
|
@@ -617,7 +617,7 @@ type BlockInputColumnsState =
|
|
|
617
617
|
* - The block is not yet seen and all required sampled columns are seen
|
|
618
618
|
* - The block is not yet seen and all required sampled columns are not yet seen
|
|
619
619
|
*/
|
|
620
|
-
export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.
|
|
620
|
+
export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.DataColumnSidecar[]> {
|
|
621
621
|
type = DAType.Columns as const;
|
|
622
622
|
|
|
623
623
|
state: BlockInputColumnsState;
|
|
@@ -630,7 +630,7 @@ export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.Da
|
|
|
630
630
|
*
|
|
631
631
|
* This is different from `dataPromise` which resolves when all data is available or could become available (e.g. through reconstruction)
|
|
632
632
|
*/
|
|
633
|
-
protected computedDataPromise = createPromise<fulu.
|
|
633
|
+
protected computedDataPromise = createPromise<fulu.DataColumnSidecar[]>();
|
|
634
634
|
|
|
635
635
|
private constructor(
|
|
636
636
|
init: BlockInputInit,
|
|
@@ -854,8 +854,8 @@ export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.Da
|
|
|
854
854
|
return this.state.versionedHashes;
|
|
855
855
|
}
|
|
856
856
|
|
|
857
|
-
getCustodyColumns(): fulu.
|
|
858
|
-
const columns: fulu.
|
|
857
|
+
getCustodyColumns(): fulu.DataColumnSidecar[] {
|
|
858
|
+
const columns: fulu.DataColumnSidecar[] = [];
|
|
859
859
|
for (const index of this.custodyColumns) {
|
|
860
860
|
const column = this.columnsCache.get(index);
|
|
861
861
|
if (column) {
|
|
@@ -876,8 +876,8 @@ export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.Da
|
|
|
876
876
|
return columns;
|
|
877
877
|
}
|
|
878
878
|
|
|
879
|
-
getSampledColumns(): fulu.
|
|
880
|
-
const columns: fulu.
|
|
879
|
+
getSampledColumns(): fulu.DataColumnSidecar[] {
|
|
880
|
+
const columns: fulu.DataColumnSidecar[] = [];
|
|
881
881
|
for (const index of this.sampledColumns) {
|
|
882
882
|
const column = this.columnsCache.get(index);
|
|
883
883
|
if (column) {
|
|
@@ -891,7 +891,7 @@ export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.Da
|
|
|
891
891
|
return [...this.columnsCache.values()];
|
|
892
892
|
}
|
|
893
893
|
|
|
894
|
-
getAllColumns(): fulu.
|
|
894
|
+
getAllColumns(): fulu.DataColumnSidecar[] {
|
|
895
895
|
return this.getAllColumnsWithSource().map(({columnSidecar}) => columnSidecar);
|
|
896
896
|
}
|
|
897
897
|
|
|
@@ -919,7 +919,7 @@ export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.Da
|
|
|
919
919
|
return this.state.hasComputedAllData;
|
|
920
920
|
}
|
|
921
921
|
|
|
922
|
-
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<fulu.
|
|
922
|
+
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<fulu.DataColumnSidecar[]> {
|
|
923
923
|
if (!this.state.hasComputedAllData) {
|
|
924
924
|
return withTimeout(() => this.computedDataPromise.promise, timeout, signal);
|
|
925
925
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForkName} from "@lodestar/params";
|
|
2
|
-
import {ColumnIndex,
|
|
2
|
+
import {ColumnIndex, DataColumnSidecar, RootHex, SignedBeaconBlock, Slot, deneb, fulu} from "@lodestar/types";
|
|
3
3
|
import {VersionedHashes} from "../../../execution/index.js";
|
|
4
4
|
|
|
5
5
|
export enum DAType {
|
|
@@ -9,13 +9,14 @@ export enum DAType {
|
|
|
9
9
|
NoData = "no-data",
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export type DAData = null | deneb.BlobSidecars | fulu.
|
|
12
|
+
export type DAData = null | deneb.BlobSidecars | fulu.DataColumnSidecar[];
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Represents were input originated. Blocks and Data can come from different
|
|
16
16
|
* sources so each should be labelled individually.
|
|
17
17
|
*/
|
|
18
18
|
export enum BlockInputSource {
|
|
19
|
+
network_processor = "network_processor",
|
|
19
20
|
gossip = "gossip",
|
|
20
21
|
api = "api",
|
|
21
22
|
engine = "engine",
|
|
@@ -107,9 +108,9 @@ export type MissingColumnMeta = {
|
|
|
107
108
|
export interface IDataColumnsInput {
|
|
108
109
|
readonly slot: Slot;
|
|
109
110
|
readonly blockRootHex: string;
|
|
110
|
-
getCustodyColumns():
|
|
111
|
+
getCustodyColumns(): DataColumnSidecar[];
|
|
111
112
|
hasComputedAllData(): boolean;
|
|
112
|
-
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<
|
|
113
|
+
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<DataColumnSidecar[]>;
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
/**
|
|
@@ -3,6 +3,7 @@ import {routes} from "@lodestar/api";
|
|
|
3
3
|
import {
|
|
4
4
|
AncestorStatus,
|
|
5
5
|
EpochDifference,
|
|
6
|
+
ExecutionStatus,
|
|
6
7
|
ForkChoiceError,
|
|
7
8
|
ForkChoiceErrorCode,
|
|
8
9
|
NotReorgedReason,
|
|
@@ -18,15 +19,14 @@ import {
|
|
|
18
19
|
SLOTS_PER_EPOCH,
|
|
19
20
|
} from "@lodestar/params";
|
|
20
21
|
import {
|
|
21
|
-
|
|
22
|
-
EpochCache,
|
|
22
|
+
IBeaconStateView,
|
|
23
23
|
RootCache,
|
|
24
24
|
computeEpochAtSlot,
|
|
25
25
|
computeStartSlotAtEpoch,
|
|
26
26
|
computeTimeAtSlot,
|
|
27
|
-
isExecutionStateType,
|
|
28
27
|
isStartSlotOfEpoch,
|
|
29
|
-
|
|
28
|
+
isStatePostAltair,
|
|
29
|
+
isStatePostBellatrix,
|
|
30
30
|
} from "@lodestar/state-transition";
|
|
31
31
|
import {
|
|
32
32
|
Attestation,
|
|
@@ -87,7 +87,7 @@ export async function importBlock(
|
|
|
87
87
|
fullyVerifiedBlock: FullyVerifiedBlock,
|
|
88
88
|
opts: ImportBlockOpts
|
|
89
89
|
): Promise<void> {
|
|
90
|
-
const {blockInput,
|
|
90
|
+
const {blockInput, postBlockState, parentBlockSlot, executionStatus, dataAvailabilityStatus, indexedAttestations} =
|
|
91
91
|
fullyVerifiedBlock;
|
|
92
92
|
const block = blockInput.getBlock();
|
|
93
93
|
const source = blockInput.getBlockSource();
|
|
@@ -99,7 +99,7 @@ export async function importBlock(
|
|
|
99
99
|
const blockEpoch = computeEpochAtSlot(blockSlot);
|
|
100
100
|
const prevFinalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
101
101
|
const blockDelaySec =
|
|
102
|
-
fullyVerifiedBlock.seenTimestampSec - computeTimeAtSlot(this.config, blockSlot,
|
|
102
|
+
fullyVerifiedBlock.seenTimestampSec - computeTimeAtSlot(this.config, blockSlot, postBlockState.genesisTime);
|
|
103
103
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
104
104
|
const fork = this.config.getForkSeq(blockSlot);
|
|
105
105
|
|
|
@@ -122,13 +122,13 @@ export async function importBlock(
|
|
|
122
122
|
// 2. Import block to fork choice
|
|
123
123
|
|
|
124
124
|
// Should compute checkpoint balances before forkchoice.onBlock
|
|
125
|
-
this.checkpointBalancesCache.processState(blockRootHex,
|
|
125
|
+
this.checkpointBalancesCache.processState(blockRootHex, postBlockState);
|
|
126
126
|
const blockSummary = this.forkChoice.onBlock(
|
|
127
127
|
block.message,
|
|
128
|
-
|
|
128
|
+
postBlockState,
|
|
129
129
|
blockDelaySec,
|
|
130
130
|
currentSlot,
|
|
131
|
-
executionStatus,
|
|
131
|
+
fork >= ForkSeq.gloas ? ExecutionStatus.PayloadSeparated : executionStatus,
|
|
132
132
|
dataAvailabilityStatus
|
|
133
133
|
);
|
|
134
134
|
|
|
@@ -138,13 +138,14 @@ export async function importBlock(
|
|
|
138
138
|
// Post-Gloas: blockSummary.payloadStatus is always PENDING, so payloadPresent = false (block state only, no payload processing yet)
|
|
139
139
|
const payloadPresent = !isGloasBlock(blockSummary);
|
|
140
140
|
// processState manages both block state and payload state variants together for memory/disk management
|
|
141
|
-
this.regen.processBlockState(blockRootHex,
|
|
141
|
+
this.regen.processBlockState(blockRootHex, postBlockState);
|
|
142
142
|
|
|
143
143
|
// For Gloas blocks, create PayloadEnvelopeInput so it's available for later payload import
|
|
144
144
|
if (fork >= ForkSeq.gloas) {
|
|
145
|
-
this.seenPayloadEnvelopeInputCache.add({
|
|
145
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.add({
|
|
146
146
|
blockRootHex,
|
|
147
147
|
block: block as SignedBeaconBlock<ForkPostGloas>,
|
|
148
|
+
forkName: blockInput.forkName,
|
|
148
149
|
sampledColumns: this.custodyConfig.sampledColumns,
|
|
149
150
|
custodyColumns: this.custodyConfig.custodyColumns,
|
|
150
151
|
timeCreatedSec: fullyVerifiedBlock.seenTimestampSec,
|
|
@@ -155,6 +156,22 @@ export async function importBlock(
|
|
|
155
156
|
source: source.source,
|
|
156
157
|
...(opts.seenTimestampSec !== undefined ? {recvToImport: Date.now() / 1000 - opts.seenTimestampSec} : {}),
|
|
157
158
|
});
|
|
159
|
+
|
|
160
|
+
// Immediately attempt fetch of data columns from execution engine as the bid contains kzg commitments
|
|
161
|
+
// which is all the information we need so there is no reason to delay until execution payload arrives
|
|
162
|
+
// TODO GLOAS: If we want EL retries after this initial attempt, add an explicit retry policy here
|
|
163
|
+
// (for example later in the slot). Do not couple retries to incoming gossip columns.
|
|
164
|
+
this.getBlobsTracker.triggerGetBlobs(payloadInput, () => {
|
|
165
|
+
// TODO GLOAS: come up with a better mechanism to trigger processExecutionPayload after data becomes available,
|
|
166
|
+
// similar to how pre-gloas uses waitForBlockAndAllData with a cutoff timeout and incompleteBlockInput event
|
|
167
|
+
this.processExecutionPayload(payloadInput, {validSignature: true}).catch((e) => {
|
|
168
|
+
this.logger.debug(
|
|
169
|
+
"Error processing execution payload after getBlobs",
|
|
170
|
+
{slot: blockSlot, root: blockRootHex},
|
|
171
|
+
e as Error
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
158
175
|
}
|
|
159
176
|
|
|
160
177
|
this.metrics?.importBlock.bySource.inc({source: source.source});
|
|
@@ -174,7 +191,7 @@ export async function importBlock(
|
|
|
174
191
|
(opts.importAttestations !== AttestationImportOpt.Skip && blockEpoch >= currentEpoch - FORK_CHOICE_ATT_EPOCH_LIMIT)
|
|
175
192
|
) {
|
|
176
193
|
const attestations = block.message.body.attestations;
|
|
177
|
-
const rootCache = new RootCache(
|
|
194
|
+
const rootCache = new RootCache(postBlockState);
|
|
178
195
|
const invalidAttestationErrorsByCode = new Map<string, {error: Error; count: number}>();
|
|
179
196
|
|
|
180
197
|
const addAttestation = fork >= ForkSeq.electra ? addAttestationPostElectra : addAttestationPreElectra;
|
|
@@ -188,7 +205,7 @@ export async function importBlock(
|
|
|
188
205
|
const attDataRoot = toRootHex(ssz.phase0.AttestationData.hashTreeRoot(indexedAttestation.data));
|
|
189
206
|
addAttestation.call(
|
|
190
207
|
this,
|
|
191
|
-
|
|
208
|
+
postBlockState,
|
|
192
209
|
target,
|
|
193
210
|
attDataRoot,
|
|
194
211
|
attestation as Attestation<ForkPostElectra>,
|
|
@@ -303,7 +320,7 @@ export async function importBlock(
|
|
|
303
320
|
|
|
304
321
|
if (newHead.blockRoot !== oldHead.blockRoot) {
|
|
305
322
|
// Set head state as strong reference
|
|
306
|
-
this.regen.updateHeadState(newHead,
|
|
323
|
+
this.regen.updateHeadState(newHead, postBlockState);
|
|
307
324
|
|
|
308
325
|
try {
|
|
309
326
|
this.emitter.emit(routes.events.EventType.head, {
|
|
@@ -373,11 +390,13 @@ export async function importBlock(
|
|
|
373
390
|
// we want to import block asap so do this in the next event loop
|
|
374
391
|
callInNextEventLoop(() => {
|
|
375
392
|
try {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
393
|
+
if (isStatePostAltair(postBlockState)) {
|
|
394
|
+
this.lightClientServer?.onImportBlockHead(
|
|
395
|
+
block.message as BeaconBlock<ForkPostAltair>,
|
|
396
|
+
postBlockState,
|
|
397
|
+
parentBlockSlot
|
|
398
|
+
);
|
|
399
|
+
}
|
|
381
400
|
} catch (e) {
|
|
382
401
|
this.logger.verbose("Error lightClientServer.onImportBlock", {slot: blockSlot}, e as Error);
|
|
383
402
|
}
|
|
@@ -396,11 +415,11 @@ export async function importBlock(
|
|
|
396
415
|
// and the block is weak and can potentially be reorged out.
|
|
397
416
|
let shouldOverrideFcu = false;
|
|
398
417
|
|
|
399
|
-
if (blockSlot >= currentSlot &&
|
|
418
|
+
if (blockSlot >= currentSlot && isStatePostBellatrix(postBlockState) && postBlockState.isExecutionStateType) {
|
|
400
419
|
let notOverrideFcuReason = NotReorgedReason.Unknown;
|
|
401
420
|
const proposalSlot = blockSlot + 1;
|
|
402
421
|
try {
|
|
403
|
-
const proposerIndex =
|
|
422
|
+
const proposerIndex = postBlockState.getBeaconProposer(proposalSlot);
|
|
404
423
|
const feeRecipient = this.beaconProposerCache.get(proposerIndex);
|
|
405
424
|
|
|
406
425
|
if (feeRecipient) {
|
|
@@ -480,20 +499,20 @@ export async function importBlock(
|
|
|
480
499
|
}
|
|
481
500
|
}
|
|
482
501
|
|
|
483
|
-
if (!isStateValidatorsNodesPopulated(
|
|
484
|
-
this.logger.verbose("After importBlock caching postState without SSZ cache", {slot:
|
|
502
|
+
if (!postBlockState.isStateValidatorsNodesPopulated()) {
|
|
503
|
+
this.logger.verbose("After importBlock caching postState without SSZ cache", {slot: postBlockState.slot});
|
|
485
504
|
}
|
|
486
505
|
|
|
487
506
|
// Cache shufflings when crossing an epoch boundary
|
|
488
507
|
const parentEpoch = computeEpochAtSlot(parentBlockSlot);
|
|
489
508
|
if (parentEpoch < blockEpoch) {
|
|
490
|
-
this.shufflingCache.processState(
|
|
509
|
+
this.shufflingCache.processState(postBlockState);
|
|
491
510
|
this.logger.verbose("Processed shuffling for next epoch", {parentEpoch, blockEpoch, slot: blockSlot});
|
|
492
511
|
}
|
|
493
512
|
|
|
494
513
|
if (blockSlot % SLOTS_PER_EPOCH === 0) {
|
|
495
514
|
// Cache state to preserve epoch transition work
|
|
496
|
-
const checkpointState =
|
|
515
|
+
const checkpointState = postBlockState;
|
|
497
516
|
const cp = getCheckpointFromState(checkpointState);
|
|
498
517
|
this.regen.addCheckpointState(cp, checkpointState, payloadPresent);
|
|
499
518
|
// consumers should not mutate state ever
|
|
@@ -502,7 +521,7 @@ export async function importBlock(
|
|
|
502
521
|
// Note: in-lined code from previos handler of ChainEvent.checkpoint
|
|
503
522
|
this.logger.verbose("Checkpoint processed", toCheckpointHexPayload(cp, payloadPresent));
|
|
504
523
|
|
|
505
|
-
const activeValidatorsCount = checkpointState.
|
|
524
|
+
const activeValidatorsCount = checkpointState.activeValidatorCount;
|
|
506
525
|
this.metrics?.currentActiveValidators.set(activeValidatorsCount);
|
|
507
526
|
this.metrics?.currentValidators.set({status: "active"}, activeValidatorsCount);
|
|
508
527
|
|
|
@@ -583,11 +602,11 @@ export async function importBlock(
|
|
|
583
602
|
this.metrics?.parentBlockDistance.observe(blockSlot - parentBlockSlot);
|
|
584
603
|
this.metrics?.proposerBalanceDeltaAny.observe(fullyVerifiedBlock.proposerBalanceDelta);
|
|
585
604
|
this.validatorMonitor?.registerImportedBlock(block.message, fullyVerifiedBlock);
|
|
586
|
-
if (
|
|
605
|
+
if (isStatePostAltair(fullyVerifiedBlock.postBlockState)) {
|
|
587
606
|
this.validatorMonitor?.registerSyncAggregateInBlock(
|
|
588
607
|
blockEpoch,
|
|
589
608
|
(block as altair.SignedBeaconBlock).message.body.syncAggregate,
|
|
590
|
-
fullyVerifiedBlock.
|
|
609
|
+
fullyVerifiedBlock.postBlockState.currentSyncCommitteeIndexed.validatorIndices
|
|
591
610
|
);
|
|
592
611
|
}
|
|
593
612
|
|
|
@@ -629,7 +648,7 @@ export async function importBlock(
|
|
|
629
648
|
export function addAttestationPreElectra(
|
|
630
649
|
this: BeaconChain,
|
|
631
650
|
// added to have the same signature as addAttestationPostElectra
|
|
632
|
-
_:
|
|
651
|
+
_: IBeaconStateView,
|
|
633
652
|
target: phase0.Checkpoint,
|
|
634
653
|
attDataRoot: string,
|
|
635
654
|
attestation: Attestation,
|
|
@@ -646,7 +665,7 @@ export function addAttestationPreElectra(
|
|
|
646
665
|
|
|
647
666
|
export function addAttestationPostElectra(
|
|
648
667
|
this: BeaconChain,
|
|
649
|
-
|
|
668
|
+
state: IBeaconStateView,
|
|
650
669
|
target: phase0.Checkpoint,
|
|
651
670
|
attDataRoot: string,
|
|
652
671
|
attestation: Attestation<ForkPostElectra>,
|
|
@@ -664,7 +683,7 @@ export function addAttestationPostElectra(
|
|
|
664
683
|
} else {
|
|
665
684
|
const attSlot = attestation.data.slot;
|
|
666
685
|
const attEpoch = computeEpochAtSlot(attSlot);
|
|
667
|
-
const decisionRoot =
|
|
686
|
+
const decisionRoot = state.getShufflingDecisionRoot(attEpoch);
|
|
668
687
|
const committees = this.shufflingCache.getBeaconCommittees(attEpoch, decisionRoot, attSlot, committeeIndices);
|
|
669
688
|
const aggregationBools = attestation.aggregationBits.toBoolArray();
|
|
670
689
|
let offset = 0;
|