@lodestar/beacon-node 1.42.0-rc.0 → 1.43.0-dev.05a33e512f
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 +37 -9
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +49 -2
- 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 +13 -10
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +2 -2
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +0 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/attesterSlashing.d.ts +8 -0
- package/lib/api/impl/lodestar/attesterSlashing.d.ts.map +1 -0
- package/lib/api/impl/lodestar/attesterSlashing.js +29 -0
- package/lib/api/impl/lodestar/attesterSlashing.js.map +1 -0
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +40 -1
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +74 -5
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +1 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +1 -2
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.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 +2 -4
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +2 -2
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +110 -58
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +3 -0
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +4 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +40 -58
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +32 -14
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +107 -87
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts +5 -3
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +58 -26
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +15 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +48 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +17 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +5 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +7 -5
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +16 -21
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.d.ts +23 -2
- package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js +89 -12
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +5 -3
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +50 -7
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +0 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +8 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts +2 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +25 -5
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +4 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.d.ts +24 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js +80 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +14 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +30 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +2 -11
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -1
- package/lib/chain/chain.d.ts +9 -6
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +73 -49
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +16 -15
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -4
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +8 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +4 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +18 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +6 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +5 -0
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +5 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/index.d.ts +1 -0
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +1 -0
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/errors/proposerPreferences.d.ts +40 -0
- package/lib/chain/errors/proposerPreferences.d.ts.map +1 -0
- package/lib/chain/errors/proposerPreferences.js +14 -0
- package/lib/chain/errors/proposerPreferences.js.map +1 -0
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +21 -23
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +6 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +8 -5
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.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 +7 -0
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +5 -2
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts +3 -2
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js +26 -4
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +48 -18
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +1 -7
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +1 -28
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +15 -10
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +83 -21
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/errors.d.ts +1 -11
- package/lib/chain/regen/errors.d.ts.map +1 -1
- package/lib/chain/regen/errors.js +0 -2
- package/lib/chain/regen/errors.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +7 -12
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -0
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.d.ts +6 -11
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +9 -44
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +0 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +8 -38
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/index.d.ts +1 -0
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +1 -0
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +24 -7
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +69 -17
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/seenCache/seenProposerPreferences.d.ts +16 -0
- package/lib/chain/seenCache/seenProposerPreferences.d.ts.map +1 -0
- package/lib/chain/seenCache/seenProposerPreferences.js +26 -0
- package/lib/chain/seenCache/seenProposerPreferences.js.map +1 -0
- package/lib/chain/stateCache/datastore/db.d.ts +5 -4
- package/lib/chain/stateCache/datastore/db.d.ts.map +1 -1
- package/lib/chain/stateCache/datastore/db.js +10 -32
- 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 +1 -7
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js +0 -8
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +13 -30
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +120 -216
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +8 -15
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +12 -0
- 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 +12 -0
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +28 -5
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +30 -12
- 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 +27 -12
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +8 -4
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerPreferences.d.ts +8 -0
- package/lib/chain/validation/proposerPreferences.d.ts.map +1 -0
- package/lib/chain/validation/proposerPreferences.js +91 -0
- package/lib/chain/validation/proposerPreferences.js.map +1 -0
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +4 -0
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +4 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +3 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +21 -14
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +1 -0
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -0
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/types.d.ts +20 -0
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +18 -0
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +1 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +4 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +7 -1
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +1 -0
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
- package/lib/network/gossip/scoringParameters.js +12 -1
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +13 -2
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +6 -0
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +1 -0
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +1 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +6 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +64 -22
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +5 -0
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +6 -5
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js +16 -7
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js +2 -0
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +18 -8
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +6 -0
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +24 -8
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +9 -5
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +3 -8
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +7 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +2 -2
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/constants.d.ts +3 -1
- package/lib/sync/constants.d.ts.map +1 -1
- package/lib/sync/constants.js +3 -4
- package/lib/sync/constants.js.map +1 -1
- package/lib/sync/range/batch.d.ts +35 -5
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +240 -59
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +19 -4
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +64 -11
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +31 -9
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +13 -0
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/types.d.ts +34 -0
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +34 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +29 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +738 -61
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +67 -10
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +211 -26
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +16 -2
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.d.ts +0 -1
- package/lib/sync/utils/pendingBlocksTree.d.ts.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.js +0 -9
- package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +20 -5
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +17 -16
- package/src/api/impl/beacon/blocks/index.ts +51 -9
- package/src/api/impl/beacon/pool/index.ts +87 -1
- package/src/api/impl/beacon/state/index.ts +15 -15
- package/src/api/impl/beacon/state/utils.ts +2 -2
- package/src/api/impl/debug/index.ts +0 -1
- package/src/api/impl/lodestar/attesterSlashing.ts +43 -0
- package/src/api/impl/lodestar/index.ts +52 -2
- package/src/api/impl/validator/index.ts +91 -6
- package/src/chain/GetBlobsTracker.ts +1 -2
- package/src/chain/archiveStore/archiveStore.ts +5 -5
- package/src/chain/archiveStore/interface.ts +4 -4
- package/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +6 -8
- package/src/chain/archiveStore/utils/archiveBlocks.ts +153 -94
- package/src/chain/blocks/blockInput/blockInput.ts +4 -1
- package/src/chain/blocks/importBlock.ts +45 -86
- package/src/chain/blocks/importExecutionPayload.ts +133 -103
- package/src/chain/blocks/index.ts +72 -24
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +64 -3
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +18 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +7 -6
- package/src/chain/blocks/types.ts +16 -26
- package/src/chain/blocks/utils/chainSegment.ts +114 -17
- package/src/chain/blocks/verifyBlock.ts +70 -9
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +8 -5
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +26 -7
- package/src/chain/blocks/verifyBlocksSignatures.ts +9 -2
- package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +137 -0
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +41 -0
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +9 -18
- package/src/chain/chain.ts +102 -72
- package/src/chain/emitter.ts +15 -14
- package/src/chain/errors/attestationError.ts +6 -1
- package/src/chain/errors/blockError.ts +10 -1
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -0
- package/src/chain/errors/index.ts +1 -0
- package/src/chain/errors/proposerPreferences.ts +47 -0
- package/src/chain/forkChoice/index.ts +19 -28
- package/src/chain/initState.ts +9 -1
- package/src/chain/interface.ts +16 -3
- package/src/chain/lightClient/index.ts +15 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +6 -1
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- package/src/chain/opPools/payloadAttestationPool.ts +29 -8
- package/src/chain/prepareNextSlot.ts +58 -19
- package/src/chain/produceBlock/computeNewStateRoot.ts +1 -37
- package/src/chain/produceBlock/produceBlockBody.ts +120 -26
- package/src/chain/regen/errors.ts +1 -6
- package/src/chain/regen/interface.ts +7 -12
- package/src/chain/regen/queued.ts +14 -55
- package/src/chain/regen/regen.ts +10 -43
- package/src/chain/seenCache/index.ts +1 -0
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +89 -21
- package/src/chain/seenCache/seenProposerPreferences.ts +32 -0
- package/src/chain/stateCache/datastore/db.ts +10 -33
- package/src/chain/stateCache/datastore/file.ts +5 -6
- package/src/chain/stateCache/datastore/types.ts +2 -3
- package/src/chain/stateCache/fifoBlockStateCache.ts +1 -10
- package/src/chain/stateCache/persistentCheckpointsCache.ts +139 -247
- package/src/chain/stateCache/types.ts +8 -14
- package/src/chain/validation/aggregateAndProof.ts +13 -0
- package/src/chain/validation/attestation.ts +13 -0
- package/src/chain/validation/block.ts +31 -7
- package/src/chain/validation/executionPayloadBid.ts +32 -11
- package/src/chain/validation/executionPayloadEnvelope.ts +32 -13
- package/src/chain/validation/payloadAttestationMessage.ts +9 -3
- package/src/chain/validation/proposerPreferences.ts +110 -0
- package/src/chain/validation/syncCommittee.ts +5 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -1
- package/src/chain/validatorMonitor.ts +3 -2
- package/src/db/repositories/executionPayloadEnvelopeArchive.ts +1 -1
- package/src/execution/engine/http.ts +21 -14
- package/src/execution/engine/interface.ts +1 -0
- package/src/execution/engine/mock.ts +8 -1
- package/src/execution/engine/types.ts +41 -0
- package/src/metrics/metrics/lodestar.ts +4 -0
- package/src/network/gossip/interface.ts +6 -0
- package/src/network/gossip/scoringParameters.ts +14 -1
- package/src/network/gossip/topic.ts +6 -0
- package/src/network/interface.ts +1 -0
- package/src/network/network.ts +12 -1
- package/src/network/processor/gossipHandlers.ts +84 -27
- package/src/network/processor/gossipQueues/index.ts +5 -0
- package/src/network/processor/index.ts +6 -5
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +17 -7
- package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +3 -0
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +26 -8
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +11 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +36 -8
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +10 -5
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +3 -12
- package/src/node/nodejs.ts +8 -3
- package/src/node/notifier.ts +7 -2
- package/src/sync/constants.ts +4 -4
- package/src/sync/range/batch.ts +320 -67
- package/src/sync/range/chain.ts +89 -14
- package/src/sync/range/range.ts +34 -9
- package/src/sync/sync.ts +13 -1
- package/src/sync/types.ts +72 -0
- package/src/sync/unknownBlock.ts +928 -65
- package/src/sync/utils/downloadByRange.ts +378 -39
- package/src/sync/utils/downloadByRoot.ts +24 -2
- package/src/sync/utils/pendingBlocksTree.ts +0 -15
- package/src/util/sszBytes.ts +25 -5
|
@@ -3,7 +3,13 @@ import {ApplicationMethods} from "@lodestar/api/server";
|
|
|
3
3
|
import {ChainForkConfig} from "@lodestar/config";
|
|
4
4
|
import {Repository} from "@lodestar/db";
|
|
5
5
|
import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
computeEpochAtSlot,
|
|
8
|
+
computeStartSlotAtEpoch,
|
|
9
|
+
getIndexedAttestation,
|
|
10
|
+
isStatePostCapella,
|
|
11
|
+
} from "@lodestar/state-transition";
|
|
12
|
+
import {Attestation, Epoch, IndexedAttestation, ssz} from "@lodestar/types";
|
|
7
13
|
import {Checkpoint} from "@lodestar/types/phase0";
|
|
8
14
|
import {fromHex, toHex, toRootHex} from "@lodestar/utils";
|
|
9
15
|
import {BeaconChain} from "../../../chain/index.js";
|
|
@@ -15,6 +21,7 @@ import {ProfileThread, profileThread, writeHeapSnapshot} from "../../../util/pro
|
|
|
15
21
|
import {getStateResponseWithRegen} from "../beacon/state/utils.js";
|
|
16
22
|
import {ApiError} from "../errors.js";
|
|
17
23
|
import {ApiModules} from "../types.js";
|
|
24
|
+
import {getAttesterSlashingsFromIndexedAttestations} from "./attesterSlashing.js";
|
|
18
25
|
|
|
19
26
|
export function getLodestarApi({
|
|
20
27
|
chain,
|
|
@@ -111,7 +118,7 @@ export function getLodestarApi({
|
|
|
111
118
|
return {
|
|
112
119
|
// biome-ignore lint/complexity/useLiteralKeys: The `blockProcessor` is a protected attribute
|
|
113
120
|
data: (chain as BeaconChain)["blockProcessor"].jobQueue.getItems().map((item) => {
|
|
114
|
-
const [blockInputs, opts] = item.args;
|
|
121
|
+
const [blockInputs, _payloadEnvelopes, opts] = item.args;
|
|
115
122
|
return {
|
|
116
123
|
blockSlots: blockInputs.map((blockInput) => blockInput.slot),
|
|
117
124
|
jobOpts: opts,
|
|
@@ -218,6 +225,9 @@ export function getLodestarApi({
|
|
|
218
225
|
if (ForkSeq[fork] < ForkSeq.capella) {
|
|
219
226
|
throw new Error("Historical summaries are not supported before Capella");
|
|
220
227
|
}
|
|
228
|
+
if (!isStatePostCapella(stateView)) {
|
|
229
|
+
throw new Error("Expected Capella state for historical summaries");
|
|
230
|
+
}
|
|
221
231
|
|
|
222
232
|
const {gindex} = ssz[fork].BeaconState.getPathInfo(["historicalSummaries"]);
|
|
223
233
|
const proof = stateView.getSingleProof(gindex);
|
|
@@ -269,6 +279,46 @@ export function getLodestarApi({
|
|
|
269
279
|
},
|
|
270
280
|
};
|
|
271
281
|
},
|
|
282
|
+
|
|
283
|
+
async getAttesterSlashingsFromBlocks({signedBlocks}) {
|
|
284
|
+
const attestations = new Map<Epoch, Attestation[]>();
|
|
285
|
+
|
|
286
|
+
for (const block of signedBlocks) {
|
|
287
|
+
const attestationsOfABlock = block.message.body.attestations;
|
|
288
|
+
for (const attestation of attestationsOfABlock) {
|
|
289
|
+
const epoch = computeEpochAtSlot(attestation.data.slot);
|
|
290
|
+
let attestationsPerEpoch = attestations.get(epoch);
|
|
291
|
+
if (!attestationsPerEpoch) {
|
|
292
|
+
attestationsPerEpoch = [];
|
|
293
|
+
attestations.set(epoch, attestationsPerEpoch);
|
|
294
|
+
}
|
|
295
|
+
attestationsPerEpoch.push(attestation);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const indexedAttestations: IndexedAttestation[] = [];
|
|
300
|
+
// Assume all blocks are from the same fork
|
|
301
|
+
const forkSeq = config.getForkSeq(signedBlocks[0].message.slot);
|
|
302
|
+
|
|
303
|
+
for (const [epoch, attestationsPerEpoch] of attestations) {
|
|
304
|
+
const slot = computeStartSlotAtEpoch(epoch);
|
|
305
|
+
const {state} = await getStateResponseWithRegen(chain, slot);
|
|
306
|
+
const stateView = state instanceof Uint8Array ? chain.getHeadState().loadOtherState(state) : state;
|
|
307
|
+
const shuffling = stateView.getShufflingAtEpoch(epoch);
|
|
308
|
+
for (const attestation of attestationsPerEpoch) {
|
|
309
|
+
indexedAttestations.push(getIndexedAttestation(shuffling, forkSeq, attestation));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const result = getAttesterSlashingsFromIndexedAttestations(forkSeq, indexedAttestations);
|
|
314
|
+
|
|
315
|
+
return {
|
|
316
|
+
data: result,
|
|
317
|
+
meta: {
|
|
318
|
+
version: config.getForkName(signedBlocks[0].message.slot),
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
},
|
|
272
322
|
};
|
|
273
323
|
}
|
|
274
324
|
|
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
computeStartSlotAtEpoch,
|
|
26
26
|
computeTimeAtSlot,
|
|
27
27
|
getCurrentSlot,
|
|
28
|
+
isStatePostAltair,
|
|
29
|
+
isStatePostGloas,
|
|
28
30
|
proposerShufflingDecisionRoot,
|
|
29
31
|
} from "@lodestar/state-transition";
|
|
30
32
|
import {
|
|
@@ -69,7 +71,7 @@ import {ChainEvent, CommonBlockBody} from "../../../chain/index.js";
|
|
|
69
71
|
import {PREPARE_NEXT_SLOT_BPS} from "../../../chain/prepareNextSlot.js";
|
|
70
72
|
import {BlockType, ProduceFullDeneb, ProduceFullGloas} from "../../../chain/produceBlock/index.js";
|
|
71
73
|
import {RegenCaller} from "../../../chain/regen/index.js";
|
|
72
|
-
import {
|
|
74
|
+
import {CheckpointHex} from "../../../chain/stateCache/types.js";
|
|
73
75
|
import {validateApiAggregateAndProof} from "../../../chain/validation/index.js";
|
|
74
76
|
import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js";
|
|
75
77
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
@@ -300,7 +302,7 @@ export function getValidatorApi(
|
|
|
300
302
|
* |
|
|
301
303
|
* prepareNextSlot (4s before next slot)
|
|
302
304
|
*/
|
|
303
|
-
async function waitForCheckpointState(cpHex:
|
|
305
|
+
async function waitForCheckpointState(cpHex: CheckpointHex): Promise<IBeaconStateView | null> {
|
|
304
306
|
const cpState = chain.regen.getCheckpointStateSync(cpHex);
|
|
305
307
|
if (cpState) {
|
|
306
308
|
return cpState;
|
|
@@ -1048,6 +1050,36 @@ export function getValidatorApi(
|
|
|
1048
1050
|
};
|
|
1049
1051
|
},
|
|
1050
1052
|
|
|
1053
|
+
async producePayloadAttestationData({slot}) {
|
|
1054
|
+
const fork = config.getForkName(slot);
|
|
1055
|
+
if (!isForkPostGloas(fork)) {
|
|
1056
|
+
throw new ApiError(400, `producePayloadAttestationData is not supported before Gloas fork=${fork}`);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
notWhileSyncing();
|
|
1060
|
+
await waitForSlot(slot);
|
|
1061
|
+
|
|
1062
|
+
const block = chain.forkChoice.getCanonicalBlockClosestLteSlot(slot);
|
|
1063
|
+
if (!block) {
|
|
1064
|
+
throw new ApiError(404, `No canonical block found at or before slot=${slot}`);
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
const blockIsForSlot = block.slot === slot;
|
|
1068
|
+
const payloadInput = chain.seenPayloadEnvelopeInputCache.get(block.blockRoot);
|
|
1069
|
+
const payloadPresent = blockIsForSlot && (payloadInput?.hasPayloadEnvelope() ?? false);
|
|
1070
|
+
const blobDataAvailable = blockIsForSlot && (payloadInput?.hasAllData() ?? false);
|
|
1071
|
+
|
|
1072
|
+
return {
|
|
1073
|
+
data: {
|
|
1074
|
+
beaconBlockRoot: fromHex(block.blockRoot),
|
|
1075
|
+
slot,
|
|
1076
|
+
payloadPresent,
|
|
1077
|
+
blobDataAvailable,
|
|
1078
|
+
},
|
|
1079
|
+
meta: {version: fork},
|
|
1080
|
+
};
|
|
1081
|
+
},
|
|
1082
|
+
|
|
1051
1083
|
/**
|
|
1052
1084
|
* GET `/eth/v1/validator/sync_committee_contribution`
|
|
1053
1085
|
*
|
|
@@ -1112,7 +1144,6 @@ export function getValidatorApi(
|
|
|
1112
1144
|
const cpState = await waitForCheckpointState({
|
|
1113
1145
|
rootHex: head.blockRoot,
|
|
1114
1146
|
epoch,
|
|
1115
|
-
payloadPresent: head.payloadStatus === PayloadStatus.FULL,
|
|
1116
1147
|
});
|
|
1117
1148
|
if (cpState) {
|
|
1118
1149
|
state = cpState;
|
|
@@ -1263,6 +1294,55 @@ export function getValidatorApi(
|
|
|
1263
1294
|
};
|
|
1264
1295
|
},
|
|
1265
1296
|
|
|
1297
|
+
async getPtcDuties({epoch, indices}) {
|
|
1298
|
+
notWhileSyncing();
|
|
1299
|
+
|
|
1300
|
+
if (indices.length === 0) {
|
|
1301
|
+
throw new ApiError(400, "No validator to get PTC duties");
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
const startSlot = computeStartSlotAtEpoch(epoch);
|
|
1305
|
+
const fork = config.getForkName(startSlot);
|
|
1306
|
+
if (!isForkPostGloas(fork)) {
|
|
1307
|
+
throw new ApiError(400, `PTC duties are not supported before Gloas fork=${fork}`);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
await waitForNextClosestEpoch();
|
|
1311
|
+
|
|
1312
|
+
if (epoch > chain.clock.currentEpoch + 1) {
|
|
1313
|
+
throw new ApiError(400, "Cannot get PTC duties for epoch more than one ahead");
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
const head = chain.forkChoice.getHead();
|
|
1317
|
+
const state = await chain.getHeadStateAtCurrentEpoch(RegenCaller.getDuties);
|
|
1318
|
+
if (!isStatePostGloas(state)) {
|
|
1319
|
+
throw new ApiError(400, `PTC duties are not available before Gloas fork=${state.forkName}`);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
const pubkeys = getPubkeysForIndices(state, indices);
|
|
1323
|
+
const ptcs = state.getEpochPTCs(epoch);
|
|
1324
|
+
const duties: routes.validator.PtcDuty[] = [];
|
|
1325
|
+
for (let i = 0, len = indices.length; i < len; i++) {
|
|
1326
|
+
const validatorIndex = indices[i];
|
|
1327
|
+
for (let j = 0; j < SLOTS_PER_EPOCH; j++) {
|
|
1328
|
+
if (ptcs[j].indexOf(validatorIndex) !== -1) {
|
|
1329
|
+
duties.push({pubkey: pubkeys[i], validatorIndex, slot: j + startSlot});
|
|
1330
|
+
break;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch)) || (await getGenesisBlockRoot(state));
|
|
1336
|
+
|
|
1337
|
+
return {
|
|
1338
|
+
data: duties,
|
|
1339
|
+
meta: {
|
|
1340
|
+
dependentRoot: toRootHex(dependentRoot),
|
|
1341
|
+
executionOptimistic: isOptimisticBlock(head),
|
|
1342
|
+
},
|
|
1343
|
+
};
|
|
1344
|
+
},
|
|
1345
|
+
|
|
1266
1346
|
/**
|
|
1267
1347
|
* `POST /eth/v1/validator/duties/sync/{epoch}`
|
|
1268
1348
|
*
|
|
@@ -1282,6 +1362,9 @@ export function getValidatorApi(
|
|
|
1282
1362
|
if (indices.length === 0) {
|
|
1283
1363
|
throw new ApiError(400, "No validator to get attester duties");
|
|
1284
1364
|
}
|
|
1365
|
+
if (epoch < config.ALTAIR_FORK_EPOCH) {
|
|
1366
|
+
throw new ApiError(400, "Sync committee duties are not supported before Altair");
|
|
1367
|
+
}
|
|
1285
1368
|
|
|
1286
1369
|
// May request for an epoch that's in the future
|
|
1287
1370
|
await waitForNextClosestEpoch();
|
|
@@ -1291,6 +1374,9 @@ export function getValidatorApi(
|
|
|
1291
1374
|
// Note: does not support requesting past duties
|
|
1292
1375
|
const head = chain.forkChoice.getHead();
|
|
1293
1376
|
const state = chain.getHeadState();
|
|
1377
|
+
if (!isStatePostAltair(state)) {
|
|
1378
|
+
throw new ApiError(400, "Sync committee duties are not available before Altair");
|
|
1379
|
+
}
|
|
1294
1380
|
|
|
1295
1381
|
// Check that all validatorIndex belong to the state before calling getCommitteeAssignments()
|
|
1296
1382
|
const pubkeys = getPubkeysForIndices(state, indices);
|
|
@@ -1635,15 +1721,14 @@ export function getValidatorApi(
|
|
|
1635
1721
|
throw Error("Cached block production result is not full block");
|
|
1636
1722
|
}
|
|
1637
1723
|
|
|
1638
|
-
const {executionPayload, executionRequests,
|
|
1724
|
+
const {executionPayload, executionRequests, parentBlockRoot} = produceResult as ProduceFullGloas;
|
|
1639
1725
|
|
|
1640
1726
|
const envelope: gloas.ExecutionPayloadEnvelope = {
|
|
1641
1727
|
payload: executionPayload,
|
|
1642
1728
|
executionRequests: executionRequests,
|
|
1643
1729
|
builderIndex: BUILDER_INDEX_SELF_BUILD,
|
|
1644
1730
|
beaconBlockRoot,
|
|
1645
|
-
|
|
1646
|
-
stateRoot: envelopeStateRoot,
|
|
1731
|
+
parentBeaconBlockRoot: parentBlockRoot,
|
|
1647
1732
|
};
|
|
1648
1733
|
|
|
1649
1734
|
logger.info("Produced execution payload envelope", {
|
|
@@ -44,7 +44,7 @@ export class GetBlobsTracker {
|
|
|
44
44
|
this.config = init.config;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
triggerGetBlobs(input: IBlockInput | PayloadEnvelopeInput
|
|
47
|
+
triggerGetBlobs(input: IBlockInput | PayloadEnvelopeInput): void {
|
|
48
48
|
if (this.activeReconstructions.has(input.blockRootHex)) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
@@ -101,7 +101,6 @@ export class GetBlobsTracker {
|
|
|
101
101
|
.then((result) => {
|
|
102
102
|
this.logger.debug("getBlobsV2 result for block", {...logCtx, result});
|
|
103
103
|
this.metrics?.dataColumns.dataColumnEngineResult.inc({result});
|
|
104
|
-
onComplete?.();
|
|
105
104
|
})
|
|
106
105
|
.catch((error) => {
|
|
107
106
|
this.logger.debug("Error during getBlobsV2 for block", logCtx, error as Error);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
2
2
|
import {LoggerNode} from "@lodestar/logger/node";
|
|
3
3
|
import {Checkpoint} from "@lodestar/types/phase0";
|
|
4
4
|
import {callFnWhenAwait} from "@lodestar/utils";
|
|
@@ -41,7 +41,7 @@ export enum ArchiveStoreTask {
|
|
|
41
41
|
*/
|
|
42
42
|
export class ArchiveStore {
|
|
43
43
|
private archiveMode: ArchiveMode;
|
|
44
|
-
private jobQueue: JobItemQueue<[
|
|
44
|
+
private jobQueue: JobItemQueue<[CheckpointWithHex], void>;
|
|
45
45
|
|
|
46
46
|
private archiveDataEpochs?: number;
|
|
47
47
|
private readonly statesArchiverStrategy: StateArchiveStrategy;
|
|
@@ -64,7 +64,7 @@ export class ArchiveStore {
|
|
|
64
64
|
this.archiveMode = opts.archiveMode;
|
|
65
65
|
this.archiveDataEpochs = opts.archiveDataEpochs;
|
|
66
66
|
|
|
67
|
-
this.jobQueue = new JobItemQueue<[
|
|
67
|
+
this.jobQueue = new JobItemQueue<[CheckpointWithHex], void>(this.processFinalizedCheckpoint, {
|
|
68
68
|
maxLength: PROCESS_FINALIZED_CHECKPOINT_QUEUE_LENGTH,
|
|
69
69
|
signal,
|
|
70
70
|
});
|
|
@@ -166,7 +166,7 @@ export class ArchiveStore {
|
|
|
166
166
|
//-------------------------------------------------------------------------
|
|
167
167
|
// Event handlers
|
|
168
168
|
//-------------------------------------------------------------------------
|
|
169
|
-
private onFinalizedCheckpoint = (finalized:
|
|
169
|
+
private onFinalizedCheckpoint = (finalized: CheckpointWithHex): void => {
|
|
170
170
|
this.jobQueue.push(finalized).catch((e) => {
|
|
171
171
|
if (!isQueueErrorAborted(e)) {
|
|
172
172
|
this.logger.error("Error queuing finalized checkpoint", {epoch: finalized.epoch}, e as Error);
|
|
@@ -187,7 +187,7 @@ export class ArchiveStore {
|
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
private processFinalizedCheckpoint = async (finalized:
|
|
190
|
+
private processFinalizedCheckpoint = async (finalized: CheckpointWithHex): Promise<void> => {
|
|
191
191
|
try {
|
|
192
192
|
const finalizedEpoch = finalized.epoch;
|
|
193
193
|
this.logger.verbose("Start processing finalized checkpoint", {epoch: finalizedEpoch, rootHex: finalized.rootHex});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
2
2
|
import {RootHex} from "@lodestar/types";
|
|
3
3
|
import {Metrics} from "../../metrics/metrics.js";
|
|
4
4
|
|
|
@@ -45,9 +45,9 @@ export type FinalizedStats = {
|
|
|
45
45
|
|
|
46
46
|
export interface StateArchiveStrategy {
|
|
47
47
|
onCheckpoint(stateRoot: RootHex, metrics?: Metrics | null): Promise<void>;
|
|
48
|
-
onFinalizedCheckpoint(finalized:
|
|
49
|
-
maybeArchiveState(finalized:
|
|
50
|
-
archiveState(finalized:
|
|
48
|
+
onFinalizedCheckpoint(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void>;
|
|
49
|
+
maybeArchiveState(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void>;
|
|
50
|
+
archiveState(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void>;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export interface IArchiveStore {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {CheckpointWithHex} 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,7 +9,6 @@ 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";
|
|
13
12
|
import {StateArchiveStrategy, StatesArchiveOpts} from "../interface.js";
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -41,7 +40,7 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
|
|
|
41
40
|
private readonly bufferPool?: BufferPool | null
|
|
42
41
|
) {}
|
|
43
42
|
|
|
44
|
-
async onFinalizedCheckpoint(_finalized:
|
|
43
|
+
async onFinalizedCheckpoint(_finalized: CheckpointWithHex, _metrics?: Metrics | null): Promise<void> {}
|
|
45
44
|
async onCheckpoint(_stateRoot: RootHex, _metrics?: Metrics | null): Promise<void> {}
|
|
46
45
|
|
|
47
46
|
/**
|
|
@@ -56,7 +55,7 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
|
|
|
56
55
|
* epoch - 1024*2 epoch - 1024 epoch - 32 epoch
|
|
57
56
|
* ```
|
|
58
57
|
*/
|
|
59
|
-
async maybeArchiveState(finalized:
|
|
58
|
+
async maybeArchiveState(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void> {
|
|
60
59
|
let timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
|
|
61
60
|
const lastStoredSlot = await this.db.stateArchive.lastKey();
|
|
62
61
|
timer?.({step: FrequencyStateArchiveStep.LoadLastStoredSlot});
|
|
@@ -105,12 +104,11 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
|
|
|
105
104
|
* Archives finalized states from active bucket to archive bucket.
|
|
106
105
|
* Only the new finalized state is stored to disk
|
|
107
106
|
*/
|
|
108
|
-
async archiveState(finalized:
|
|
107
|
+
async archiveState(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void> {
|
|
109
108
|
// starting from Mar 2024, the finalized state could be from disk or in memory
|
|
110
109
|
let timer = metrics?.processFinalizedCheckpoint.frequencyStateArchive.startTimer();
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
const finalizedStateOrBytes = await this.regen.getCheckpointStateOrBytes(finalizedHexPayload);
|
|
110
|
+
const finalizedHex = {epoch: finalized.epoch, rootHex: finalized.rootHex};
|
|
111
|
+
const finalizedStateOrBytes = await this.regen.getCheckpointStateOrBytes(finalizedHex);
|
|
114
112
|
timer?.({step: FrequencyStateArchiveStep.GetFinalizedState});
|
|
115
113
|
|
|
116
114
|
const {rootHex} = finalized;
|