@lodestar/beacon-node 1.42.0 → 1.43.0-dev.07875b3e0c
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 +21 -4
- 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 +4 -0
- 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/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 +39 -0
- 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 +8 -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/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +29 -35
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +15 -14
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +69 -82
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +1 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +20 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.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 +6 -4
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +15 -21
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +3 -2
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.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 +76 -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 +25 -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 +5 -4
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +32 -38
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +16 -4
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -0
- 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 +11 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +4 -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/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/interface.d.ts +4 -3
- 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/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +32 -11
- 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 +5 -10
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +49 -19
- 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 +6 -12
- package/lib/chain/regen/interface.d.ts.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 +8 -40
- 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 +7 -34
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +11 -4
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +20 -18
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- 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 +27 -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 +19 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +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/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/network/gossip/topic.d.ts +3 -729
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/network.js +1 -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 +26 -6
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js +2 -1
- 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 +7 -3
- 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 +7 -3
- 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 +2 -1
- 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 +6 -1
- 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/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +16 -3
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +30 -4
- package/src/api/impl/beacon/pool/index.ts +4 -0
- package/src/api/impl/beacon/state/index.ts +15 -15
- package/src/api/impl/beacon/state/utils.ts +2 -2
- package/src/api/impl/lodestar/attesterSlashing.ts +43 -0
- package/src/api/impl/lodestar/index.ts +51 -1
- package/src/api/impl/validator/index.ts +10 -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/importBlock.ts +33 -42
- package/src/chain/blocks/importExecutionPayload.ts +83 -99
- package/src/chain/blocks/index.ts +1 -2
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +27 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +6 -5
- package/src/chain/blocks/types.ts +15 -26
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +2 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +9 -2
- package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +129 -0
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +38 -0
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +9 -18
- package/src/chain/chain.ts +47 -62
- package/src/chain/emitter.ts +15 -3
- package/src/chain/errors/attestationError.ts +6 -1
- package/src/chain/errors/blockError.ts +7 -1
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -0
- package/src/chain/forkChoice/index.ts +19 -28
- package/src/chain/interface.ts +7 -2
- 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/prepareNextSlot.ts +38 -11
- package/src/chain/produceBlock/computeNewStateRoot.ts +1 -37
- package/src/chain/produceBlock/produceBlockBody.ts +74 -23
- package/src/chain/regen/errors.ts +1 -6
- package/src/chain/regen/interface.ts +6 -12
- package/src/chain/regen/queued.ts +12 -48
- package/src/chain/regen/regen.ts +8 -36
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +22 -20
- 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 +30 -7
- package/src/chain/validation/executionPayloadBid.ts +21 -3
- package/src/chain/validation/executionPayloadEnvelope.ts +32 -13
- package/src/chain/validation/payloadAttestationMessage.ts +9 -3
- 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/network/network.ts +1 -1
- package/src/network/processor/gossipHandlers.ts +31 -10
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +3 -1
- package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +3 -0
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +15 -3
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +11 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +19 -3
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +3 -1
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +3 -12
- package/src/node/nodejs.ts +7 -2
- package/src/node/notifier.ts +7 -2
- package/src/util/sszBytes.ts +21 -3
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
|
-
import {
|
|
4
|
-
EPOCHS_PER_HISTORICAL_VECTOR,
|
|
5
|
-
SLOTS_PER_EPOCH,
|
|
6
|
-
SYNC_COMMITTEE_SUBNET_SIZE,
|
|
7
|
-
isForkPostElectra,
|
|
8
|
-
isForkPostFulu,
|
|
9
|
-
} from "@lodestar/params";
|
|
3
|
+
import {EPOCHS_PER_HISTORICAL_VECTOR, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
10
4
|
import {
|
|
11
5
|
IBeaconStateView,
|
|
12
6
|
computeEpochAtSlot,
|
|
13
7
|
computeStartSlotAtEpoch,
|
|
14
8
|
getCurrentEpoch,
|
|
9
|
+
isStatePostAltair,
|
|
10
|
+
isStatePostElectra,
|
|
11
|
+
isStatePostFulu,
|
|
15
12
|
} from "@lodestar/state-transition";
|
|
16
13
|
import {ValidatorIndex, getValidatorStatus, ssz} from "@lodestar/types";
|
|
17
14
|
import {ApiError} from "../../errors.js";
|
|
@@ -303,6 +300,9 @@ export function getBeaconStateApi({
|
|
|
303
300
|
if (stateEpoch < config.ALTAIR_FORK_EPOCH) {
|
|
304
301
|
throw new ApiError(400, "Requested state before ALTAIR_FORK_EPOCH");
|
|
305
302
|
}
|
|
303
|
+
if (!isStatePostAltair(state)) {
|
|
304
|
+
throw new Error("Expected Altair state for sync committee lookup");
|
|
305
|
+
}
|
|
306
306
|
|
|
307
307
|
const syncCommitteeCache = state.getIndexedSyncCommitteeAtEpoch(epoch ?? stateEpoch);
|
|
308
308
|
const validatorIndices = new Array<ValidatorIndex>(...syncCommitteeCache.validatorIndices);
|
|
@@ -324,9 +324,9 @@ export function getBeaconStateApi({
|
|
|
324
324
|
|
|
325
325
|
async getPendingDeposits({stateId}, context) {
|
|
326
326
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
327
|
-
const fork =
|
|
327
|
+
const fork = state.forkName;
|
|
328
328
|
|
|
329
|
-
if (!
|
|
329
|
+
if (!isStatePostElectra(state)) {
|
|
330
330
|
throw new ApiError(400, `Cannot retrieve pending deposits for pre-electra state fork=${fork}`);
|
|
331
331
|
}
|
|
332
332
|
|
|
@@ -340,9 +340,9 @@ export function getBeaconStateApi({
|
|
|
340
340
|
|
|
341
341
|
async getPendingPartialWithdrawals({stateId}, context) {
|
|
342
342
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
343
|
-
const fork =
|
|
343
|
+
const fork = state.forkName;
|
|
344
344
|
|
|
345
|
-
if (!
|
|
345
|
+
if (!isStatePostElectra(state)) {
|
|
346
346
|
throw new ApiError(400, `Cannot retrieve pending partial withdrawals for pre-electra state fork=${fork}`);
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -358,9 +358,9 @@ export function getBeaconStateApi({
|
|
|
358
358
|
|
|
359
359
|
async getPendingConsolidations({stateId}, context) {
|
|
360
360
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
361
|
-
const fork =
|
|
361
|
+
const fork = state.forkName;
|
|
362
362
|
|
|
363
|
-
if (!
|
|
363
|
+
if (!isStatePostElectra(state)) {
|
|
364
364
|
throw new ApiError(400, `Cannot retrieve pending consolidations for pre-electra state fork=${fork}`);
|
|
365
365
|
}
|
|
366
366
|
|
|
@@ -376,9 +376,9 @@ export function getBeaconStateApi({
|
|
|
376
376
|
|
|
377
377
|
async getProposerLookahead({stateId}, context) {
|
|
378
378
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
379
|
-
const fork =
|
|
379
|
+
const fork = state.forkName;
|
|
380
380
|
|
|
381
|
-
if (!
|
|
381
|
+
if (!isStatePostFulu(state)) {
|
|
382
382
|
throw new ApiError(400, `Cannot retrieve proposer lookahead for pre-fulu state fork=${fork}`);
|
|
383
383
|
}
|
|
384
384
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
|
-
import {
|
|
2
|
+
import {CheckpointWithHex, IForkChoice} from "@lodestar/fork-choice";
|
|
3
3
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
4
4
|
import {IBeaconStateView, PubkeyCache} from "@lodestar/state-transition";
|
|
5
5
|
import {BLSPubkey, Epoch, RootHex, Slot, ValidatorIndex, getValidatorStatus, phase0} from "@lodestar/types";
|
|
@@ -10,7 +10,7 @@ import {ApiError, ValidationError} from "../../errors.js";
|
|
|
10
10
|
export function resolveStateId(
|
|
11
11
|
forkChoice: IForkChoice,
|
|
12
12
|
stateId: routes.beacon.StateId
|
|
13
|
-
): RootHex | Slot |
|
|
13
|
+
): RootHex | Slot | CheckpointWithHex {
|
|
14
14
|
if (stateId === "head") {
|
|
15
15
|
return forkChoice.getHead().stateRoot;
|
|
16
16
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {ForkSeq} from "@lodestar/params";
|
|
2
|
+
import {
|
|
3
|
+
getIntersectingIndices,
|
|
4
|
+
isSlashableAttestationData,
|
|
5
|
+
toIndexedAttestationBigint,
|
|
6
|
+
} from "@lodestar/state-transition";
|
|
7
|
+
import {AttesterSlashing, IndexedAttestation} from "@lodestar/types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Find all slashable pairs within a list of IndexedAttestations and
|
|
11
|
+
* construct AttesterSlashing objects for each.
|
|
12
|
+
*/
|
|
13
|
+
export function getAttesterSlashingsFromIndexedAttestations(
|
|
14
|
+
fork: ForkSeq,
|
|
15
|
+
indexedAttestations: IndexedAttestation[]
|
|
16
|
+
): AttesterSlashing[] {
|
|
17
|
+
const slashings: AttesterSlashing[] = [];
|
|
18
|
+
|
|
19
|
+
for (let i = 0; i < indexedAttestations.length; i++) {
|
|
20
|
+
for (let j = i + 1; j < indexedAttestations.length; j++) {
|
|
21
|
+
// Order by source epoch so the surrounding attestation is always first,
|
|
22
|
+
// matching what isSlashableAttestationData expects (one-directional check).
|
|
23
|
+
const [first, second] =
|
|
24
|
+
indexedAttestations[j].data.source.epoch < indexedAttestations[i].data.source.epoch
|
|
25
|
+
? [indexedAttestations[j], indexedAttestations[i]]
|
|
26
|
+
: [indexedAttestations[i], indexedAttestations[j]];
|
|
27
|
+
|
|
28
|
+
if (getIntersectingIndices(first.attestingIndices, second.attestingIndices).length === 0) continue;
|
|
29
|
+
|
|
30
|
+
const firstBigint = toIndexedAttestationBigint(first, fork);
|
|
31
|
+
const secondBigint = toIndexedAttestationBigint(second, fork);
|
|
32
|
+
|
|
33
|
+
if (!isSlashableAttestationData(firstBigint.data, secondBigint.data)) continue;
|
|
34
|
+
|
|
35
|
+
slashings.push({
|
|
36
|
+
attestation1: firstBigint,
|
|
37
|
+
attestation2: secondBigint,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return slashings;
|
|
43
|
+
}
|
|
@@ -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,
|
|
@@ -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,7 @@ import {
|
|
|
25
25
|
computeStartSlotAtEpoch,
|
|
26
26
|
computeTimeAtSlot,
|
|
27
27
|
getCurrentSlot,
|
|
28
|
+
isStatePostAltair,
|
|
28
29
|
proposerShufflingDecisionRoot,
|
|
29
30
|
} from "@lodestar/state-transition";
|
|
30
31
|
import {
|
|
@@ -69,7 +70,7 @@ import {ChainEvent, CommonBlockBody} from "../../../chain/index.js";
|
|
|
69
70
|
import {PREPARE_NEXT_SLOT_BPS} from "../../../chain/prepareNextSlot.js";
|
|
70
71
|
import {BlockType, ProduceFullDeneb, ProduceFullGloas} from "../../../chain/produceBlock/index.js";
|
|
71
72
|
import {RegenCaller} from "../../../chain/regen/index.js";
|
|
72
|
-
import {
|
|
73
|
+
import {CheckpointHex} from "../../../chain/stateCache/types.js";
|
|
73
74
|
import {validateApiAggregateAndProof} from "../../../chain/validation/index.js";
|
|
74
75
|
import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js";
|
|
75
76
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
@@ -300,7 +301,7 @@ export function getValidatorApi(
|
|
|
300
301
|
* |
|
|
301
302
|
* prepareNextSlot (4s before next slot)
|
|
302
303
|
*/
|
|
303
|
-
async function waitForCheckpointState(cpHex:
|
|
304
|
+
async function waitForCheckpointState(cpHex: CheckpointHex): Promise<IBeaconStateView | null> {
|
|
304
305
|
const cpState = chain.regen.getCheckpointStateSync(cpHex);
|
|
305
306
|
if (cpState) {
|
|
306
307
|
return cpState;
|
|
@@ -1112,7 +1113,6 @@ export function getValidatorApi(
|
|
|
1112
1113
|
const cpState = await waitForCheckpointState({
|
|
1113
1114
|
rootHex: head.blockRoot,
|
|
1114
1115
|
epoch,
|
|
1115
|
-
payloadPresent: head.payloadStatus === PayloadStatus.FULL,
|
|
1116
1116
|
});
|
|
1117
1117
|
if (cpState) {
|
|
1118
1118
|
state = cpState;
|
|
@@ -1282,6 +1282,9 @@ export function getValidatorApi(
|
|
|
1282
1282
|
if (indices.length === 0) {
|
|
1283
1283
|
throw new ApiError(400, "No validator to get attester duties");
|
|
1284
1284
|
}
|
|
1285
|
+
if (epoch < config.ALTAIR_FORK_EPOCH) {
|
|
1286
|
+
throw new ApiError(400, "Sync committee duties are not supported before Altair");
|
|
1287
|
+
}
|
|
1285
1288
|
|
|
1286
1289
|
// May request for an epoch that's in the future
|
|
1287
1290
|
await waitForNextClosestEpoch();
|
|
@@ -1291,6 +1294,9 @@ export function getValidatorApi(
|
|
|
1291
1294
|
// Note: does not support requesting past duties
|
|
1292
1295
|
const head = chain.forkChoice.getHead();
|
|
1293
1296
|
const state = chain.getHeadState();
|
|
1297
|
+
if (!isStatePostAltair(state)) {
|
|
1298
|
+
throw new ApiError(400, "Sync committee duties are not available before Altair");
|
|
1299
|
+
}
|
|
1294
1300
|
|
|
1295
1301
|
// Check that all validatorIndex belong to the state before calling getCommitteeAssignments()
|
|
1296
1302
|
const pubkeys = getPubkeysForIndices(state, indices);
|
|
@@ -1635,15 +1641,13 @@ export function getValidatorApi(
|
|
|
1635
1641
|
throw Error("Cached block production result is not full block");
|
|
1636
1642
|
}
|
|
1637
1643
|
|
|
1638
|
-
const {executionPayload, executionRequests
|
|
1644
|
+
const {executionPayload, executionRequests} = produceResult as ProduceFullGloas;
|
|
1639
1645
|
|
|
1640
1646
|
const envelope: gloas.ExecutionPayloadEnvelope = {
|
|
1641
1647
|
payload: executionPayload,
|
|
1642
1648
|
executionRequests: executionRequests,
|
|
1643
1649
|
builderIndex: BUILDER_INDEX_SELF_BUILD,
|
|
1644
1650
|
beaconBlockRoot,
|
|
1645
|
-
slot,
|
|
1646
|
-
stateRoot: envelopeStateRoot,
|
|
1647
1651
|
};
|
|
1648
1652
|
|
|
1649
1653
|
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;
|