@lodestar/beacon-node 1.41.0-dev.253ed58dd1 → 1.41.0-dev.274a9918a8
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/api.js.map +1 -1
- package/lib/api/impl/beacon/blocks/index.d.ts +1 -1
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +12 -2
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/blocks/utils.js.map +1 -1
- package/lib/api/impl/beacon/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/rewards/index.d.ts +1 -1
- package/lib/api/impl/beacon/rewards/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/rewards/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +8 -8
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +5 -6
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +5 -24
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/config/constants.js.map +1 -1
- package/lib/api/impl/config/index.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +1 -0
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/errors.d.ts.map +1 -1
- package/lib/api/impl/errors.js.map +1 -1
- package/lib/api/impl/events/index.d.ts +1 -1
- package/lib/api/impl/events/index.d.ts.map +1 -1
- package/lib/api/impl/events/index.js.map +1 -1
- package/lib/api/impl/lightclient/index.d.ts +1 -1
- package/lib/api/impl/lightclient/index.d.ts.map +1 -1
- package/lib/api/impl/lightclient/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/node/index.js.map +1 -1
- package/lib/api/impl/node/utils.d.ts +1 -1
- package/lib/api/impl/node/utils.d.ts.map +1 -1
- package/lib/api/impl/node/utils.js.map +1 -1
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/utils.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +38 -18
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +1 -1
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/api/rest/activeSockets.d.ts.map +1 -1
- package/lib/api/rest/activeSockets.js.map +1 -1
- package/lib/api/rest/base.d.ts.map +1 -1
- package/lib/api/rest/base.js.map +1 -1
- package/lib/api/rest/index.d.ts.map +1 -1
- package/lib/api/rest/index.js.map +1 -1
- package/lib/api/rest/swaggerUI.js.map +1 -1
- package/lib/bun-wrappers/prometheus-gc-stats.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.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 +2 -10
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +5 -6
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +9 -10
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js +2 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +3 -3
- 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/interface.js +2 -1
- package/lib/chain/archiveStore/interface.js.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts +5 -5
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +6 -2
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +3 -8
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +39 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/archiveStore/utils/updateBackfillRange.js +1 -1
- package/lib/chain/archiveStore/utils/updateBackfillRange.js.map +1 -1
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/beaconProposerCache.d.ts.map +1 -1
- package/lib/chain/beaconProposerCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +25 -2
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +71 -0
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.js +2 -1
- package/lib/chain/blocks/blockInput/errors.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +18 -1
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +5 -2
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/blockInput/utils.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +39 -12
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.js +6 -3
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +3 -0
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +4 -0
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +5 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +4 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts +12 -3
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +92 -98
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/bls/maybeBatch.js.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts +3 -3
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +5 -5
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/jobItem.d.ts +2 -2
- package/lib/chain/bls/multithread/jobItem.d.ts.map +1 -1
- package/lib/chain/bls/multithread/jobItem.js +4 -3
- package/lib/chain/bls/multithread/jobItem.js.map +1 -1
- package/lib/chain/bls/multithread/types.js +2 -1
- package/lib/chain/bls/multithread/types.js.map +1 -1
- package/lib/chain/bls/multithread/utils.js.map +1 -1
- package/lib/chain/bls/multithread/worker.js.map +1 -1
- package/lib/chain/bls/singleThread.d.ts +4 -4
- package/lib/chain/bls/singleThread.d.ts.map +1 -1
- package/lib/chain/bls/singleThread.js +4 -4
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.d.ts +2 -2
- package/lib/chain/bls/utils.d.ts.map +1 -1
- package/lib/chain/bls/utils.js +7 -4
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +10 -13
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +40 -30
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +4 -6
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +2 -1
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +2 -1
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/attesterSlashingError.js +2 -1
- package/lib/chain/errors/attesterSlashingError.js.map +1 -1
- package/lib/chain/errors/blobSidecarError.js +2 -1
- package/lib/chain/errors/blobSidecarError.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -1
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/blsToExecutionChangeError.js +2 -1
- package/lib/chain/errors/blsToExecutionChangeError.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +2 -1
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +1 -1
- package/lib/chain/errors/executionPayloadBid.js +2 -1
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +2 -2
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +2 -1
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/gossipValidation.d.ts.map +1 -1
- package/lib/chain/errors/gossipValidation.js +4 -2
- package/lib/chain/errors/gossipValidation.js.map +1 -1
- package/lib/chain/errors/lightClientError.js +4 -2
- package/lib/chain/errors/lightClientError.js.map +1 -1
- package/lib/chain/errors/payloadAttestation.d.ts +1 -1
- package/lib/chain/errors/payloadAttestation.js +2 -1
- package/lib/chain/errors/payloadAttestation.js.map +1 -1
- package/lib/chain/errors/proposerSlashingError.js +2 -1
- package/lib/chain/errors/proposerSlashingError.js.map +1 -1
- package/lib/chain/errors/syncCommitteeError.js +2 -1
- package/lib/chain/errors/syncCommitteeError.js.map +1 -1
- package/lib/chain/errors/voluntaryExitError.js +2 -1
- package/lib/chain/errors/voluntaryExitError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +32 -25
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +1 -1
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +4 -6
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js +2 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +0 -29
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/lightClient/proofs.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +5 -3
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
- package/lib/chain/opPools/types.js +4 -2
- package/lib/chain/opPools/types.js.map +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +1 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +6 -2
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +0 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +4 -3
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +24 -7
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/produceBlock/validateBlobsAndKzgCommitments.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 +4 -1
- package/lib/chain/regen/errors.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +12 -6
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +4 -2
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.d.ts +11 -6
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +44 -9
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +5 -0
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +39 -8
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/reprocess.d.ts.map +1 -1
- package/lib/chain/reprocess.js +2 -1
- package/lib/chain/reprocess.js.map +1 -1
- package/lib/chain/seenCache/seenAggregateAndProof.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAggregateAndProof.js.map +1 -1
- package/lib/chain/seenCache/seenAttestationData.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttestationData.js +2 -1
- package/lib/chain/seenCache/seenAttestationData.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
- package/lib/chain/seenCache/seenCommittee.d.ts.map +1 -1
- package/lib/chain/seenCache/seenCommittee.js.map +1 -1
- package/lib/chain/seenCache/seenCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/seenCache/seenCommitteeContribution.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -3
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +38 -16
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/serializeState.js +1 -0
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +2 -1
- 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 +7 -4
- 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/mapMetrics.d.ts.map +1 -1
- package/lib/chain/stateCache/mapMetrics.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +34 -55
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +217 -119
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +15 -8
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js +2 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +1 -1
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +14 -7
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +9 -2
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +2 -2
- 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 +6 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +2 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +125 -108
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +1 -2
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +4 -4
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +9 -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/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/selectionProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.js.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.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +2 -1
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/constants/network.js +4 -2
- package/lib/constants/network.js.map +1 -1
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/buckets.d.ts +23 -23
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -1
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/index.d.ts +1 -0
- package/lib/db/index.d.ts.map +1 -1
- package/lib/db/index.js +1 -0
- package/lib/db/index.js.map +1 -1
- package/lib/db/repositories/attesterSlashing.d.ts.map +1 -1
- package/lib/db/repositories/attesterSlashing.js.map +1 -1
- package/lib/db/repositories/backfilledRanges.d.ts.map +1 -1
- package/lib/db/repositories/backfilledRanges.js.map +1 -1
- package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.js.map +1 -1
- package/lib/db/repositories/blobSidecarsArchive.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecarsArchive.js.map +1 -1
- package/lib/db/repositories/block.d.ts.map +1 -1
- package/lib/db/repositories/block.js.map +1 -1
- package/lib/db/repositories/blockArchive.d.ts.map +1 -1
- package/lib/db/repositories/blockArchive.js +1 -2
- package/lib/db/repositories/blockArchive.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
- package/lib/db/repositories/blsToExecutionChange.d.ts.map +1 -1
- package/lib/db/repositories/blsToExecutionChange.js.map +1 -1
- package/lib/db/repositories/checkpointState.d.ts.map +1 -1
- package/lib/db/repositories/checkpointState.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelope.js.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.d.ts.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
- package/lib/db/repositories/lightclientBestUpdate.d.ts.map +1 -1
- package/lib/db/repositories/lightclientBestUpdate.js.map +1 -1
- package/lib/db/repositories/lightclientCheckpointHeader.d.ts.map +1 -1
- package/lib/db/repositories/lightclientCheckpointHeader.js.map +1 -1
- package/lib/db/repositories/lightclientSyncCommittee.d.ts.map +1 -1
- package/lib/db/repositories/lightclientSyncCommittee.js.map +1 -1
- package/lib/db/repositories/lightclientSyncCommitteeWitness.d.ts.map +1 -1
- package/lib/db/repositories/lightclientSyncCommitteeWitness.js.map +1 -1
- package/lib/db/repositories/proposerSlashing.d.ts.map +1 -1
- package/lib/db/repositories/proposerSlashing.js.map +1 -1
- package/lib/db/repositories/stateArchive.d.ts.map +1 -1
- package/lib/db/repositories/stateArchive.js.map +1 -1
- package/lib/db/repositories/stateArchiveIndex.js.map +1 -1
- package/lib/db/repositories/voluntaryExit.d.ts.map +1 -1
- package/lib/db/repositories/voluntaryExit.js.map +1 -1
- package/lib/execution/builder/cache.d.ts.map +1 -1
- package/lib/execution/builder/cache.js.map +1 -1
- package/lib/execution/builder/http.d.ts.map +1 -1
- package/lib/execution/builder/http.js +2 -1
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/execution/builder/index.js.map +1 -1
- package/lib/execution/builder/utils.js.map +1 -1
- package/lib/execution/engine/disabled.d.ts.map +1 -1
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +1 -0
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +3 -0
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.js +4 -2
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.d.ts +10 -15
- package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.js +2 -1
- package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
- package/lib/execution/engine/jwt.js.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts +1 -1
- package/lib/execution/engine/utils.d.ts.map +1 -1
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +2 -1
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +9 -3
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +16 -11
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +39 -24
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/metrics/nodeJsMetrics.js.map +1 -1
- package/lib/metrics/server/http.d.ts +1 -1
- package/lib/metrics/server/http.d.ts.map +1 -1
- package/lib/metrics/server/http.js.map +1 -1
- package/lib/metrics/utils/avgMinMax.d.ts.map +1 -1
- package/lib/metrics/utils/avgMinMax.js.map +1 -1
- package/lib/metrics/utils/gauge.d.ts.map +1 -1
- package/lib/metrics/utils/gauge.js.map +1 -1
- package/lib/metrics/utils/registryMetricCreator.d.ts.map +1 -1
- package/lib/metrics/utils/registryMetricCreator.js.map +1 -1
- package/lib/monitoring/clientStats.js.map +1 -1
- package/lib/monitoring/properties.d.ts.map +1 -1
- package/lib/monitoring/properties.js.map +1 -1
- package/lib/monitoring/service.d.ts +2 -2
- package/lib/monitoring/service.d.ts.map +1 -1
- package/lib/monitoring/service.js +3 -2
- package/lib/monitoring/service.js.map +1 -1
- package/lib/monitoring/system.d.ts.map +1 -1
- package/lib/monitoring/system.js.map +1 -1
- package/lib/monitoring/types.js +4 -2
- package/lib/monitoring/types.js.map +1 -1
- package/lib/network/core/events.d.ts +1 -3
- package/lib/network/core/events.d.ts.map +1 -1
- package/lib/network/core/events.js +4 -2
- package/lib/network/core/events.js.map +1 -1
- package/lib/network/core/metrics.d.ts +6 -7
- package/lib/network/core/metrics.d.ts.map +1 -1
- package/lib/network/core/metrics.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +4 -4
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +3 -3
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +2 -2
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/discv5/index.d.ts +1 -3
- package/lib/network/discv5/index.d.ts.map +1 -1
- package/lib/network/discv5/index.js.map +1 -1
- package/lib/network/discv5/utils.d.ts +1 -1
- package/lib/network/discv5/utils.d.ts.map +1 -1
- package/lib/network/discv5/utils.js +7 -5
- package/lib/network/discv5/utils.js.map +1 -1
- package/lib/network/discv5/worker.js.map +1 -1
- package/lib/network/events.d.ts +3 -4
- package/lib/network/events.d.ts.map +1 -1
- package/lib/network/events.js +4 -2
- package/lib/network/events.js.map +1 -1
- package/lib/network/forks.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts +3 -3
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/errors.d.ts.map +1 -1
- package/lib/network/gossip/errors.js.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +13 -4
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +56 -26
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +3 -3
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +4 -2
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/metrics.d.ts +12 -14
- package/lib/network/gossip/metrics.d.ts.map +1 -1
- package/lib/network/gossip/metrics.js.map +1 -1
- package/lib/network/gossip/scoringParameters.d.ts +2 -2
- package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
- package/lib/network/gossip/scoringParameters.js +1 -1
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +2867 -2920
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +3 -3
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/error.js +2 -1
- package/lib/network/libp2p/error.js.map +1 -1
- package/lib/network/libp2p/index.d.ts +2 -2
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +42 -19
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/metadata.d.ts +1 -0
- package/lib/network/metadata.d.ts.map +1 -1
- package/lib/network/metadata.js +5 -2
- package/lib/network/metadata.js.map +1 -1
- package/lib/network/network.d.ts +3 -3
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +1 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts +2 -0
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +6 -0
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/client.js +2 -1
- package/lib/network/peers/client.js.map +1 -1
- package/lib/network/peers/datastore.d.ts +7 -8
- package/lib/network/peers/datastore.d.ts.map +1 -1
- package/lib/network/peers/datastore.js +10 -10
- package/lib/network/peers/datastore.js.map +1 -1
- package/lib/network/peers/discover.d.ts +2 -7
- package/lib/network/peers/discover.d.ts.map +1 -1
- package/lib/network/peers/discover.js +45 -12
- package/lib/network/peers/discover.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts +3 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +103 -53
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/peersData.d.ts.map +1 -1
- package/lib/network/peers/peersData.js +2 -1
- package/lib/network/peers/peersData.js.map +1 -1
- package/lib/network/peers/score/interface.js +4 -2
- package/lib/network/peers/score/interface.js.map +1 -1
- package/lib/network/peers/score/score.d.ts.map +1 -1
- package/lib/network/peers/score/score.js.map +1 -1
- package/lib/network/peers/score/store.d.ts.map +1 -1
- package/lib/network/peers/score/store.js.map +1 -1
- package/lib/network/peers/score/utils.js.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.js +2 -1
- package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
- package/lib/network/peers/utils/enrSubnetsDeserialize.js.map +1 -1
- package/lib/network/peers/utils/getConnectedPeerIds.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +3 -3
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +2 -1
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/peers/utils/subnetMap.d.ts.map +1 -1
- package/lib/network/peers/utils/subnetMap.js.map +1 -1
- package/lib/network/processor/aggregatorTracker.d.ts.map +1 -1
- package/lib/network/processor/aggregatorTracker.js.map +1 -1
- 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 +4 -1
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipQueues/indexed.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/indexed.js.map +1 -1
- package/lib/network/processor/gossipQueues/linear.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/linear.js.map +1 -1
- package/lib/network/processor/gossipQueues/types.js +4 -2
- package/lib/network/processor/gossipQueues/types.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +1 -1
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +4 -2
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/processor/types.d.ts +1 -1
- package/lib/network/processor/types.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js +3 -2
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +3 -2
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +3 -2
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientBootstrap.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientFinalityUpdate.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js.map +1 -1
- package/lib/network/reqresp/interface.js +2 -1
- package/lib/network/reqresp/interface.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js.map +1 -1
- 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 +0 -1
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.js +4 -2
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/network/reqresp/utils/collect.d.ts +1 -1
- package/lib/network/reqresp/utils/collect.js.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +2 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts.map +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
- package/lib/network/statusCache.d.ts.map +1 -1
- package/lib/network/statusCache.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts.map +1 -1
- package/lib/network/subnets/attnetsService.js +2 -1
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/network/subnets/interface.js.map +1 -1
- package/lib/network/subnets/syncnetsService.d.ts.map +1 -1
- package/lib/network/subnets/syncnetsService.js.map +1 -1
- package/lib/network/subnets/util.js.map +1 -1
- package/lib/network/util.js +2 -2
- package/lib/network/util.js.map +1 -1
- package/lib/node/nodejs.d.ts +4 -6
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +8 -5
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.js.map +1 -1
- package/lib/node/utils/interop/deposits.js.map +1 -1
- package/lib/node/utils/interop/state.d.ts +1 -1
- package/lib/node/utils/interop/state.d.ts.map +1 -1
- package/lib/node/utils/interop/state.js.map +1 -1
- package/lib/node/utils/lightclient.js.map +1 -1
- package/lib/node/utils/state.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +1 -10
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +6 -3
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/backfill/errors.js +2 -1
- package/lib/sync/backfill/errors.js.map +1 -1
- package/lib/sync/backfill/verify.js.map +1 -1
- package/lib/sync/interface.js +2 -1
- package/lib/sync/interface.js.map +1 -1
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +4 -2
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +0 -10
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +2 -1
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/range.d.ts +1 -3
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +5 -2
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/range/utils/batches.js.map +1 -1
- package/lib/sync/range/utils/chainTarget.js.map +1 -1
- package/lib/sync/range/utils/hashBlocks.js.map +1 -1
- package/lib/sync/range/utils/peerBalancer.d.ts.map +1 -1
- package/lib/sync/range/utils/peerBalancer.js.map +1 -1
- package/lib/sync/range/utils/updateChains.js.map +1 -1
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/types.js +4 -2
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +0 -14
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +8 -5
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +8 -6
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +8 -8
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +3 -2
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
- package/lib/sync/utils/remoteSyncType.d.ts +1 -1
- package/lib/sync/utils/remoteSyncType.d.ts.map +1 -1
- package/lib/sync/utils/remoteSyncType.js +4 -2
- package/lib/sync/utils/remoteSyncType.js.map +1 -1
- package/lib/util/address.js.map +1 -1
- package/lib/util/array.d.ts.map +1 -1
- package/lib/util/array.js.map +1 -1
- package/lib/util/asyncIterableToEvents.d.ts.map +1 -1
- package/lib/util/asyncIterableToEvents.js +2 -1
- package/lib/util/asyncIterableToEvents.js.map +1 -1
- package/lib/util/binarySearch.d.ts.map +1 -1
- package/lib/util/binarySearch.js.map +1 -1
- package/lib/util/bitArray.js +2 -1
- package/lib/util/bitArray.js.map +1 -1
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/bufferPool.d.ts.map +1 -1
- package/lib/util/bufferPool.js +2 -1
- package/lib/util/bufferPool.js.map +1 -1
- package/lib/util/chunkify.js.map +1 -1
- package/lib/util/clock.d.ts +6 -0
- package/lib/util/clock.d.ts.map +1 -1
- package/lib/util/clock.js +11 -4
- package/lib/util/clock.js.map +1 -1
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +9 -3
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/dependentRoot.js.map +1 -1
- package/lib/util/enum.js.map +1 -1
- package/lib/util/error.js.map +1 -1
- package/lib/util/eventLoop.js.map +1 -1
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +19 -9
- package/lib/util/execution.js.map +1 -1
- package/lib/util/file.js.map +1 -1
- package/lib/util/forkChoice.js.map +1 -1
- package/lib/util/forkName.js.map +1 -1
- package/lib/util/graffiti.js.map +1 -1
- package/lib/util/hex.js.map +1 -1
- package/lib/util/ip.js.map +1 -1
- package/lib/util/itTrigger.d.ts.map +1 -1
- package/lib/util/itTrigger.js.map +1 -1
- package/lib/util/map.d.ts.map +1 -1
- package/lib/util/map.js.map +1 -1
- package/lib/util/metadata.js.map +1 -1
- package/lib/util/multifork.js.map +1 -1
- package/lib/util/numpy.js.map +1 -1
- package/lib/util/peerId.js.map +1 -1
- package/lib/util/profile.js +2 -1
- package/lib/util/profile.js.map +1 -1
- package/lib/util/promises.js.map +1 -1
- package/lib/util/queue/errors.js +2 -1
- package/lib/util/queue/errors.js.map +1 -1
- package/lib/util/queue/fnQueue.d.ts.map +1 -1
- package/lib/util/queue/fnQueue.js.map +1 -1
- package/lib/util/queue/itemQueue.d.ts.map +1 -1
- package/lib/util/queue/itemQueue.js.map +1 -1
- package/lib/util/queue/options.js +2 -1
- package/lib/util/queue/options.js.map +1 -1
- package/lib/util/serializedCache.d.ts +4 -4
- package/lib/util/serializedCache.d.ts.map +1 -1
- package/lib/util/serializedCache.js +6 -4
- package/lib/util/serializedCache.js.map +1 -1
- package/lib/util/set.d.ts.map +1 -1
- package/lib/util/set.js.map +1 -1
- package/lib/util/shuffle.js.map +1 -1
- package/lib/util/sortBy.js.map +1 -1
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/time.js.map +1 -1
- package/lib/util/timeSeries.d.ts.map +1 -1
- package/lib/util/timeSeries.js.map +1 -1
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/workerEvents.d.ts +1 -1
- package/lib/util/workerEvents.d.ts.map +1 -1
- package/lib/util/workerEvents.js.map +1 -1
- package/lib/util/wrapError.js.map +1 -1
- package/package.json +42 -44
- package/src/api/impl/beacon/blocks/index.ts +14 -2
- package/src/api/impl/beacon/state/index.ts +8 -8
- package/src/api/impl/beacon/state/utils.ts +17 -31
- package/src/api/impl/debug/index.ts +1 -0
- package/src/api/impl/node/utils.ts +3 -3
- package/src/api/impl/validator/index.ts +36 -19
- package/src/chain/archiveStore/archiveStore.ts +5 -15
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -11
- package/src/chain/archiveStore/historicalState/worker.ts +3 -3
- package/src/chain/archiveStore/interface.ts +4 -4
- package/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +8 -5
- package/src/chain/archiveStore/utils/archiveBlocks.ts +62 -5
- package/src/chain/archiveStore/utils/updateBackfillRange.ts +1 -1
- package/src/chain/blocks/blockInput/blockInput.ts +103 -3
- package/src/chain/blocks/blockInput/types.ts +18 -0
- package/src/chain/blocks/importBlock.ts +47 -11
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +3 -0
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -2
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +7 -2
- package/src/chain/blocks/writeBlockInputToDb.ts +105 -104
- package/src/chain/bls/multithread/index.ts +7 -7
- package/src/chain/bls/multithread/jobItem.ts +3 -3
- package/src/chain/bls/singleThread.ts +5 -5
- package/src/chain/bls/utils.ts +8 -5
- package/src/chain/chain.ts +67 -47
- package/src/chain/emitter.ts +3 -3
- package/src/chain/errors/executionPayloadBid.ts +1 -1
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
- package/src/chain/errors/payloadAttestation.ts +1 -1
- package/src/chain/forkChoice/index.ts +39 -21
- package/src/chain/interface.ts +4 -11
- package/src/chain/opPools/aggregatedAttestationPool.ts +1 -1
- package/src/chain/prepareNextSlot.ts +6 -2
- package/src/chain/produceBlock/computeNewStateRoot.ts +4 -3
- package/src/chain/produceBlock/produceBlockBody.ts +18 -5
- package/src/chain/regen/errors.ts +6 -1
- package/src/chain/regen/interface.ts +12 -6
- package/src/chain/regen/queued.ts +55 -14
- package/src/chain/regen/regen.ts +46 -10
- package/src/chain/seenCache/seenGossipBlockInput.ts +56 -18
- 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 +10 -4
- package/src/chain/stateCache/persistentCheckpointsCache.ts +248 -139
- package/src/chain/stateCache/types.ts +18 -8
- package/src/chain/validation/aggregateAndProof.ts +1 -1
- package/src/chain/validation/attestation.ts +14 -7
- package/src/chain/validation/attesterSlashing.ts +10 -1
- package/src/chain/validation/blobSidecar.ts +2 -2
- package/src/chain/validation/block.ts +9 -4
- package/src/chain/validation/dataColumnSidecar.ts +147 -127
- package/src/chain/validation/executionPayloadBid.ts +1 -2
- package/src/chain/validation/executionPayloadEnvelope.ts +4 -4
- package/src/chain/validation/payloadAttestationMessage.ts +10 -3
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +1 -1
- package/src/db/index.ts +1 -0
- package/src/db/repositories/blockArchive.ts +1 -2
- package/src/execution/engine/http.ts +3 -0
- package/src/metrics/metrics/beacon.ts +9 -3
- package/src/metrics/metrics/lodestar.ts +39 -24
- package/src/monitoring/service.ts +3 -2
- package/src/network/core/networkCore.ts +3 -3
- package/src/network/core/networkCoreWorkerHandler.ts +3 -3
- package/src/network/core/types.ts +2 -2
- package/src/network/discv5/utils.ts +5 -4
- package/src/network/events.ts +2 -1
- package/src/network/gossip/encoding.ts +3 -3
- package/src/network/gossip/gossipsub.ts +98 -32
- package/src/network/gossip/interface.ts +3 -3
- package/src/network/gossip/scoringParameters.ts +4 -4
- package/src/network/interface.ts +3 -3
- package/src/network/libp2p/index.ts +48 -21
- package/src/network/metadata.ts +1 -0
- package/src/network/network.ts +5 -4
- package/src/network/options.ts +8 -1
- package/src/network/peers/datastore.ts +13 -10
- package/src/network/peers/discover.ts +46 -11
- package/src/network/peers/peerManager.ts +118 -54
- package/src/network/peers/utils/prioritizePeers.ts +3 -3
- package/src/network/processor/gossipHandlers.ts +12 -3
- package/src/network/processor/gossipValidatorFn.ts +2 -2
- package/src/network/processor/types.ts +1 -1
- package/src/network/reqresp/ReqRespBeaconNode.ts +1 -1
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +4 -3
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +3 -2
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +1 -1
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -3
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +2 -2
- package/src/network/reqresp/score.ts +0 -1
- package/src/network/reqresp/utils/collect.ts +1 -1
- package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +1 -1
- package/src/network/util.ts +2 -2
- package/src/node/nodejs.ts +8 -9
- package/src/sync/range/range.ts +1 -0
- package/src/sync/utils/downloadByRange.ts +12 -3
- package/src/sync/utils/downloadByRoot.ts +2 -2
- package/src/sync/utils/remoteSyncType.ts +1 -1
- package/src/util/clock.ts +9 -4
- package/src/util/dataColumns.ts +6 -2
- package/src/util/execution.ts +23 -12
- package/src/util/serializedCache.ts +7 -5
- package/src/util/workerEvents.ts +1 -1
- 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/src/chain/archiveStore/utils/archivePayloads.ts +0 -15
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
BUILDER_INDEX_SELF_BUILD,
|
|
5
5
|
ForkName,
|
|
6
6
|
ForkPostBellatrix,
|
|
7
|
+
ForkPostCapella,
|
|
7
8
|
ForkPostDeneb,
|
|
8
9
|
ForkPostFulu,
|
|
9
10
|
ForkPostGloas,
|
|
@@ -510,9 +511,16 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
510
511
|
// NOTE: Even though the fulu.BlobsBundle type is superficially the same as deneb.BlobsBundle, it is NOT.
|
|
511
512
|
// In fulu, proofs are _cell_ proofs, vs in deneb they are _blob_ proofs.
|
|
512
513
|
|
|
514
|
+
const timer = this?.metrics?.peerDas.dataColumnSidecarComputationTime.startTimer();
|
|
513
515
|
const cells = blobsBundle.blobs.map((blob) => kzg.computeCells(blob));
|
|
516
|
+
timer?.();
|
|
514
517
|
if (this.opts.sanityCheckExecutionEngineBlobs) {
|
|
515
|
-
|
|
518
|
+
const validationTimer = this.metrics?.peerDas.kzgVerificationDataColumnBatchTime.startTimer();
|
|
519
|
+
try {
|
|
520
|
+
await validateCellsAndKzgCommitments(blobsBundle.commitments, blobsBundle.proofs, cells);
|
|
521
|
+
} finally {
|
|
522
|
+
validationTimer?.();
|
|
523
|
+
}
|
|
516
524
|
}
|
|
517
525
|
|
|
518
526
|
(blockBody as deneb.BeaconBlockBody).blobKzgCommitments = blobsBundle.commitments;
|
|
@@ -567,8 +575,14 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
567
575
|
});
|
|
568
576
|
}
|
|
569
577
|
|
|
570
|
-
if (ForkSeq[fork] >= ForkSeq.
|
|
571
|
-
const {blsToExecutionChanges,
|
|
578
|
+
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
579
|
+
const {blsToExecutionChanges, payloadAttestations} = blockBody as BeaconBlockBody<ForkPostGloas>;
|
|
580
|
+
Object.assign(logMeta, {
|
|
581
|
+
blsToExecutionChanges: blsToExecutionChanges.length,
|
|
582
|
+
payloadAttestations: payloadAttestations.length,
|
|
583
|
+
});
|
|
584
|
+
} else if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
585
|
+
const {blsToExecutionChanges, executionPayload} = blockBody as BeaconBlockBody<ForkPostCapella & ForkPreGloas>;
|
|
572
586
|
Object.assign(logMeta, {
|
|
573
587
|
blsToExecutionChanges: blsToExecutionChanges.length,
|
|
574
588
|
});
|
|
@@ -716,8 +730,7 @@ export function getPayloadAttributesForSSE(
|
|
|
716
730
|
|
|
717
731
|
let parentBlockNumber: number;
|
|
718
732
|
if (isForkPostGloas(fork)) {
|
|
719
|
-
|
|
720
|
-
const parentBlock = chain.forkChoice.getBlock(parentBlockRoot);
|
|
733
|
+
const parentBlock = chain.forkChoice.getBlockHexAndBlockHash(toRootHex(parentBlockRoot), toRootHex(parentHash));
|
|
721
734
|
if (parentBlock?.executionPayloadBlockHash == null) {
|
|
722
735
|
throw Error(`Parent block not found in fork choice root=${toRootHex(parentBlockRoot)}`);
|
|
723
736
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {PayloadStatus} from "@lodestar/fork-choice";
|
|
1
2
|
import {Root, RootHex, Slot} from "@lodestar/types";
|
|
2
3
|
|
|
3
4
|
export enum RegenErrorCode {
|
|
@@ -9,6 +10,8 @@ export enum RegenErrorCode {
|
|
|
9
10
|
BLOCK_NOT_IN_DB = "REGEN_ERROR_BLOCK_NOT_IN_DB",
|
|
10
11
|
STATE_TRANSITION_ERROR = "REGEN_ERROR_STATE_TRANSITION_ERROR",
|
|
11
12
|
INVALID_STATE_ROOT = "REGEN_ERROR_INVALID_STATE_ROOT",
|
|
13
|
+
UNEXPECTED_PAYLOAD_STATUS = "REGEN_ERROR_UNEXPECTED_PAYLOAD_STATUS",
|
|
14
|
+
INTERNAL_ERROR = "REGEN_ERROR_INTERNAL_ERROR",
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
export type RegenErrorType =
|
|
@@ -19,7 +22,9 @@ export type RegenErrorType =
|
|
|
19
22
|
| {code: RegenErrorCode.TOO_MANY_BLOCK_PROCESSED; stateRoot: RootHex | Root}
|
|
20
23
|
| {code: RegenErrorCode.BLOCK_NOT_IN_DB; blockRoot: RootHex | Root}
|
|
21
24
|
| {code: RegenErrorCode.STATE_TRANSITION_ERROR; error: Error}
|
|
22
|
-
| {code: RegenErrorCode.INVALID_STATE_ROOT; slot: Slot; expected: RootHex; actual: RootHex}
|
|
25
|
+
| {code: RegenErrorCode.INVALID_STATE_ROOT; slot: Slot; expected: RootHex; actual: RootHex}
|
|
26
|
+
| {code: RegenErrorCode.UNEXPECTED_PAYLOAD_STATUS; blockRoot: RootHex | Root; payloadStatus: PayloadStatus}
|
|
27
|
+
| {code: RegenErrorCode.INTERNAL_ERROR; message: string};
|
|
23
28
|
|
|
24
29
|
export class RegenError extends Error {
|
|
25
30
|
type: RegenErrorType;
|
|
@@ -2,7 +2,7 @@ import {routes} from "@lodestar/api";
|
|
|
2
2
|
import {ProtoBlock} from "@lodestar/fork-choice";
|
|
3
3
|
import {CachedBeaconStateAllForks} from "@lodestar/state-transition";
|
|
4
4
|
import {BeaconBlock, Epoch, RootHex, Slot, phase0} from "@lodestar/types";
|
|
5
|
-
import {
|
|
5
|
+
import {CheckpointHexPayload} from "../stateCache/types.js";
|
|
6
6
|
|
|
7
7
|
export enum RegenCaller {
|
|
8
8
|
getDuties = "getDuties",
|
|
@@ -38,15 +38,21 @@ export interface IStateRegenerator extends IStateRegeneratorInternal {
|
|
|
38
38
|
dumpCacheSummary(): routes.lodestar.StateCacheItem[];
|
|
39
39
|
getStateSync(stateRoot: RootHex): CachedBeaconStateAllForks | null;
|
|
40
40
|
getPreStateSync(block: BeaconBlock): CachedBeaconStateAllForks | null;
|
|
41
|
-
getCheckpointStateOrBytes(cp:
|
|
42
|
-
getCheckpointStateSync(cp:
|
|
41
|
+
getCheckpointStateOrBytes(cp: CheckpointHexPayload): Promise<CachedBeaconStateAllForks | Uint8Array | null>;
|
|
42
|
+
getCheckpointStateSync(cp: CheckpointHexPayload): CachedBeaconStateAllForks | null;
|
|
43
43
|
getClosestHeadState(head: ProtoBlock): CachedBeaconStateAllForks | null;
|
|
44
44
|
pruneOnCheckpoint(finalizedEpoch: Epoch, justifiedEpoch: Epoch, headStateRoot: RootHex): void;
|
|
45
45
|
pruneOnFinalized(finalizedEpoch: Epoch): void;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
processBlockState(blockRootHex: RootHex, postState: CachedBeaconStateAllForks): void;
|
|
47
|
+
processPayloadState(payloadState: CachedBeaconStateAllForks): void;
|
|
48
|
+
/**
|
|
49
|
+
* payloadPresent is true if this is payload state, false if block state.
|
|
50
|
+
* payloadPresent is always true for pre-gloas.
|
|
51
|
+
*/
|
|
52
|
+
addCheckpointState(cp: phase0.Checkpoint, item: CachedBeaconStateAllForks, payloadPresent: boolean): void;
|
|
48
53
|
updateHeadState(newHead: ProtoBlock, maybeHeadState: CachedBeaconStateAllForks): void;
|
|
49
|
-
updatePreComputedCheckpoint(rootHex: RootHex, epoch: Epoch): number | null;
|
|
54
|
+
updatePreComputedCheckpoint(rootHex: RootHex, epoch: Epoch, payloadPresent: boolean): number | null;
|
|
55
|
+
upgradeForGloas(epoch: Epoch): void;
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
|
-
import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
|
+
import {IForkChoice, PayloadStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
3
3
|
import {CachedBeaconStateAllForks, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
4
|
-
import {BeaconBlock, Epoch, RootHex, Slot, phase0} from "@lodestar/types";
|
|
5
|
-
import {Logger, toRootHex} from "@lodestar/utils";
|
|
4
|
+
import {BeaconBlock, Epoch, RootHex, Slot, isGloasBeaconBlock, phase0} from "@lodestar/types";
|
|
5
|
+
import {Logger, fromHex, toRootHex} from "@lodestar/utils";
|
|
6
6
|
import {Metrics} from "../../metrics/index.js";
|
|
7
7
|
import {JobItemQueue} from "../../util/queue/index.js";
|
|
8
|
-
import {BlockStateCache,
|
|
8
|
+
import {BlockStateCache, CheckpointHexPayload, CheckpointStateCache} from "../stateCache/types.js";
|
|
9
9
|
import {RegenError, RegenErrorCode} from "./errors.js";
|
|
10
10
|
import {
|
|
11
11
|
IStateRegenerator,
|
|
@@ -88,7 +88,12 @@ export class QueuedStateRegenerator implements IStateRegenerator {
|
|
|
88
88
|
*/
|
|
89
89
|
getPreStateSync(block: BeaconBlock): CachedBeaconStateAllForks | null {
|
|
90
90
|
const parentRoot = toRootHex(block.parentRoot);
|
|
91
|
-
const parentBlock =
|
|
91
|
+
const parentBlock = isGloasBeaconBlock(block)
|
|
92
|
+
? this.forkChoice.getBlockHexAndBlockHash(
|
|
93
|
+
parentRoot,
|
|
94
|
+
toRootHex(block.body.signedExecutionPayloadBid.message.parentBlockHash)
|
|
95
|
+
)
|
|
96
|
+
: this.forkChoice.getBlockHexDefaultStatus(parentRoot);
|
|
92
97
|
if (!parentBlock) {
|
|
93
98
|
throw new RegenError({
|
|
94
99
|
code: RegenErrorCode.BLOCK_NOT_IN_FORKCHOICE,
|
|
@@ -99,9 +104,19 @@ export class QueuedStateRegenerator implements IStateRegenerator {
|
|
|
99
104
|
const parentEpoch = computeEpochAtSlot(parentBlock.slot);
|
|
100
105
|
const blockEpoch = computeEpochAtSlot(block.slot);
|
|
101
106
|
|
|
107
|
+
// Convert PayloadStatus to payloadPresent boolean
|
|
108
|
+
if (parentBlock.payloadStatus === PayloadStatus.PENDING) {
|
|
109
|
+
throw new RegenError({
|
|
110
|
+
code: RegenErrorCode.UNEXPECTED_PAYLOAD_STATUS,
|
|
111
|
+
blockRoot: block.parentRoot,
|
|
112
|
+
payloadStatus: parentBlock.payloadStatus,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const payloadPresent = parentBlock.payloadStatus === PayloadStatus.FULL;
|
|
116
|
+
|
|
102
117
|
// Check the checkpoint cache (if the pre-state is a checkpoint state)
|
|
103
118
|
if (parentEpoch < blockEpoch) {
|
|
104
|
-
const checkpointState = this.checkpointStateCache.getLatest(parentRoot, blockEpoch);
|
|
119
|
+
const checkpointState = this.checkpointStateCache.getLatest(parentRoot, blockEpoch, payloadPresent);
|
|
105
120
|
if (checkpointState && computeEpochAtSlot(checkpointState.slot) === blockEpoch) {
|
|
106
121
|
return checkpointState;
|
|
107
122
|
}
|
|
@@ -120,14 +135,14 @@ export class QueuedStateRegenerator implements IStateRegenerator {
|
|
|
120
135
|
return null;
|
|
121
136
|
}
|
|
122
137
|
|
|
123
|
-
async getCheckpointStateOrBytes(cp:
|
|
138
|
+
async getCheckpointStateOrBytes(cp: CheckpointHexPayload): Promise<CachedBeaconStateAllForks | Uint8Array | null> {
|
|
124
139
|
return this.checkpointStateCache.getStateOrBytes(cp);
|
|
125
140
|
}
|
|
126
141
|
|
|
127
142
|
/**
|
|
128
143
|
* Get checkpoint state from cache
|
|
129
144
|
*/
|
|
130
|
-
getCheckpointStateSync(cp:
|
|
145
|
+
getCheckpointStateSync(cp: CheckpointHexPayload): CachedBeaconStateAllForks | null {
|
|
131
146
|
return this.checkpointStateCache.get(cp);
|
|
132
147
|
}
|
|
133
148
|
|
|
@@ -135,7 +150,19 @@ export class QueuedStateRegenerator implements IStateRegenerator {
|
|
|
135
150
|
* Get state closest to head
|
|
136
151
|
*/
|
|
137
152
|
getClosestHeadState(head: ProtoBlock): CachedBeaconStateAllForks | null {
|
|
138
|
-
|
|
153
|
+
// Convert PayloadStatus to payloadPresent boolean
|
|
154
|
+
if (head.payloadStatus === PayloadStatus.PENDING) {
|
|
155
|
+
throw new RegenError({
|
|
156
|
+
code: RegenErrorCode.UNEXPECTED_PAYLOAD_STATUS,
|
|
157
|
+
blockRoot: fromHex(head.blockRoot),
|
|
158
|
+
payloadStatus: head.payloadStatus,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const payloadPresent = head.payloadStatus === PayloadStatus.FULL;
|
|
162
|
+
return (
|
|
163
|
+
this.checkpointStateCache.getLatest(head.blockRoot, Infinity, payloadPresent) ||
|
|
164
|
+
this.blockStateCache.get(head.stateRoot)
|
|
165
|
+
);
|
|
139
166
|
}
|
|
140
167
|
|
|
141
168
|
pruneOnCheckpoint(finalizedEpoch: Epoch, justifiedEpoch: Epoch, headStateRoot: RootHex): void {
|
|
@@ -148,15 +175,24 @@ export class QueuedStateRegenerator implements IStateRegenerator {
|
|
|
148
175
|
this.blockStateCache.deleteAllBeforeEpoch(finalizedEpoch);
|
|
149
176
|
}
|
|
150
177
|
|
|
151
|
-
|
|
178
|
+
processBlockState(blockRootHex: RootHex, postState: CachedBeaconStateAllForks): void {
|
|
152
179
|
this.blockStateCache.add(postState);
|
|
153
180
|
this.checkpointStateCache.processState(blockRootHex, postState).catch((e) => {
|
|
154
181
|
this.logger.debug("Error processing block state", {blockRootHex, slot: postState.slot}, e);
|
|
155
182
|
});
|
|
156
183
|
}
|
|
157
184
|
|
|
158
|
-
|
|
159
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Process payload state for caching after importing execution payload.
|
|
187
|
+
*/
|
|
188
|
+
processPayloadState(payloadState: CachedBeaconStateAllForks): void {
|
|
189
|
+
// Add payload state to block state cache (keyed by payload state root)
|
|
190
|
+
this.blockStateCache.add(payloadState);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// TODO GLOAS: This should also be called when importing execution payload after we implement it
|
|
194
|
+
addCheckpointState(cp: phase0.Checkpoint, item: CachedBeaconStateAllForks, payloadPresent: boolean): void {
|
|
195
|
+
this.checkpointStateCache.add(cp, item, payloadPresent);
|
|
160
196
|
}
|
|
161
197
|
|
|
162
198
|
updateHeadState(newHead: ProtoBlock, maybeHeadState: CachedBeaconStateAllForks): void {
|
|
@@ -192,8 +228,13 @@ export class QueuedStateRegenerator implements IStateRegenerator {
|
|
|
192
228
|
}
|
|
193
229
|
}
|
|
194
230
|
|
|
195
|
-
updatePreComputedCheckpoint(rootHex: RootHex, epoch: Epoch): number | null {
|
|
196
|
-
return this.checkpointStateCache.updatePreComputedCheckpoint(rootHex, epoch);
|
|
231
|
+
updatePreComputedCheckpoint(rootHex: RootHex, epoch: Epoch, payloadPresent: boolean): number | null {
|
|
232
|
+
return this.checkpointStateCache.updatePreComputedCheckpoint(rootHex, epoch, payloadPresent);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
upgradeForGloas(epoch: Epoch): void {
|
|
236
|
+
this.logger.verbose("Upgrading block state cache for Gloas fork", {epoch});
|
|
237
|
+
this.blockStateCache.upgradeToGloas();
|
|
197
238
|
}
|
|
198
239
|
|
|
199
240
|
/**
|
package/src/chain/regen/regen.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
|
|
3
|
-
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
|
+
import {IForkChoice, PayloadStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
3
|
+
import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
4
4
|
import {
|
|
5
5
|
CachedBeaconStateAllForks,
|
|
6
6
|
DataAvailabilityStatus,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
processSlots,
|
|
12
12
|
stateTransition,
|
|
13
13
|
} from "@lodestar/state-transition";
|
|
14
|
-
import {BeaconBlock, RootHex, SignedBeaconBlock, Slot} from "@lodestar/types";
|
|
14
|
+
import {BeaconBlock, RootHex, SignedBeaconBlock, Slot, isGloasBeaconBlock} from "@lodestar/types";
|
|
15
15
|
import {Logger, fromHex, toRootHex} from "@lodestar/utils";
|
|
16
16
|
import {IBeaconDb} from "../../db/index.js";
|
|
17
17
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -58,7 +58,13 @@ export class StateRegenerator implements IStateRegeneratorInternal {
|
|
|
58
58
|
opts: StateRegenerationOpts,
|
|
59
59
|
regenCaller: RegenCaller
|
|
60
60
|
): Promise<CachedBeaconStateAllForks> {
|
|
61
|
-
const
|
|
61
|
+
const parentRoot = toRootHex(block.parentRoot);
|
|
62
|
+
const parentBlock = isGloasBeaconBlock(block)
|
|
63
|
+
? this.modules.forkChoice.getBlockHexAndBlockHash(
|
|
64
|
+
parentRoot,
|
|
65
|
+
toRootHex(block.body.signedExecutionPayloadBid.message.parentBlockHash)
|
|
66
|
+
)
|
|
67
|
+
: this.modules.forkChoice.getBlockHexDefaultStatus(parentRoot);
|
|
62
68
|
if (!parentBlock) {
|
|
63
69
|
throw new RegenError({
|
|
64
70
|
code: RegenErrorCode.BLOCK_NOT_IN_FORKCHOICE,
|
|
@@ -105,9 +111,20 @@ export class StateRegenerator implements IStateRegeneratorInternal {
|
|
|
105
111
|
const {blockRoot} = block;
|
|
106
112
|
const {checkpointStateCache} = this.modules;
|
|
107
113
|
const epoch = computeEpochAtSlot(slot);
|
|
114
|
+
|
|
115
|
+
// Convert PayloadStatus to payloadPresent boolean
|
|
116
|
+
if (block.payloadStatus === PayloadStatus.PENDING) {
|
|
117
|
+
throw new RegenError({
|
|
118
|
+
code: RegenErrorCode.UNEXPECTED_PAYLOAD_STATUS,
|
|
119
|
+
blockRoot: fromHex(blockRoot),
|
|
120
|
+
payloadStatus: block.payloadStatus,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
const payloadPresent = block.payloadStatus === PayloadStatus.FULL;
|
|
124
|
+
|
|
108
125
|
const latestCheckpointStateCtx = allowDiskReload
|
|
109
|
-
? await checkpointStateCache.getOrReloadLatest(blockRoot, epoch)
|
|
110
|
-
: checkpointStateCache.getLatest(blockRoot, epoch);
|
|
126
|
+
? await checkpointStateCache.getOrReloadLatest(blockRoot, epoch, payloadPresent)
|
|
127
|
+
: checkpointStateCache.getLatest(blockRoot, epoch, payloadPresent);
|
|
111
128
|
|
|
112
129
|
// If a checkpoint state exists with the given checkpoint root, it either is in requested epoch
|
|
113
130
|
// or needs to have empty slots processed until the requested epoch
|
|
@@ -152,7 +169,7 @@ export class StateRegenerator implements IStateRegeneratorInternal {
|
|
|
152
169
|
|
|
153
170
|
const getSeedStateTimer = this.modules.metrics?.regenGetState.getSeedState.startTimer({caller});
|
|
154
171
|
// iterateAncestorBlocks only returns ancestor blocks, not the block itself
|
|
155
|
-
for (const b of this.modules.forkChoice.iterateAncestorBlocks(block.blockRoot)) {
|
|
172
|
+
for (const b of this.modules.forkChoice.iterateAncestorBlocks(block.blockRoot, block.payloadStatus)) {
|
|
156
173
|
state = this.modules.blockStateCache.get(b.stateRoot);
|
|
157
174
|
if (state) {
|
|
158
175
|
break;
|
|
@@ -160,9 +177,19 @@ export class StateRegenerator implements IStateRegeneratorInternal {
|
|
|
160
177
|
const lastBlockToReplay = blocksToReplay.at(-1);
|
|
161
178
|
if (!lastBlockToReplay) continue;
|
|
162
179
|
const epoch = computeEpochAtSlot(lastBlockToReplay.slot - 1);
|
|
180
|
+
|
|
181
|
+
// Convert PayloadStatus to payloadPresent boolean
|
|
182
|
+
if (b.payloadStatus === PayloadStatus.PENDING) {
|
|
183
|
+
throw new RegenError({
|
|
184
|
+
code: RegenErrorCode.INTERNAL_ERROR,
|
|
185
|
+
message: `Unexpected PENDING payloadStatus for ancestor block ${b.blockRoot} at slot ${b.slot}`,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
const payloadPresent = b.payloadStatus === PayloadStatus.FULL;
|
|
189
|
+
|
|
163
190
|
state = allowDiskReload
|
|
164
|
-
? await checkpointStateCache.getOrReloadLatest(b.blockRoot, epoch)
|
|
165
|
-
: checkpointStateCache.getLatest(b.blockRoot, epoch);
|
|
191
|
+
? await checkpointStateCache.getOrReloadLatest(b.blockRoot, epoch, payloadPresent)
|
|
192
|
+
: checkpointStateCache.getLatest(b.blockRoot, epoch, payloadPresent);
|
|
166
193
|
if (state) {
|
|
167
194
|
break;
|
|
168
195
|
}
|
|
@@ -326,6 +353,11 @@ async function processSlotsByCheckpoint(
|
|
|
326
353
|
* emitting "checkpoint" events after every epoch processed.
|
|
327
354
|
*
|
|
328
355
|
* Stops processing after no more full epochs can be processed.
|
|
356
|
+
*
|
|
357
|
+
* Output state variant:
|
|
358
|
+
* - Post-Gloas: If slots are processed, returns block state (payloadPresent=false).
|
|
359
|
+
* If no slots processed, returns preState as-is (preserves variant).
|
|
360
|
+
* - Pre-Gloas: Always payloadPresent=true (no block/payload distinction).
|
|
329
361
|
*/
|
|
330
362
|
export async function processSlotsToNearestCheckpoint(
|
|
331
363
|
modules: {
|
|
@@ -368,7 +400,11 @@ export async function processSlotsToNearestCheckpoint(
|
|
|
368
400
|
// This may becomes the "official" checkpoint state if the 1st block of epoch is skipped
|
|
369
401
|
const checkpointState = postState;
|
|
370
402
|
const cp = getCheckpointFromState(checkpointState);
|
|
371
|
-
|
|
403
|
+
// processSlots() only does epoch transitions, never processes payloads
|
|
404
|
+
// Pre-Gloas: payloadPresent is always true (execution payload embedded in block)
|
|
405
|
+
// Post-Gloas: result is a block state (payloadPresent=false)
|
|
406
|
+
const isPayloadPresent = checkpointState.config.getForkSeq(checkpointState.slot) < ForkSeq.gloas;
|
|
407
|
+
checkpointStateCache.add(cp, checkpointState, isPayloadPresent);
|
|
372
408
|
// consumers should not mutate state ever
|
|
373
409
|
emitter?.emit(ChainEvent.checkpoint, cp, checkpointState);
|
|
374
410
|
|
|
@@ -3,6 +3,7 @@ import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
|
3
3
|
import {
|
|
4
4
|
ForkName,
|
|
5
5
|
ForkPostFulu,
|
|
6
|
+
ForkPostGloas,
|
|
6
7
|
ForkPreGloas,
|
|
7
8
|
SLOTS_PER_EPOCH,
|
|
8
9
|
isForkPostDeneb,
|
|
@@ -16,10 +17,12 @@ import {Metrics} from "../../metrics/metrics.js";
|
|
|
16
17
|
import {MAX_LOOK_AHEAD_EPOCHS} from "../../sync/constants.js";
|
|
17
18
|
import {IClock} from "../../util/clock.js";
|
|
18
19
|
import {CustodyConfig} from "../../util/dataColumns.js";
|
|
20
|
+
import {SerializedCache} from "../../util/serializedCache.js";
|
|
19
21
|
import {
|
|
20
22
|
BlockInput,
|
|
21
23
|
BlockInputBlobs,
|
|
22
24
|
BlockInputColumns,
|
|
25
|
+
BlockInputNoData,
|
|
23
26
|
BlockInputPreData,
|
|
24
27
|
BlockWithSource,
|
|
25
28
|
DAType,
|
|
@@ -53,6 +56,7 @@ export type SeenBlockInputCacheModules = {
|
|
|
53
56
|
chainEvents: ChainEventEmitter;
|
|
54
57
|
signal: AbortSignal;
|
|
55
58
|
custodyConfig: CustodyConfig;
|
|
59
|
+
serializedCache: SerializedCache;
|
|
56
60
|
metrics: Metrics | null;
|
|
57
61
|
logger?: Logger;
|
|
58
62
|
};
|
|
@@ -99,6 +103,7 @@ export class SeenBlockInput {
|
|
|
99
103
|
private readonly clock: IClock;
|
|
100
104
|
private readonly chainEvents: ChainEventEmitter;
|
|
101
105
|
private readonly signal: AbortSignal;
|
|
106
|
+
private readonly serializedCache: SerializedCache;
|
|
102
107
|
private readonly metrics: Metrics | null;
|
|
103
108
|
private readonly logger?: Logger;
|
|
104
109
|
private blockInputs = new Map<RootHex, IBlockInput>();
|
|
@@ -107,19 +112,35 @@ export class SeenBlockInput {
|
|
|
107
112
|
// and the signature to ensure we only skip verification if both match
|
|
108
113
|
private verifiedProposerSignatures = new Map<Slot, Map<RootHex, BLSSignature>>();
|
|
109
114
|
|
|
110
|
-
constructor({
|
|
115
|
+
constructor({
|
|
116
|
+
config,
|
|
117
|
+
custodyConfig,
|
|
118
|
+
clock,
|
|
119
|
+
chainEvents,
|
|
120
|
+
signal,
|
|
121
|
+
serializedCache,
|
|
122
|
+
metrics,
|
|
123
|
+
logger,
|
|
124
|
+
}: SeenBlockInputCacheModules) {
|
|
111
125
|
this.config = config;
|
|
112
126
|
this.custodyConfig = custodyConfig;
|
|
113
127
|
this.clock = clock;
|
|
114
128
|
this.chainEvents = chainEvents;
|
|
115
129
|
this.signal = signal;
|
|
130
|
+
this.serializedCache = serializedCache;
|
|
116
131
|
this.metrics = metrics;
|
|
117
132
|
this.logger = logger;
|
|
118
133
|
|
|
119
134
|
if (metrics) {
|
|
120
|
-
metrics.seenCache.blockInput.blockInputCount.addCollect(() =>
|
|
121
|
-
metrics.seenCache.blockInput.blockInputCount.set(this.blockInputs.size)
|
|
122
|
-
|
|
135
|
+
metrics.seenCache.blockInput.blockInputCount.addCollect(() => {
|
|
136
|
+
metrics.seenCache.blockInput.blockInputCount.set(this.blockInputs.size);
|
|
137
|
+
metrics.seenCache.blockInput.serializedObjectRefs.set(
|
|
138
|
+
Array.from(this.blockInputs.values()).reduce(
|
|
139
|
+
(count, blockInput) => count + blockInput.getSerializedCacheKeys().length,
|
|
140
|
+
0
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
});
|
|
123
144
|
}
|
|
124
145
|
|
|
125
146
|
this.chainEvents.on(ChainEvent.forkChoiceFinalized, this.onFinalized);
|
|
@@ -140,7 +161,10 @@ export class SeenBlockInput {
|
|
|
140
161
|
* Removes the single BlockInput from the cache
|
|
141
162
|
*/
|
|
142
163
|
remove(rootHex: RootHex): void {
|
|
143
|
-
this.blockInputs.
|
|
164
|
+
const blockInput = this.blockInputs.get(rootHex);
|
|
165
|
+
if (blockInput) {
|
|
166
|
+
this.evictBlockInput(blockInput);
|
|
167
|
+
}
|
|
144
168
|
}
|
|
145
169
|
|
|
146
170
|
/**
|
|
@@ -152,7 +176,7 @@ export class SeenBlockInput {
|
|
|
152
176
|
let deletedCount = 0;
|
|
153
177
|
while (blockInput) {
|
|
154
178
|
deletedCount++;
|
|
155
|
-
this.
|
|
179
|
+
this.evictBlockInput(blockInput);
|
|
156
180
|
blockInput = this.blockInputs.get(parentRootHex ?? "");
|
|
157
181
|
parentRootHex = blockInput?.parentRootHex;
|
|
158
182
|
}
|
|
@@ -163,10 +187,10 @@ export class SeenBlockInput {
|
|
|
163
187
|
onFinalized = (checkpoint: CheckpointWithHex) => {
|
|
164
188
|
let deletedCount = 0;
|
|
165
189
|
const cutoffSlot = computeStartSlotAtEpoch(checkpoint.epoch);
|
|
166
|
-
for (const [
|
|
190
|
+
for (const [, blockInput] of this.blockInputs) {
|
|
167
191
|
if (blockInput.slot < cutoffSlot) {
|
|
168
192
|
deletedCount++;
|
|
169
|
-
this.
|
|
193
|
+
this.evictBlockInput(blockInput);
|
|
170
194
|
}
|
|
171
195
|
}
|
|
172
196
|
this.logger?.debug(`BlockInputCache.onFinalized deleted ${deletedCount} cached BlockInputs`);
|
|
@@ -179,12 +203,19 @@ export class SeenBlockInput {
|
|
|
179
203
|
if (!blockInput) {
|
|
180
204
|
const {forkName, daOutOfRange} = this.buildCommonProps(block.message.slot);
|
|
181
205
|
|
|
182
|
-
// TODO GLOAS: Implement
|
|
183
206
|
if (isForkPostGloas(forkName)) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
207
|
+
// Post-gloas
|
|
208
|
+
blockInput = BlockInputNoData.createFromBlock({
|
|
209
|
+
block: block as SignedBeaconBlock<ForkPostGloas>,
|
|
210
|
+
blockRootHex,
|
|
211
|
+
daOutOfRange,
|
|
212
|
+
forkName,
|
|
213
|
+
source,
|
|
214
|
+
seenTimestampSec,
|
|
215
|
+
peerIdStr,
|
|
216
|
+
});
|
|
217
|
+
} else if (!isForkPostDeneb(forkName)) {
|
|
218
|
+
// Pre-deneb
|
|
188
219
|
blockInput = BlockInputPreData.createFromBlock({
|
|
189
220
|
block,
|
|
190
221
|
blockRootHex,
|
|
@@ -194,8 +225,8 @@ export class SeenBlockInput {
|
|
|
194
225
|
seenTimestampSec,
|
|
195
226
|
peerIdStr,
|
|
196
227
|
});
|
|
197
|
-
// Fulu Only
|
|
198
228
|
} else if (isForkPostFulu(forkName)) {
|
|
229
|
+
// Fulu Only
|
|
199
230
|
blockInput = BlockInputColumns.createFromBlock({
|
|
200
231
|
block: block as SignedBeaconBlock<ForkPostFulu & ForkPreGloas>,
|
|
201
232
|
blockRootHex,
|
|
@@ -207,8 +238,8 @@ export class SeenBlockInput {
|
|
|
207
238
|
seenTimestampSec,
|
|
208
239
|
peerIdStr,
|
|
209
240
|
});
|
|
210
|
-
// Deneb and Electra
|
|
211
241
|
} else {
|
|
242
|
+
// Deneb and Electra
|
|
212
243
|
blockInput = BlockInputBlobs.createFromBlock({
|
|
213
244
|
block: block as SignedBeaconBlock<ForkBlobsDA>,
|
|
214
245
|
blockRootHex,
|
|
@@ -219,6 +250,7 @@ export class SeenBlockInput {
|
|
|
219
250
|
peerIdStr,
|
|
220
251
|
});
|
|
221
252
|
}
|
|
253
|
+
this.metrics?.seenCache.blockInput.createdByBlock.inc();
|
|
222
254
|
this.blockInputs.set(blockInput.blockRootHex, blockInput);
|
|
223
255
|
}
|
|
224
256
|
|
|
@@ -318,7 +350,7 @@ export class SeenBlockInput {
|
|
|
318
350
|
custodyColumns: this.custodyConfig.custodyColumns,
|
|
319
351
|
sampledColumns: this.custodyConfig.sampledColumns,
|
|
320
352
|
});
|
|
321
|
-
this.metrics?.seenCache.blockInput.
|
|
353
|
+
this.metrics?.seenCache.blockInput.createdByColumn.inc();
|
|
322
354
|
this.blockInputs.set(blockRootHex, blockInput);
|
|
323
355
|
}
|
|
324
356
|
|
|
@@ -399,14 +431,20 @@ export class SeenBlockInput {
|
|
|
399
431
|
|
|
400
432
|
if (itemsToDelete > 0) {
|
|
401
433
|
const sorted = [...this.blockInputs.entries()].sort((a, b) => a[1].slot - b[1].slot);
|
|
402
|
-
for (const [
|
|
403
|
-
this.
|
|
434
|
+
for (const [, blockInput] of sorted) {
|
|
435
|
+
this.evictBlockInput(blockInput);
|
|
404
436
|
itemsToDelete--;
|
|
405
437
|
if (itemsToDelete <= 0) return;
|
|
406
438
|
}
|
|
407
439
|
}
|
|
408
440
|
pruneSetToMax(this.verifiedProposerSignatures, MAX_BLOCK_INPUT_CACHE_SIZE);
|
|
409
441
|
}
|
|
442
|
+
|
|
443
|
+
private evictBlockInput(blockInput: IBlockInput): void {
|
|
444
|
+
// Without forcefully clearing this cache, we would rely on WeakMap to evict memory which is not reliable
|
|
445
|
+
this.serializedCache.delete(blockInput.getSerializedCacheKeys());
|
|
446
|
+
this.blockInputs.delete(blockInput.blockRootHex);
|
|
447
|
+
}
|
|
410
448
|
}
|
|
411
449
|
|
|
412
450
|
enum SeenBlockInputCacheErrorCode {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
2
|
import {Epoch, phase0, ssz} from "@lodestar/types";
|
|
3
|
-
import {MapDef} from "@lodestar/utils";
|
|
3
|
+
import {MapDef, byteArrayEquals} from "@lodestar/utils";
|
|
4
4
|
import {IBeaconDb} from "../../../db/interface.js";
|
|
5
5
|
import {
|
|
6
6
|
getLastProcessedSlotFromBeaconStateSerialized,
|
|
@@ -14,8 +14,8 @@ import {CPStateDatastore, DatastoreKey} from "./types.js";
|
|
|
14
14
|
export class DbCPStateDatastore implements CPStateDatastore {
|
|
15
15
|
constructor(private readonly db: IBeaconDb) {}
|
|
16
16
|
|
|
17
|
-
async write(cpKey: phase0.Checkpoint, stateBytes: Uint8Array): Promise<DatastoreKey> {
|
|
18
|
-
const serializedCheckpoint = checkpointToDatastoreKey(cpKey);
|
|
17
|
+
async write(cpKey: phase0.Checkpoint, stateBytes: Uint8Array, payloadPresent: boolean): Promise<DatastoreKey> {
|
|
18
|
+
const serializedCheckpoint = checkpointToDatastoreKey(cpKey, payloadPresent);
|
|
19
19
|
await this.db.checkpointState.putBinary(serializedCheckpoint, stateBytes);
|
|
20
20
|
return serializedCheckpoint;
|
|
21
21
|
}
|
|
@@ -40,18 +40,30 @@ export class DbCPStateDatastore implements CPStateDatastore {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
function extractCheckpointBytes(key: DatastoreKey): Uint8Array {
|
|
44
|
+
const fixedSize = ssz.phase0.Checkpoint.minSize;
|
|
45
|
+
return key.subarray(0, fixedSize);
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
export function datastoreKeyToCheckpoint(key: DatastoreKey): phase0.Checkpoint {
|
|
44
|
-
return ssz.phase0.Checkpoint.deserialize(key);
|
|
49
|
+
return ssz.phase0.Checkpoint.deserialize(extractCheckpointBytes(key));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function checkpointToDatastoreKey(cp: phase0.Checkpoint, payloadPresent: boolean): DatastoreKey {
|
|
53
|
+
const cpBytes = ssz.phase0.Checkpoint.serialize(cp);
|
|
54
|
+
const key = new Uint8Array(cpBytes.length + 1);
|
|
55
|
+
key.set(cpBytes);
|
|
56
|
+
key[cpBytes.length] = payloadPresent ? 1 : 0;
|
|
57
|
+
return key;
|
|
45
58
|
}
|
|
46
59
|
|
|
47
|
-
|
|
48
|
-
return
|
|
60
|
+
function isPayloadCheckpointState(key: DatastoreKey): boolean {
|
|
61
|
+
return key.at(-1) === 1;
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
/**
|
|
52
|
-
* Get the latest safe checkpoint state the node can use to boot from
|
|
53
|
-
* -
|
|
54
|
-
* - its last processed block slot should be at epoch boundary or last slot of previous epoch
|
|
65
|
+
* Get the latest "safe" checkpoint state the node can use to boot from
|
|
66
|
+
* - its last processed block slot should be at epoch boundary (CRCS) or last slot of previous epoch (PRCS)
|
|
55
67
|
* - state slot should be at epoch boundary
|
|
56
68
|
* - state slot should be equal to epoch * SLOTS_PER_EPOCH
|
|
57
69
|
*
|
|
@@ -70,9 +82,20 @@ export async function getLatestSafeDatastoreKey(
|
|
|
70
82
|
|
|
71
83
|
const dataStoreKeyByEpoch: Map<Epoch, DatastoreKey> = new Map();
|
|
72
84
|
for (const [epoch, keys] of checkpointsByEpoch.entries()) {
|
|
73
|
-
// only consider epochs with a single checkpoint to avoid ambiguity from forks
|
|
74
85
|
if (keys.length === 1) {
|
|
86
|
+
// PRCS (skipped slot) or CRCS and no payloadPresent
|
|
87
|
+
// Pre-gloas always fall into this case
|
|
75
88
|
dataStoreKeyByEpoch.set(epoch, keys[0]);
|
|
89
|
+
} else if (keys.length === 2) {
|
|
90
|
+
// CRCS without payload and CRCS with payload
|
|
91
|
+
// ie Two keys for the same checkpoint with different payloadPresent suffix (FULL/EMPTY)
|
|
92
|
+
// TODO GLOAS: Here we pick FULL key, there is a chance that payload is orphaned hence we not be able to sync
|
|
93
|
+
const cp0 = extractCheckpointBytes(keys[0]);
|
|
94
|
+
const cp1 = extractCheckpointBytes(keys[1]);
|
|
95
|
+
if (byteArrayEquals(cp0, cp1)) {
|
|
96
|
+
const fullKey = isPayloadCheckpointState(keys[0]) ? keys[0] : keys[1];
|
|
97
|
+
dataStoreKeyByEpoch.set(epoch, fullKey);
|
|
98
|
+
}
|
|
76
99
|
}
|
|
77
100
|
}
|
|
78
101
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {phase0
|
|
2
|
+
import {phase0} from "@lodestar/types";
|
|
3
3
|
import {fromHex, toHex} from "@lodestar/utils";
|
|
4
4
|
import {ensureDir, readFile, readFileNames, removeFile, writeIfNotExist} from "../../../util/file.js";
|
|
5
|
-
import {getLatestSafeDatastoreKey} from "./db.js";
|
|
5
|
+
import {checkpointToDatastoreKey, getLatestSafeDatastoreKey} from "./db.js";
|
|
6
6
|
import {CPStateDatastore, DatastoreKey} from "./types.js";
|
|
7
7
|
|
|
8
8
|
const CHECKPOINT_STATES_FOLDER = "checkpoint_states";
|
|
9
|
-
|
|
9
|
+
/** 41 bytes (40 checkpoint + 1 payloadPresent) = 82 hex chars + "0x" prefix = 84 */
|
|
10
|
+
const CHECKPOINT_FILE_NAME_LENGTH = 84;
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Implementation of CPStateDatastore using file system, this is beneficial for debugging.
|
|
@@ -28,8 +29,8 @@ export class FileCPStateDatastore implements CPStateDatastore {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
async write(cpKey: phase0.Checkpoint, stateBytes: Uint8Array): Promise<DatastoreKey> {
|
|
32
|
-
const serializedCheckpoint =
|
|
32
|
+
async write(cpKey: phase0.Checkpoint, stateBytes: Uint8Array, payloadPresent: boolean): Promise<DatastoreKey> {
|
|
33
|
+
const serializedCheckpoint = checkpointToDatastoreKey(cpKey, payloadPresent);
|
|
33
34
|
const filePath = path.join(this.folderPath, toHex(serializedCheckpoint));
|
|
34
35
|
await writeIfNotExist(filePath, stateBytes);
|
|
35
36
|
return serializedCheckpoint;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {phase0} from "@lodestar/types";
|
|
2
2
|
|
|
3
|
-
// With db implementation, persistedKey is serialized data of a checkpoint
|
|
3
|
+
// With db implementation, persistedKey is serialized data of a checkpoint + 1
|
|
4
|
+
// ie a fixed size of `ssz.phase0.Checkpoint.minSize + 1`
|
|
4
5
|
export type DatastoreKey = Uint8Array;
|
|
5
6
|
|
|
6
7
|
// Make this generic to support testing
|
|
7
8
|
export interface CPStateDatastore {
|
|
8
|
-
write: (cpKey: phase0.Checkpoint, stateBytes: Uint8Array) => Promise<DatastoreKey>;
|
|
9
|
+
write: (cpKey: phase0.Checkpoint, stateBytes: Uint8Array, payloadPresent: boolean) => Promise<DatastoreKey>;
|
|
9
10
|
remove: (key: DatastoreKey) => Promise<void>;
|
|
10
11
|
read: (key: DatastoreKey) => Promise<Uint8Array | null>;
|
|
11
12
|
readLatestSafe: () => Promise<Uint8Array | null>;
|