@lodestar/beacon-node 1.41.0 → 1.42.0-dev.2fd27cd2f6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +36 -17
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +27 -32
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +6 -6
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +4 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +32 -28
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts +0 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +0 -9
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +2 -6
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +3 -23
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -0
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +4 -4
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts +4 -4
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +4 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +38 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +4 -3
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +38 -18
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +48 -0
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -0
- package/lib/chain/blocks/importExecutionPayload.js +158 -0
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -0
- package/lib/chain/blocks/index.js +1 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.js +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +80 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +248 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +29 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.js +11 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +15 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +46 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -0
- package/lib/chain/blocks/types.d.ts +9 -2
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +2 -2
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +4 -4
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +3 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +2 -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/blocks/writePayloadEnvelopeInputToDb.d.ts +12 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +40 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -0
- package/lib/chain/chain.d.ts +22 -17
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +90 -48
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +2 -2
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/errors/blockError.d.ts +4 -4
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +12 -2
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +3 -1
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +27 -33
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +2 -2
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +19 -17
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +4 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +10 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +2 -2
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +9 -5
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +8 -4
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +13 -17
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/errors.d.ts +11 -1
- package/lib/chain/regen/errors.d.ts.map +1 -1
- package/lib/chain/regen/errors.js +2 -0
- package/lib/chain/regen/errors.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +22 -14
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +2 -0
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.d.ts +20 -15
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +40 -8
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +11 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +38 -11
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/index.d.ts +1 -1
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +1 -1
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +38 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +76 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -0
- package/lib/chain/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/datastore/db.d.ts +4 -5
- package/lib/chain/stateCache/datastore/db.d.ts.map +1 -1
- package/lib/chain/stateCache/datastore/db.js +32 -10
- package/lib/chain/stateCache/datastore/db.js.map +1 -1
- package/lib/chain/stateCache/datastore/file.d.ts +1 -1
- package/lib/chain/stateCache/datastore/file.d.ts.map +1 -1
- package/lib/chain/stateCache/datastore/file.js +5 -5
- package/lib/chain/stateCache/datastore/file.js.map +1 -1
- package/lib/chain/stateCache/datastore/types.d.ts +1 -1
- package/lib/chain/stateCache/datastore/types.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +13 -10
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js +8 -3
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +36 -17
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +228 -134
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +23 -16
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +3 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +1 -1
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +4 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +29 -19
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +1 -2
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +13 -12
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +5 -4
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +13 -8
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +2 -2
- package/lib/metrics/metrics/lodestar.d.ts +40 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +93 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/interface.d.ts +4 -2
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +4 -2
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +11 -5
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +15 -5
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +39 -9
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +12 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +99 -78
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +10 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +8 -2
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +7 -1
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +1 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +3 -3
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +3 -3
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/constants.d.ts +1 -1
- package/lib/sync/constants.js +1 -1
- package/lib/sync/unknownBlock.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +8 -41
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/util/sszBytes.d.ts +4 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +69 -12
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +15 -15
- package/src/api/impl/beacon/blocks/index.ts +37 -18
- package/src/api/impl/beacon/pool/index.ts +1 -1
- package/src/api/impl/beacon/state/index.ts +29 -41
- package/src/api/impl/beacon/state/utils.ts +13 -27
- 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 +35 -43
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/archiveStore/archiveStore.ts +0 -10
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +6 -36
- package/src/chain/archiveStore/historicalState/worker.ts +1 -0
- package/src/chain/archiveStore/interface.ts +4 -4
- package/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +8 -5
- package/src/chain/archiveStore/utils/archiveBlocks.ts +59 -1
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/types.ts +4 -3
- package/src/chain/blocks/importBlock.ts +58 -22
- package/src/chain/blocks/importExecutionPayload.ts +236 -0
- package/src/chain/blocks/index.ts +1 -1
- package/src/chain/blocks/payloadEnvelopeInput/index.ts +2 -0
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +336 -0
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +33 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +61 -0
- package/src/chain/blocks/types.ts +10 -2
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +5 -10
- package/src/chain/blocks/verifyBlocksSignatures.ts +4 -4
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +55 -0
- package/src/chain/chain.ts +134 -81
- package/src/chain/emitter.ts +2 -2
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
- package/src/chain/forkChoice/index.ts +33 -52
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +20 -18
- package/src/chain/lightClient/index.ts +9 -22
- package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +4 -4
- package/src/chain/prepareNextSlot.ts +12 -10
- package/src/chain/produceBlock/computeNewStateRoot.ts +11 -10
- package/src/chain/produceBlock/produceBlockBody.ts +23 -50
- package/src/chain/regen/errors.ts +6 -1
- package/src/chain/regen/interface.ts +22 -18
- package/src/chain/regen/queued.ts +59 -27
- package/src/chain/regen/regen.ts +52 -23
- package/src/chain/seenCache/index.ts +1 -1
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +106 -0
- package/src/chain/serializeState.ts +3 -3
- package/src/chain/shufflingCache.ts +5 -7
- package/src/chain/stateCache/datastore/db.ts +33 -10
- package/src/chain/stateCache/datastore/file.ts +6 -5
- package/src/chain/stateCache/datastore/types.ts +3 -2
- package/src/chain/stateCache/fifoBlockStateCache.ts +17 -11
- package/src/chain/stateCache/persistentCheckpointsCache.ts +266 -172
- package/src/chain/stateCache/types.ts +22 -16
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +2 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +3 -7
- package/src/chain/validation/executionPayloadEnvelope.ts +36 -29
- package/src/chain/validation/lightClientFinalityUpdate.ts +1 -1
- package/src/chain/validation/lightClientOptimisticUpdate.ts +1 -1
- package/src/chain/validation/payloadAttestationMessage.ts +2 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +21 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
- package/src/chain/validation/voluntaryExit.ts +3 -7
- package/src/chain/validatorMonitor.ts +23 -12
- package/src/execution/engine/interface.ts +2 -2
- package/src/metrics/metrics/lodestar.ts +100 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +15 -2
- package/src/network/network.ts +34 -6
- package/src/network/processor/extractSlotRootFns.ts +19 -6
- package/src/network/processor/gossipHandlers.ts +45 -8
- package/src/network/processor/index.ts +110 -89
- package/src/network/reqresp/ReqRespBeaconNode.ts +14 -1
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +13 -0
- package/src/node/nodejs.ts +3 -5
- package/src/node/notifier.ts +4 -10
- package/src/sync/backfill/backfill.ts +4 -4
- package/src/sync/constants.ts +1 -1
- package/src/sync/unknownBlock.ts +10 -50
- package/src/util/sszBytes.ts +90 -10
- package/src/util/types.ts +6 -0
- package/lib/chain/archiveStore/utils/archivePayloads.d.ts +0 -7
- package/lib/chain/archiveStore/utils/archivePayloads.d.ts.map +0 -1
- package/lib/chain/archiveStore/utils/archivePayloads.js +0 -10
- package/lib/chain/archiveStore/utils/archivePayloads.js.map +0 -1
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts +0 -15
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +0 -1
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js +0 -28
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +0 -1
- package/src/chain/archiveStore/utils/archivePayloads.ts +0 -15
- package/src/chain/seenCache/seenExecutionPayloadEnvelope.ts +0 -34
|
@@ -17,19 +17,14 @@ import {
|
|
|
17
17
|
isForkPostGloas,
|
|
18
18
|
} from "@lodestar/params";
|
|
19
19
|
import {
|
|
20
|
-
CachedBeaconStateAllForks,
|
|
21
20
|
DataAvailabilityStatus,
|
|
22
|
-
|
|
21
|
+
IBeaconStateView,
|
|
23
22
|
beaconBlockToBlinded,
|
|
24
23
|
calculateCommitteeAssignments,
|
|
25
24
|
computeEpochAtSlot,
|
|
26
25
|
computeStartSlotAtEpoch,
|
|
27
26
|
computeTimeAtSlot,
|
|
28
|
-
createCachedBeaconState,
|
|
29
|
-
createPubkeyCache,
|
|
30
|
-
getBlockRootAtSlot,
|
|
31
27
|
getCurrentSlot,
|
|
32
|
-
loadState,
|
|
33
28
|
proposerShufflingDecisionRoot,
|
|
34
29
|
} from "@lodestar/state-transition";
|
|
35
30
|
import {
|
|
@@ -74,7 +69,7 @@ import {ChainEvent, CommonBlockBody} from "../../../chain/index.js";
|
|
|
74
69
|
import {PREPARE_NEXT_SLOT_BPS} from "../../../chain/prepareNextSlot.js";
|
|
75
70
|
import {BlockType, ProduceFullDeneb, ProduceFullGloas} from "../../../chain/produceBlock/index.js";
|
|
76
71
|
import {RegenCaller} from "../../../chain/regen/index.js";
|
|
77
|
-
import {
|
|
72
|
+
import {CheckpointHexPayload} from "../../../chain/stateCache/types.js";
|
|
78
73
|
import {validateApiAggregateAndProof} from "../../../chain/validation/index.js";
|
|
79
74
|
import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js";
|
|
80
75
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
@@ -193,11 +188,13 @@ export function getValidatorApi(
|
|
|
193
188
|
const MAX_API_CLOCK_DISPARITY_MS = MAX_API_CLOCK_DISPARITY_SEC * 1000;
|
|
194
189
|
|
|
195
190
|
/** Compute and cache the genesis block root */
|
|
196
|
-
async function getGenesisBlockRoot(state:
|
|
191
|
+
async function getGenesisBlockRoot(state: IBeaconStateView): Promise<Root> {
|
|
197
192
|
if (!genesisBlockRoot) {
|
|
198
193
|
// Close to genesis the genesis block may not be available in the DB
|
|
199
|
-
if (state.slot
|
|
200
|
-
genesisBlockRoot = state.
|
|
194
|
+
if (state.slot === GENESIS_SLOT) {
|
|
195
|
+
genesisBlockRoot = state.computeAnchorCheckpoint().checkpoint.root;
|
|
196
|
+
} else if (state.slot < SLOTS_PER_HISTORICAL_ROOT) {
|
|
197
|
+
genesisBlockRoot = state.getBlockRootAtSlot(GENESIS_SLOT);
|
|
201
198
|
}
|
|
202
199
|
|
|
203
200
|
const blockRes = await chain.getCanonicalBlockAtSlot(GENESIS_SLOT);
|
|
@@ -303,7 +300,7 @@ export function getValidatorApi(
|
|
|
303
300
|
* |
|
|
304
301
|
* prepareNextSlot (4s before next slot)
|
|
305
302
|
*/
|
|
306
|
-
async function waitForCheckpointState(cpHex:
|
|
303
|
+
async function waitForCheckpointState(cpHex: CheckpointHexPayload): Promise<IBeaconStateView | null> {
|
|
307
304
|
const cpState = chain.regen.getCheckpointStateSync(cpHex);
|
|
308
305
|
if (cpState) {
|
|
309
306
|
return cpState;
|
|
@@ -995,7 +992,7 @@ export function getValidatorApi(
|
|
|
995
992
|
headBlockRoot
|
|
996
993
|
: // Permit attesting to slots *prior* to the current head. This is desirable when
|
|
997
994
|
// the VC and BN are out-of-sync due to time issues or overloading.
|
|
998
|
-
getBlockRootAtSlot(
|
|
995
|
+
headState.getBlockRootAtSlot(slot);
|
|
999
996
|
|
|
1000
997
|
let index: CommitteeIndex;
|
|
1001
998
|
if (isForkPostGloas(fork)) {
|
|
@@ -1026,7 +1023,7 @@ export function getValidatorApi(
|
|
|
1026
1023
|
targetSlot >= headSlot
|
|
1027
1024
|
? // If the state is earlier than the target slot then the target *must* be the head block root.
|
|
1028
1025
|
headBlockRoot
|
|
1029
|
-
: getBlockRootAtSlot(
|
|
1026
|
+
: headState.getBlockRootAtSlot(targetSlot);
|
|
1030
1027
|
|
|
1031
1028
|
// Check the execution status as validator shouldn't vote on an optimistic head
|
|
1032
1029
|
// Check on target is sufficient as a valid target would imply a valid source
|
|
@@ -1068,7 +1065,7 @@ export function getValidatorApi(
|
|
|
1068
1065
|
// see https://github.com/ChainSafe/lodestar/issues/5063
|
|
1069
1066
|
if (!chain.forkChoice.hasBlock(beaconBlockRoot)) {
|
|
1070
1067
|
const rootHex = toRootHex(beaconBlockRoot);
|
|
1071
|
-
network.
|
|
1068
|
+
network.searchUnknownBlock({slot, root: rootHex}, BlockInputSource.api);
|
|
1072
1069
|
// if result of this call is false, i.e. block hasn't seen after 1 slot then the below notOnOptimisticBlockRoot call will throw error
|
|
1073
1070
|
await chain.waitForBlock(slot, rootHex);
|
|
1074
1071
|
}
|
|
@@ -1103,7 +1100,7 @@ export function getValidatorApi(
|
|
|
1103
1100
|
}
|
|
1104
1101
|
|
|
1105
1102
|
const head = chain.forkChoice.getHead();
|
|
1106
|
-
let state:
|
|
1103
|
+
let state: IBeaconStateView | undefined = undefined;
|
|
1107
1104
|
const startSlot = computeStartSlotAtEpoch(epoch);
|
|
1108
1105
|
const prepareNextSlotLookAheadMs =
|
|
1109
1106
|
config.SLOT_DURATION_MS - config.getSlotComponentDurationMs(PREPARE_NEXT_SLOT_BPS);
|
|
@@ -1112,7 +1109,11 @@ export function getValidatorApi(
|
|
|
1112
1109
|
// this is to avoid missed block proposal due to 0 epoch look ahead
|
|
1113
1110
|
if (epoch === nextEpoch && toNextEpochMs < prepareNextSlotLookAheadMs) {
|
|
1114
1111
|
// wait for maximum 1 slot for cp state which is the timeout of validator api
|
|
1115
|
-
const cpState = await waitForCheckpointState({
|
|
1112
|
+
const cpState = await waitForCheckpointState({
|
|
1113
|
+
rootHex: head.blockRoot,
|
|
1114
|
+
epoch,
|
|
1115
|
+
payloadPresent: head.payloadStatus === PayloadStatus.FULL,
|
|
1116
|
+
});
|
|
1116
1117
|
if (cpState) {
|
|
1117
1118
|
state = cpState;
|
|
1118
1119
|
metrics?.duties.requestNextEpochProposalDutiesHit.inc();
|
|
@@ -1129,43 +1130,34 @@ export function getValidatorApi(
|
|
|
1129
1130
|
} else {
|
|
1130
1131
|
const res = await getStateResponseWithRegen(chain, startSlot);
|
|
1131
1132
|
|
|
1132
|
-
|
|
1133
|
-
res.state instanceof Uint8Array ? loadState(config, chain.getHeadState(), res.state).state : res.state;
|
|
1134
|
-
|
|
1135
|
-
state = createCachedBeaconState(
|
|
1136
|
-
stateViewDU,
|
|
1137
|
-
{
|
|
1138
|
-
config: chain.config,
|
|
1139
|
-
// Not required to compute proposers
|
|
1140
|
-
pubkeyCache: createPubkeyCache(),
|
|
1141
|
-
},
|
|
1142
|
-
{skipSyncPubkeys: true, skipSyncCommitteeCache: true}
|
|
1143
|
-
);
|
|
1133
|
+
state = res.state instanceof Uint8Array ? chain.getHeadState().loadOtherState(res.state) : res.state;
|
|
1144
1134
|
|
|
1145
|
-
if (state.
|
|
1146
|
-
throw Error(`Loaded state epoch ${state.
|
|
1135
|
+
if (state.epoch !== epoch) {
|
|
1136
|
+
throw Error(`Loaded state epoch ${state.epoch} does not match requested epoch ${epoch}`);
|
|
1147
1137
|
}
|
|
1148
1138
|
}
|
|
1149
1139
|
}
|
|
1150
1140
|
|
|
1151
|
-
const stateEpoch = state.
|
|
1141
|
+
const stateEpoch = state.epoch;
|
|
1152
1142
|
let indexes: ValidatorIndex[] = [];
|
|
1153
1143
|
|
|
1154
1144
|
switch (epoch) {
|
|
1155
1145
|
case stateEpoch:
|
|
1156
|
-
indexes = state.
|
|
1146
|
+
indexes = state.currentProposers;
|
|
1157
1147
|
break;
|
|
1158
1148
|
|
|
1159
|
-
case stateEpoch + 1:
|
|
1149
|
+
case stateEpoch + 1: {
|
|
1160
1150
|
// make sure shuffling is calculated and ready for next call to calculate nextProposers
|
|
1161
|
-
|
|
1151
|
+
const nextEpoch = state.epoch + 1;
|
|
1152
|
+
await chain.shufflingCache.get(nextEpoch, state.nextDecisionRoot);
|
|
1162
1153
|
// Requesting duties for next epoch is allowed since they can be predicted with high probabilities.
|
|
1163
1154
|
// @see `epochCtx.getBeaconProposersNextEpoch` JSDocs for rationale.
|
|
1164
|
-
indexes = state.
|
|
1155
|
+
indexes = state.nextProposers;
|
|
1165
1156
|
break;
|
|
1157
|
+
}
|
|
1166
1158
|
|
|
1167
1159
|
case stateEpoch - 1: {
|
|
1168
|
-
const indexesPrevEpoch = state.
|
|
1160
|
+
const indexesPrevEpoch = state.previousProposers;
|
|
1169
1161
|
if (indexesPrevEpoch === null) {
|
|
1170
1162
|
// Should not happen as previous proposer duties should be initialized for head state
|
|
1171
1163
|
// and if we load state from `Uint8Array` it will always be the state of requested epoch
|
|
@@ -1184,7 +1176,7 @@ export function getValidatorApi(
|
|
|
1184
1176
|
// See benchmark -> packages/lodestar/test/perf/api/impl/validator/attester.test.ts
|
|
1185
1177
|
// After dropping the flat caches attached to the CachedBeaconState it's no longer available.
|
|
1186
1178
|
// TODO: Add a flag to just send 0x00 as pubkeys since the Lodestar validator does not need them.
|
|
1187
|
-
const pubkeys = getPubkeysForIndices(state
|
|
1179
|
+
const pubkeys = getPubkeysForIndices(state, indexes);
|
|
1188
1180
|
|
|
1189
1181
|
const duties: routes.validator.ProposerDuty[] = [];
|
|
1190
1182
|
for (let i = 0; i < SLOTS_PER_EPOCH; i++) {
|
|
@@ -1238,8 +1230,8 @@ export function getValidatorApi(
|
|
|
1238
1230
|
// will equal `currentEpoch + 1`
|
|
1239
1231
|
|
|
1240
1232
|
// Check that all validatorIndex belong to the state before calling getCommitteeAssignments()
|
|
1241
|
-
const pubkeys = getPubkeysForIndices(state
|
|
1242
|
-
const decisionRoot = state.
|
|
1233
|
+
const pubkeys = getPubkeysForIndices(state, indices);
|
|
1234
|
+
const decisionRoot = state.getShufflingDecisionRoot(epoch);
|
|
1243
1235
|
const shuffling = await chain.shufflingCache.get(epoch, decisionRoot);
|
|
1244
1236
|
if (!shuffling) {
|
|
1245
1237
|
throw new ApiError(
|
|
@@ -1260,7 +1252,7 @@ export function getValidatorApi(
|
|
|
1260
1252
|
}
|
|
1261
1253
|
}
|
|
1262
1254
|
|
|
1263
|
-
const dependentRoot =
|
|
1255
|
+
const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch)) || (await getGenesisBlockRoot(state));
|
|
1264
1256
|
|
|
1265
1257
|
return {
|
|
1266
1258
|
data: duties,
|
|
@@ -1301,9 +1293,9 @@ export function getValidatorApi(
|
|
|
1301
1293
|
const state = chain.getHeadState();
|
|
1302
1294
|
|
|
1303
1295
|
// Check that all validatorIndex belong to the state before calling getCommitteeAssignments()
|
|
1304
|
-
const pubkeys = getPubkeysForIndices(state
|
|
1296
|
+
const pubkeys = getPubkeysForIndices(state, indices);
|
|
1305
1297
|
// Ensures `epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1`
|
|
1306
|
-
const syncCommitteeCache = state.
|
|
1298
|
+
const syncCommitteeCache = state.getIndexedSyncCommitteeAtEpoch(epoch);
|
|
1307
1299
|
const validatorSyncCommitteeIndexMap = syncCommitteeCache.validatorIndexMap;
|
|
1308
1300
|
|
|
1309
1301
|
const duties: routes.validator.SyncDuty[] = [];
|
|
@@ -1601,7 +1593,7 @@ export function getValidatorApi(
|
|
|
1601
1593
|
const validatorIndex = chain.pubkeyCache.getIndex(pubkey);
|
|
1602
1594
|
if (validatorIndex === null) return false;
|
|
1603
1595
|
|
|
1604
|
-
const validator = headState.
|
|
1596
|
+
const validator = headState.getValidator(validatorIndex);
|
|
1605
1597
|
const status = getValidatorStatus(validator, currentEpoch);
|
|
1606
1598
|
return (
|
|
1607
1599
|
status === "active_exiting" ||
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ATTESTATION_SUBNET_COUNT} from "@lodestar/params";
|
|
3
|
-
import {
|
|
3
|
+
import {IBeaconStateView, computeSlotsSinceEpochStart} from "@lodestar/state-transition";
|
|
4
4
|
import {BLSPubkey, CommitteeIndex, ProducedBlockSource, Slot, SubnetID, ValidatorIndex} from "@lodestar/types";
|
|
5
5
|
import {MAX_BUILDER_BOOST_FACTOR} from "@lodestar/validator";
|
|
6
6
|
import {BlockSelectionResult, BuilderBlockSelectionReason, EngineBlockSelectionReason} from "./index.js";
|
|
@@ -24,11 +24,8 @@ export function computeSubnetForCommitteesAtSlot(
|
|
|
24
24
|
* Note: This is the fastest way of getting compressed pubkeys.
|
|
25
25
|
* See benchmark -> packages/beacon-node/test/perf/api/impl/validator/attester.test.ts
|
|
26
26
|
*/
|
|
27
|
-
export function getPubkeysForIndices(
|
|
28
|
-
|
|
29
|
-
indexes: ValidatorIndex[]
|
|
30
|
-
): BLSPubkey[] {
|
|
31
|
-
const validatorsLen = validators.length; // Get once, it's expensive
|
|
27
|
+
export function getPubkeysForIndices(state: IBeaconStateView, indexes: ValidatorIndex[]): BLSPubkey[] {
|
|
28
|
+
const validatorsLen = state.validatorCount; // Get once, it's expensive
|
|
32
29
|
|
|
33
30
|
const pubkeys: BLSPubkey[] = [];
|
|
34
31
|
for (let i = 0, len = indexes.length; i < len; i++) {
|
|
@@ -38,7 +35,7 @@ export function getPubkeysForIndices(
|
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
// NOTE: This could be optimized further by traversing the tree optimally with .getNodes()
|
|
41
|
-
const validator =
|
|
38
|
+
const validator = state.getValidator(index);
|
|
42
39
|
pubkeys.push(validator.pubkey);
|
|
43
40
|
}
|
|
44
41
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {CheckpointWithPayloadStatus} from "@lodestar/fork-choice";
|
|
2
2
|
import {LoggerNode} from "@lodestar/logger/node";
|
|
3
|
-
import {ForkSeq} from "@lodestar/params";
|
|
4
3
|
import {Checkpoint} from "@lodestar/types/phase0";
|
|
5
4
|
import {callFnWhenAwait} from "@lodestar/utils";
|
|
6
5
|
import {IBeaconDb} from "../../db/index.js";
|
|
@@ -14,7 +13,6 @@ import {HistoricalStateRegen} from "./historicalState/historicalStateRegen.js";
|
|
|
14
13
|
import {ArchiveMode, ArchiveStoreOpts, StateArchiveStrategy} from "./interface.js";
|
|
15
14
|
import {FrequencyStateArchiveStrategy} from "./strategies/frequencyStateArchiveStrategy.js";
|
|
16
15
|
import {archiveBlocks} from "./utils/archiveBlocks.js";
|
|
17
|
-
import {archiveExecutionPayloadEnvelopes} from "./utils/archivePayloads.js";
|
|
18
16
|
import {pruneHistory} from "./utils/pruneHistory.js";
|
|
19
17
|
import {updateBackfillRange} from "./utils/updateBackfillRange.js";
|
|
20
18
|
|
|
@@ -29,7 +27,6 @@ type ArchiveStoreInitOpts = ArchiveStoreOpts & {dbName: string; anchorState: {fi
|
|
|
29
27
|
|
|
30
28
|
export enum ArchiveStoreTask {
|
|
31
29
|
ArchiveBlocks = "archive_blocks",
|
|
32
|
-
ArchivePayloads = "archive_payloads",
|
|
33
30
|
PruneHistory = "prune_history",
|
|
34
31
|
OnFinalizedCheckpoint = "on_finalized_checkpoint",
|
|
35
32
|
MaybeArchiveState = "maybe_archive_state",
|
|
@@ -192,7 +189,6 @@ export class ArchiveStore {
|
|
|
192
189
|
private processFinalizedCheckpoint = async (finalized: CheckpointWithPayloadStatus): Promise<void> => {
|
|
193
190
|
try {
|
|
194
191
|
const finalizedEpoch = finalized.epoch;
|
|
195
|
-
const finalizedFork = this.chain.config.getForkSeqAtEpoch(finalizedEpoch);
|
|
196
192
|
this.logger.verbose("Start processing finalized checkpoint", {epoch: finalizedEpoch, rootHex: finalized.rootHex});
|
|
197
193
|
|
|
198
194
|
let timer = this.metrics?.processFinalizedCheckpoint.durationByTask.startTimer();
|
|
@@ -210,12 +206,6 @@ export class ArchiveStore {
|
|
|
210
206
|
);
|
|
211
207
|
timer?.({source: ArchiveStoreTask.ArchiveBlocks});
|
|
212
208
|
|
|
213
|
-
if (finalizedFork >= ForkSeq.gloas) {
|
|
214
|
-
timer = this.metrics?.processFinalizedCheckpoint.durationByTask.startTimer();
|
|
215
|
-
await archiveExecutionPayloadEnvelopes(this.chain, finalized);
|
|
216
|
-
timer?.({source: ArchiveStoreTask.ArchivePayloads});
|
|
217
|
-
}
|
|
218
|
-
|
|
219
209
|
if (this.opts.pruneHistory) {
|
|
220
210
|
timer = this.metrics?.processFinalizedCheckpoint.durationByTask.startTimer();
|
|
221
211
|
await pruneHistory(
|
|
@@ -1,33 +1,16 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {
|
|
3
|
-
BeaconStateAllForks,
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
3
|
DataAvailabilityStatus,
|
|
6
4
|
ExecutionPayloadStatus,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
IBeaconStateView,
|
|
6
|
+
type PubkeyCache,
|
|
7
|
+
createBeaconStateViewForHistoricalRegen,
|
|
10
8
|
} from "@lodestar/state-transition";
|
|
11
9
|
import {byteArrayEquals} from "@lodestar/utils";
|
|
12
10
|
import {IBeaconDb} from "../../../db/index.js";
|
|
13
|
-
import {getStateTypeFromBytes} from "../../../util/multifork.js";
|
|
14
11
|
import {HistoricalStateRegenMetrics} from "./metrics.js";
|
|
15
12
|
import {RegenErrorType} from "./types.js";
|
|
16
13
|
|
|
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
14
|
/**
|
|
32
15
|
* Get the nearest BeaconState at or before a slot
|
|
33
16
|
*/
|
|
@@ -36,26 +19,14 @@ export async function getNearestState(
|
|
|
36
19
|
config: BeaconConfig,
|
|
37
20
|
db: IBeaconDb,
|
|
38
21
|
pubkeyCache: PubkeyCache
|
|
39
|
-
): Promise<
|
|
22
|
+
): Promise<IBeaconStateView> {
|
|
40
23
|
const stateBytesArr = await db.stateArchive.binaries({limit: 1, lte: slot, reverse: true});
|
|
41
24
|
if (!stateBytesArr.length) {
|
|
42
25
|
throw new Error("No near state found in the database");
|
|
43
26
|
}
|
|
44
27
|
|
|
45
28
|
const stateBytes = stateBytesArr[0];
|
|
46
|
-
|
|
47
|
-
syncPubkeyCache(state, pubkeyCache);
|
|
48
|
-
|
|
49
|
-
return createCachedBeaconState(
|
|
50
|
-
state,
|
|
51
|
-
{
|
|
52
|
-
config,
|
|
53
|
-
pubkeyCache,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
skipSyncPubkeys: true,
|
|
57
|
-
}
|
|
58
|
-
);
|
|
29
|
+
return createBeaconStateViewForHistoricalRegen(config, stateBytes, pubkeyCache);
|
|
59
30
|
}
|
|
60
31
|
|
|
61
32
|
/**
|
|
@@ -81,8 +52,7 @@ export async function getHistoricalState(
|
|
|
81
52
|
let blockCount = 0;
|
|
82
53
|
for await (const block of db.blockArchive.valuesStream({gt: state.slot, lte: slot})) {
|
|
83
54
|
try {
|
|
84
|
-
state = stateTransition(
|
|
85
|
-
state,
|
|
55
|
+
state = state.stateTransition(
|
|
86
56
|
block,
|
|
87
57
|
{
|
|
88
58
|
verifyProposer: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {CheckpointWithPayloadStatus} from "@lodestar/fork-choice";
|
|
2
2
|
import {RootHex} from "@lodestar/types";
|
|
3
3
|
import {Metrics} from "../../metrics/metrics.js";
|
|
4
4
|
|
|
@@ -44,9 +44,9 @@ export type FinalizedStats = {
|
|
|
44
44
|
|
|
45
45
|
export interface StateArchiveStrategy {
|
|
46
46
|
onCheckpoint(stateRoot: RootHex, metrics?: Metrics | null): Promise<void>;
|
|
47
|
-
onFinalizedCheckpoint(finalized:
|
|
48
|
-
maybeArchiveState(finalized:
|
|
49
|
-
archiveState(finalized:
|
|
47
|
+
onFinalizedCheckpoint(finalized: CheckpointWithPayloadStatus, metrics?: Metrics | null): Promise<void>;
|
|
48
|
+
maybeArchiveState(finalized: CheckpointWithPayloadStatus, metrics?: Metrics | null): Promise<void>;
|
|
49
|
+
archiveState(finalized: CheckpointWithPayloadStatus, metrics?: Metrics | null): Promise<void>;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export interface IArchiveStore {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {CheckpointWithPayloadStatus} from "@lodestar/fork-choice";
|
|
2
2
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
3
|
import {computeEpochAtSlot, computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
4
4
|
import {Epoch, RootHex, Slot} from "@lodestar/types";
|
|
@@ -9,6 +9,7 @@ import {AllocSource, BufferPool} from "../../../util/bufferPool.js";
|
|
|
9
9
|
import {getStateSlotFromBytes} from "../../../util/multifork.js";
|
|
10
10
|
import {IStateRegenerator} from "../../regen/interface.js";
|
|
11
11
|
import {serializeState} from "../../serializeState.js";
|
|
12
|
+
import {fcCheckpointToHexPayload} from "../../stateCache/persistentCheckpointsCache.js";
|
|
12
13
|
import {StateArchiveStrategy, StatesArchiveOpts} from "../interface.js";
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -40,7 +41,7 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
|
|
|
40
41
|
private readonly bufferPool?: BufferPool | null
|
|
41
42
|
) {}
|
|
42
43
|
|
|
43
|
-
async onFinalizedCheckpoint(_finalized:
|
|
44
|
+
async onFinalizedCheckpoint(_finalized: CheckpointWithPayloadStatus, _metrics?: Metrics | null): Promise<void> {}
|
|
44
45
|
async onCheckpoint(_stateRoot: RootHex, _metrics?: Metrics | null): Promise<void> {}
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -55,7 +56,7 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
|
|
|
55
56
|
* epoch - 1024*2 epoch - 1024 epoch - 32 epoch
|
|
56
57
|
* ```
|
|
57
58
|
*/
|
|
58
|
-
async maybeArchiveState(finalized:
|
|
59
|
+
async maybeArchiveState(finalized: CheckpointWithPayloadStatus, metrics?: Metrics | null): Promise<void> {
|
|
59
60
|
let timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
|
|
60
61
|
const lastStoredSlot = await this.db.stateArchive.lastKey();
|
|
61
62
|
timer?.({step: FrequencyStateArchiveStep.LoadLastStoredSlot});
|
|
@@ -104,10 +105,12 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
|
|
|
104
105
|
* Archives finalized states from active bucket to archive bucket.
|
|
105
106
|
* Only the new finalized state is stored to disk
|
|
106
107
|
*/
|
|
107
|
-
async archiveState(finalized:
|
|
108
|
+
async archiveState(finalized: CheckpointWithPayloadStatus, metrics?: Metrics | null): Promise<void> {
|
|
108
109
|
// starting from Mar 2024, the finalized state could be from disk or in memory
|
|
109
110
|
let timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
|
|
110
|
-
|
|
111
|
+
// Convert fork-choice checkpoint to beacon-node checkpoint with payloadPresent
|
|
112
|
+
const finalizedHexPayload = fcCheckpointToHexPayload(finalized);
|
|
113
|
+
const finalizedStateOrBytes = await this.regen.getCheckpointStateOrBytes(finalizedHexPayload);
|
|
111
114
|
timer?.({step: FrequencyStateArchiveStep.GetFinalizedState});
|
|
112
115
|
|
|
113
116
|
const {rootHex} = finalized;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import {ChainForkConfig} from "@lodestar/config";
|
|
3
3
|
import {KeyValue} from "@lodestar/db";
|
|
4
|
-
import {CheckpointWithPayloadStatus, IForkChoice} from "@lodestar/fork-choice";
|
|
4
|
+
import {CheckpointWithPayloadStatus, IForkChoice, PayloadStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
5
5
|
import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
6
6
|
import {computeEpochAtSlot, computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
7
7
|
import {Epoch, Slot} from "@lodestar/types";
|
|
@@ -66,6 +66,7 @@ export async function archiveBlocks(
|
|
|
66
66
|
// NOTE: The finalized block will be exactly the first block of `epoch` or previous
|
|
67
67
|
const finalizedPostDeneb = finalizedCheckpoint.epoch >= config.DENEB_FORK_EPOCH;
|
|
68
68
|
const finalizedPostFulu = finalizedCheckpoint.epoch >= config.FULU_FORK_EPOCH;
|
|
69
|
+
const finalizedPostGloas = finalizedCheckpoint.epoch >= config.GLOAS_FORK_EPOCH;
|
|
69
70
|
|
|
70
71
|
const finalizedCanonicalBlockRoots: BlockRootSlot[] = finalizedCanonicalBlocks.map((block) => ({
|
|
71
72
|
slot: block.slot,
|
|
@@ -103,6 +104,16 @@ export async function archiveBlocks(
|
|
|
103
104
|
);
|
|
104
105
|
logger.verbose("Migrated dataColumnSidecars from hot DB to cold DB", {...logCtx, migratedEntries});
|
|
105
106
|
}
|
|
107
|
+
|
|
108
|
+
if (finalizedPostGloas) {
|
|
109
|
+
const migratedEntries = await migrateExecutionPayloadEnvelopesFromHotToColdDb(
|
|
110
|
+
config,
|
|
111
|
+
db,
|
|
112
|
+
logger,
|
|
113
|
+
finalizedCanonicalBlocks
|
|
114
|
+
);
|
|
115
|
+
logger.verbose("Migrated executionPayloadEnvelopes from hot DB to cold DB", {...logCtx, migratedEntries});
|
|
116
|
+
}
|
|
106
117
|
}
|
|
107
118
|
|
|
108
119
|
// deleteNonCanonicalBlocks
|
|
@@ -144,6 +155,11 @@ export async function archiveBlocks(
|
|
|
144
155
|
await db.dataColumnSidecar.deleteMany(nonCanonicalBlockRoots);
|
|
145
156
|
logger.verbose("Deleted non canonical dataColumnSidecars from hot DB", logCtx);
|
|
146
157
|
}
|
|
158
|
+
|
|
159
|
+
if (finalizedPostGloas) {
|
|
160
|
+
await db.executionPayloadEnvelope.batchDelete(nonCanonicalBlockRoots);
|
|
161
|
+
logger.verbose("Deleted non canonical executionPayloadEnvelopes from hot DB", logCtx);
|
|
162
|
+
}
|
|
147
163
|
}
|
|
148
164
|
|
|
149
165
|
// Delete expired blobs
|
|
@@ -372,6 +388,48 @@ async function migrateDataColumnSidecarsFromHotToColdDb(
|
|
|
372
388
|
return migratedWrappedDataColumns;
|
|
373
389
|
}
|
|
374
390
|
|
|
391
|
+
async function migrateExecutionPayloadEnvelopesFromHotToColdDb(
|
|
392
|
+
config: ChainForkConfig,
|
|
393
|
+
db: IBeaconDb,
|
|
394
|
+
logger: Logger,
|
|
395
|
+
canonicalBlocks: ProtoBlock[]
|
|
396
|
+
): Promise<number> {
|
|
397
|
+
let migratedEnvelopes = 0;
|
|
398
|
+
|
|
399
|
+
const payloadBlocks = canonicalBlocks.filter(
|
|
400
|
+
(block) => config.getForkSeq(block.slot) >= ForkSeq.gloas && block.payloadStatus === PayloadStatus.FULL
|
|
401
|
+
);
|
|
402
|
+
if (payloadBlocks.length === 0) return 0;
|
|
403
|
+
const blocks = payloadBlocks.map((block) => ({slot: block.slot, root: fromHex(block.blockRoot)}));
|
|
404
|
+
|
|
405
|
+
const envelopeEntries: KeyValue<Slot, Uint8Array>[] = [];
|
|
406
|
+
const migratedRoots: Uint8Array[] = [];
|
|
407
|
+
|
|
408
|
+
const envelopeBytesArray = await Promise.all(
|
|
409
|
+
blocks.map((block) => db.executionPayloadEnvelope.getBinary(block.root))
|
|
410
|
+
);
|
|
411
|
+
|
|
412
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
413
|
+
const bytes = envelopeBytesArray[i];
|
|
414
|
+
if (bytes !== null) {
|
|
415
|
+
envelopeEntries.push({key: blocks[i].slot, value: bytes});
|
|
416
|
+
migratedRoots.push(blocks[i].root);
|
|
417
|
+
} else {
|
|
418
|
+
logger.debug("Payload in forkchoice but missing in db", {slot: blocks[i].slot, root: toRootHex(blocks[i].root)});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (envelopeEntries.length > 0) {
|
|
423
|
+
await Promise.all([
|
|
424
|
+
db.executionPayloadEnvelopeArchive.batchPutBinary(envelopeEntries),
|
|
425
|
+
db.executionPayloadEnvelope.batchDelete(migratedRoots),
|
|
426
|
+
]);
|
|
427
|
+
migratedEnvelopes = envelopeEntries.length;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return migratedEnvelopes;
|
|
431
|
+
}
|
|
432
|
+
|
|
375
433
|
/**
|
|
376
434
|
* ```
|
|
377
435
|
* class SignedBeaconBlock(Container):
|
|
@@ -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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForkName} from "@lodestar/params";
|
|
2
|
-
import {ColumnIndex, RootHex, SignedBeaconBlock, Slot, deneb, fulu} from "@lodestar/types";
|
|
2
|
+
import {ColumnIndex, DataColumnSidecars, RootHex, SignedBeaconBlock, Slot, deneb, fulu} from "@lodestar/types";
|
|
3
3
|
import {VersionedHashes} from "../../../execution/index.js";
|
|
4
4
|
|
|
5
5
|
export enum DAType {
|
|
@@ -16,6 +16,7 @@ export type DAData = null | deneb.BlobSidecars | fulu.DataColumnSidecars;
|
|
|
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(): DataColumnSidecars;
|
|
111
112
|
hasComputedAllData(): boolean;
|
|
112
|
-
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<
|
|
113
|
+
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<DataColumnSidecars>;
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
/**
|