@lodestar/beacon-node 1.42.0-dev.d73eccfa56 → 1.42.0-dev.e8407e9657
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +25 -13
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +27 -32
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +4 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +27 -27
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -3
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +5 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +34 -22
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -8
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +78 -51
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +3 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.d.ts +21 -15
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +2 -2
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +4 -4
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +5 -5
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +4 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +15 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +102 -59
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +31 -9
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +12 -3
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +4 -4
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +27 -23
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +2 -2
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +15 -14
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +4 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +10 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +3 -3
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +3 -4
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +12 -16
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +13 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +14 -14
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +6 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +6 -6
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +14 -14
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attestation.js +3 -3
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +3 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +185 -6
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +4 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +2 -3
- 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 +1 -2
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +13 -12
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +3 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +9 -7
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/buckets.d.ts +2 -2
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js +4 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +32 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +52 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/interface.d.ts +7 -4
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +22 -11
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +7 -4
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +12 -3
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +7 -2
- package/lib/network/options.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +25 -5
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +265 -80
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +22 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +311 -80
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +9 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +10 -4
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +16 -4
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +1 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +2 -2
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -2
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +10 -43
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +3 -3
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +4 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +3 -3
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +10 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +3 -3
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +21 -10
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/dataColumns.d.ts +18 -11
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +51 -17
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +6 -2
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +49 -25
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +19 -2
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +173 -3
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +33 -16
- package/src/api/impl/beacon/pool/index.ts +1 -1
- package/src/api/impl/beacon/state/index.ts +29 -41
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +4 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +29 -41
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -4
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +5 -4
- package/src/chain/blocks/importBlock.ts +41 -26
- package/src/chain/blocks/importExecutionPayload.ts +89 -63
- package/src/chain/blocks/index.ts +3 -2
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/types.ts +26 -15
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -14
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +138 -91
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/forkChoice/index.ts +33 -42
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +16 -15
- package/src/chain/lightClient/index.ts +9 -22
- package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +6 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +6 -10
- package/src/chain/produceBlock/produceBlockBody.ts +22 -49
- package/src/chain/regen/interface.ts +13 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
- package/src/chain/serializeState.ts +3 -3
- package/src/chain/shufflingCache.ts +5 -7
- package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
- package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
- package/src/chain/stateCache/types.ts +14 -18
- package/src/chain/validation/attestation.ts +3 -3
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +2 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +3 -7
- package/src/chain/validation/executionPayloadEnvelope.ts +2 -8
- package/src/chain/validation/payloadAttestationMessage.ts +2 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +21 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +12 -11
- package/src/db/buckets.ts +2 -2
- package/src/db/repositories/dataColumnSidecar.ts +4 -2
- package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
- package/src/metrics/metrics/lodestar.ts +57 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +18 -4
- package/src/network/libp2p/index.ts +24 -13
- package/src/network/network.ts +39 -8
- package/src/network/options.ts +7 -2
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +329 -94
- package/src/network/processor/index.ts +393 -92
- package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +26 -5
- package/src/node/nodejs.ts +3 -5
- package/src/node/notifier.ts +4 -10
- package/src/sync/backfill/backfill.ts +3 -3
- package/src/sync/unknownBlock.ts +13 -53
- package/src/sync/utils/downloadByRange.ts +9 -7
- package/src/sync/utils/downloadByRoot.ts +16 -12
- package/src/util/blobs.ts +35 -15
- package/src/util/dataColumns.ts +69 -25
- package/src/util/execution.ts +49 -30
- package/src/util/sszBytes.ts +223 -7
- package/src/util/types.ts +6 -0
package/src/chain/emitter.ts
CHANGED
|
@@ -2,8 +2,9 @@ import {EventEmitter} from "node:events";
|
|
|
2
2
|
import {StrictEventEmitter} from "strict-event-emitter-types";
|
|
3
3
|
import {routes} from "@lodestar/api";
|
|
4
4
|
import {CheckpointWithPayloadStatus} from "@lodestar/fork-choice";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
6
|
+
import {DataColumnSidecar, RootHex, deneb, phase0} from "@lodestar/types";
|
|
7
|
+
import {SignedExecutionPayloadEnvelope} from "@lodestar/types/gloas";
|
|
7
8
|
import {PeerIdStr} from "../util/peerId.js";
|
|
8
9
|
import {BlockInputSource, IBlockInput} from "./blocks/blockInput/types.js";
|
|
9
10
|
|
|
@@ -54,13 +55,22 @@ export enum ChainEvent {
|
|
|
54
55
|
*/
|
|
55
56
|
updateStatus = "updateStatus",
|
|
56
57
|
/**
|
|
57
|
-
* Trigger
|
|
58
|
+
* Trigger BlockInputSync to find parent of a SignedBeaconBlock received
|
|
59
|
+
* Post-gloas, missing parent could be a SignedBeaconBlock and/or a SignedExecutionPayloadEnvelope
|
|
58
60
|
*/
|
|
59
|
-
|
|
61
|
+
blockUnknownParent = "blockUnknownParent",
|
|
60
62
|
/**
|
|
61
|
-
* Trigger BlockInputSync
|
|
63
|
+
* Trigger BlockInputSync to find a SignedBeaconBlock given a SignedExecutionPayloadEnvelop received
|
|
64
|
+
*/
|
|
65
|
+
envelopeUnknownBlock = "envelopeUnknownBlock",
|
|
66
|
+
/**
|
|
67
|
+
* Trigger BlockInputSync to find a SignedBeaconBlock with specified block root.
|
|
62
68
|
*/
|
|
63
69
|
unknownBlockRoot = "unknownBlockRoot",
|
|
70
|
+
/**
|
|
71
|
+
* Trigger BlockInputSync to find a SignedExecutionPayloadEnvelope with specified block root.
|
|
72
|
+
*/
|
|
73
|
+
unknownEnvelopeBlockRoot = "unknownEnvelopeBlockRoot",
|
|
64
74
|
/**
|
|
65
75
|
* Trigger BlockInputSync for blocks that are partially received via gossip but are not complete by time the
|
|
66
76
|
* cut-off window passes for waiting on gossip
|
|
@@ -75,20 +85,26 @@ export type ReorgEventData = routes.events.EventData[routes.events.EventType.cha
|
|
|
75
85
|
type ApiEvents = {[K in routes.events.EventType]: (data: routes.events.EventData[K]) => void};
|
|
76
86
|
|
|
77
87
|
export type ChainEventData = {
|
|
78
|
-
[ChainEvent.
|
|
88
|
+
[ChainEvent.blockUnknownParent]: {blockInput: IBlockInput; peer: PeerIdStr; source: BlockInputSource};
|
|
89
|
+
[ChainEvent.envelopeUnknownBlock]: {
|
|
90
|
+
envelope: SignedExecutionPayloadEnvelope;
|
|
91
|
+
peer?: PeerIdStr;
|
|
92
|
+
source: BlockInputSource;
|
|
93
|
+
};
|
|
79
94
|
[ChainEvent.unknownBlockRoot]: {rootHex: RootHex; peer?: PeerIdStr; source: BlockInputSource};
|
|
80
95
|
[ChainEvent.incompleteBlockInput]: {blockInput: IBlockInput; peer: PeerIdStr; source: BlockInputSource};
|
|
96
|
+
[ChainEvent.unknownEnvelopeBlockRoot]: {rootHex: RootHex; peer?: PeerIdStr; source: BlockInputSource};
|
|
81
97
|
};
|
|
82
98
|
|
|
83
99
|
export type IChainEvents = ApiEvents & {
|
|
84
|
-
[ChainEvent.checkpoint]: (checkpoint: phase0.Checkpoint, state:
|
|
100
|
+
[ChainEvent.checkpoint]: (checkpoint: phase0.Checkpoint, state: IBeaconStateView) => void;
|
|
85
101
|
|
|
86
102
|
[ChainEvent.forkChoiceJustified]: (checkpoint: CheckpointWithPayloadStatus) => void;
|
|
87
103
|
[ChainEvent.forkChoiceFinalized]: (checkpoint: CheckpointWithPayloadStatus) => void;
|
|
88
104
|
|
|
89
105
|
[ChainEvent.updateTargetCustodyGroupCount]: (targetGroupCount: number) => void;
|
|
90
106
|
|
|
91
|
-
[ChainEvent.publishDataColumns]: (sidecars:
|
|
107
|
+
[ChainEvent.publishDataColumns]: (sidecars: DataColumnSidecar[]) => void;
|
|
92
108
|
|
|
93
109
|
[ChainEvent.publishBlobSidecars]: (sidecars: deneb.BlobSidecar[]) => void;
|
|
94
110
|
|
|
@@ -96,9 +112,11 @@ export type IChainEvents = ApiEvents & {
|
|
|
96
112
|
|
|
97
113
|
// Sync events that are chain->chain. Initiated from network requests but do not cross the network
|
|
98
114
|
// barrier so are considered ChainEvent(s).
|
|
99
|
-
[ChainEvent.
|
|
115
|
+
[ChainEvent.blockUnknownParent]: (data: ChainEventData[ChainEvent.blockUnknownParent]) => void;
|
|
116
|
+
[ChainEvent.envelopeUnknownBlock]: (data: ChainEventData[ChainEvent.envelopeUnknownBlock]) => void;
|
|
100
117
|
[ChainEvent.unknownBlockRoot]: (data: ChainEventData[ChainEvent.unknownBlockRoot]) => void;
|
|
101
118
|
[ChainEvent.incompleteBlockInput]: (data: ChainEventData[ChainEvent.incompleteBlockInput]) => void;
|
|
119
|
+
[ChainEvent.unknownEnvelopeBlockRoot]: (data: ChainEventData[ChainEvent.unknownEnvelopeBlockRoot]) => void;
|
|
102
120
|
};
|
|
103
121
|
|
|
104
122
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
2
2
|
import {RootHex, SignedBeaconBlock, Slot, ValidatorIndex} from "@lodestar/types";
|
|
3
3
|
import {LodestarError, toRootHex} from "@lodestar/utils";
|
|
4
4
|
import {ExecutionPayloadStatus} from "../../execution/engine/interface.js";
|
|
@@ -91,13 +91,13 @@ export type BlockErrorType =
|
|
|
91
91
|
| {code: BlockErrorCode.INCORRECT_PROPOSER; proposerIndex: ValidatorIndex}
|
|
92
92
|
| {code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID; blockSlot: Slot}
|
|
93
93
|
| {code: BlockErrorCode.UNKNOWN_PROPOSER; proposerIndex: ValidatorIndex}
|
|
94
|
-
| {code: BlockErrorCode.INVALID_SIGNATURE; state:
|
|
94
|
+
| {code: BlockErrorCode.INVALID_SIGNATURE; state: IBeaconStateView}
|
|
95
95
|
| {
|
|
96
96
|
code: BlockErrorCode.INVALID_STATE_ROOT;
|
|
97
97
|
root: Uint8Array;
|
|
98
98
|
expectedRoot: Uint8Array;
|
|
99
|
-
preState:
|
|
100
|
-
postState:
|
|
99
|
+
preState: IBeaconStateView;
|
|
100
|
+
postState: IBeaconStateView;
|
|
101
101
|
}
|
|
102
102
|
| {code: BlockErrorCode.NOT_FINALIZED_DESCENDANT; parentRoot: RootHex}
|
|
103
103
|
| {code: BlockErrorCode.NOT_LATER_THAN_PARENT; parentSlot: Slot; slot: Slot}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {ForkName} from "@lodestar/params";
|
|
1
2
|
import {RootHex, Slot, SubnetID} from "@lodestar/types";
|
|
2
3
|
import {LodestarError} from "@lodestar/utils";
|
|
3
4
|
import {GossipActionError} from "./gossipValidation.js";
|
|
@@ -6,6 +7,7 @@ export enum DataColumnSidecarErrorCode {
|
|
|
6
7
|
INVALID_INDEX = "DATA_COLUMN_SIDECAR_ERROR_INVALID_INDEX",
|
|
7
8
|
NO_COMMITMENTS = "DATA_COLUMN_SIDECAR_ERROR_NO_COMMITMENTS",
|
|
8
9
|
MISMATCHED_LENGTHS = "DATA_COLUMN_SIDECAR_ERROR_MISMATCHED_LENGTHS",
|
|
10
|
+
INCORRECT_TYPE = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_TYPE",
|
|
9
11
|
INVALID_SUBNET = "DATA_COLUMN_SIDECAR_ERROR_INVALID_SUBNET",
|
|
10
12
|
INVALID_KZG_PROOF = "DATA_COLUMN_SIDECAR_ERROR_INVALID_KZG_PROOF",
|
|
11
13
|
TOO_MANY_KZG_COMMITMENTS = "DATA_COLUMN_SIDECAR_ERROR_TOO_MANY_KZG_COMMITMENTS",
|
|
@@ -18,6 +20,10 @@ export enum DataColumnSidecarErrorCode {
|
|
|
18
20
|
INCORRECT_SIDECAR_COUNT = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_SIDECAR_COUNT",
|
|
19
21
|
/** Sidecar doesn't match block */
|
|
20
22
|
INCORRECT_BLOCK = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_BLOCK",
|
|
23
|
+
/** Sidecar slot doesn't match block slot */
|
|
24
|
+
INCORRECT_SIDECAR_SLOT = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_SIDECAR_SLOT",
|
|
25
|
+
/** Sidecar referenced block is not the expected block type */
|
|
26
|
+
INCORRECT_BLOCK_TYPE = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_BLOCK_TYPE",
|
|
21
27
|
/** Sidecar cell count not as expected */
|
|
22
28
|
INCORRECT_CELL_COUNT = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_CELL_COUNT",
|
|
23
29
|
/** Sidecar kzg proof count not as expected */
|
|
@@ -32,10 +38,12 @@ export enum DataColumnSidecarErrorCode {
|
|
|
32
38
|
FUTURE_SLOT = "DATA_COLUMN_SIDECAR_ERROR_FUTURE_SLOT",
|
|
33
39
|
WOULD_REVERT_FINALIZED_SLOT = "DATA_COLUMN_SIDECAR_ERROR_WOULD_REVERT_FINALIZED_SLOT",
|
|
34
40
|
PARENT_UNKNOWN = "DATA_COLUMN_SIDECAR_ERROR_PARENT_UNKNOWN",
|
|
41
|
+
BLOCK_UNKNOWN = "DATA_COLUMN_SIDECAR_ERROR_BLOCK_UNKNOWN",
|
|
35
42
|
NOT_LATER_THAN_PARENT = "DATA_COLUMN_SIDECAR_ERROR_NOT_LATER_THAN_PARENT",
|
|
36
43
|
PROPOSAL_SIGNATURE_INVALID = "DATA_COLUMN_SIDECAR_ERROR_PROPOSAL_SIGNATURE_INVALID",
|
|
37
44
|
INCLUSION_PROOF_INVALID = "DATA_COLUMN_SIDECAR_ERROR_INCLUSION_PROOF_INVALID",
|
|
38
45
|
INCORRECT_PROPOSER = "DATA_COLUMN_SIDECAR_ERROR_INCORRECT_PROPOSER",
|
|
46
|
+
PAYLOAD_ENVELOPE_INPUT_MISSING = "DATA_COLUMN_SIDECAR_ERROR_PAYLOAD_ENVELOPE_INPUT_MISSING",
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
export type DataColumnSidecarErrorType =
|
|
@@ -47,6 +55,12 @@ export type DataColumnSidecarErrorType =
|
|
|
47
55
|
commitmentsLength: number;
|
|
48
56
|
proofsLength: number;
|
|
49
57
|
}
|
|
58
|
+
| {
|
|
59
|
+
code: DataColumnSidecarErrorCode.INCORRECT_TYPE;
|
|
60
|
+
slot: Slot;
|
|
61
|
+
columnIndex: number;
|
|
62
|
+
fork: ForkName;
|
|
63
|
+
}
|
|
50
64
|
| {code: DataColumnSidecarErrorCode.INVALID_SUBNET; columnIndex: number; gossipSubnet: SubnetID}
|
|
51
65
|
| {
|
|
52
66
|
code: DataColumnSidecarErrorCode.TOO_MANY_KZG_COMMITMENTS;
|
|
@@ -63,6 +77,11 @@ export type DataColumnSidecarErrorType =
|
|
|
63
77
|
parentRoot: RootHex;
|
|
64
78
|
slot: Slot;
|
|
65
79
|
}
|
|
80
|
+
| {
|
|
81
|
+
code: DataColumnSidecarErrorCode.BLOCK_UNKNOWN;
|
|
82
|
+
blockRoot: RootHex;
|
|
83
|
+
slot: Slot;
|
|
84
|
+
}
|
|
66
85
|
| {
|
|
67
86
|
code: DataColumnSidecarErrorCode.PROPOSAL_SIGNATURE_INVALID;
|
|
68
87
|
slot: Slot;
|
|
@@ -80,6 +99,17 @@ export type DataColumnSidecarErrorType =
|
|
|
80
99
|
expected: string;
|
|
81
100
|
actual: string;
|
|
82
101
|
}
|
|
102
|
+
| {
|
|
103
|
+
code: DataColumnSidecarErrorCode.INCORRECT_BLOCK_TYPE;
|
|
104
|
+
slot: Slot;
|
|
105
|
+
columnIndex: number;
|
|
106
|
+
}
|
|
107
|
+
| {
|
|
108
|
+
code: DataColumnSidecarErrorCode.INCORRECT_SIDECAR_SLOT;
|
|
109
|
+
columnIndex: number;
|
|
110
|
+
expected: Slot;
|
|
111
|
+
actual: Slot;
|
|
112
|
+
}
|
|
83
113
|
| {
|
|
84
114
|
code: DataColumnSidecarErrorCode.INCORRECT_HEADER_ROOT;
|
|
85
115
|
slot: number;
|
|
@@ -97,7 +127,8 @@ export type DataColumnSidecarErrorType =
|
|
|
97
127
|
actual: number;
|
|
98
128
|
}
|
|
99
129
|
| {code: DataColumnSidecarErrorCode.INVALID_KZG_PROOF_BATCH; slot: number; reason: string}
|
|
100
|
-
| {code: DataColumnSidecarErrorCode.INCORRECT_PROPOSER; actualProposerIndex: number; expectedProposerIndex: number}
|
|
130
|
+
| {code: DataColumnSidecarErrorCode.INCORRECT_PROPOSER; actualProposerIndex: number; expectedProposerIndex: number}
|
|
131
|
+
| {code: DataColumnSidecarErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING; slot: Slot; blockRoot: RootHex};
|
|
101
132
|
|
|
102
133
|
export class DataColumnSidecarGossipError extends GossipActionError<DataColumnSidecarErrorType> {}
|
|
103
134
|
export class DataColumnSidecarValidationError extends LodestarError<DataColumnSidecarErrorType> {}
|
|
@@ -10,18 +10,12 @@ import {
|
|
|
10
10
|
ForkChoiceOpts as RawForkChoiceOpts,
|
|
11
11
|
getCheckpointPayloadStatus,
|
|
12
12
|
} from "@lodestar/fork-choice";
|
|
13
|
-
import {ZERO_HASH_HEX} from "@lodestar/params";
|
|
13
|
+
import {ForkSeq, ZERO_HASH_HEX} from "@lodestar/params";
|
|
14
14
|
import {
|
|
15
|
-
CachedBeaconStateAllForks,
|
|
16
|
-
CachedBeaconStateGloas,
|
|
17
15
|
DataAvailabilityStatus,
|
|
18
|
-
|
|
16
|
+
IBeaconStateView,
|
|
19
17
|
computeEpochAtSlot,
|
|
20
18
|
computeStartSlotAtEpoch,
|
|
21
|
-
getBlockRootAtSlot,
|
|
22
|
-
getEffectiveBalanceIncrementsZeroInactive,
|
|
23
|
-
isExecutionStateType,
|
|
24
|
-
isMergeTransitionComplete,
|
|
25
19
|
} from "@lodestar/state-transition";
|
|
26
20
|
import {Slot, ssz} from "@lodestar/types";
|
|
27
21
|
import {Logger, toRootHex} from "@lodestar/utils";
|
|
@@ -46,7 +40,7 @@ export function initializeForkChoice(
|
|
|
46
40
|
config: ChainForkConfig,
|
|
47
41
|
emitter: ChainEventEmitter,
|
|
48
42
|
currentSlot: Slot,
|
|
49
|
-
state:
|
|
43
|
+
state: IBeaconStateView,
|
|
50
44
|
isFinalizedState: boolean,
|
|
51
45
|
opts: ForkChoiceOpts,
|
|
52
46
|
justifiedBalancesGetter: JustifiedBalancesGetter,
|
|
@@ -83,13 +77,13 @@ export function initializeForkChoiceFromFinalizedState(
|
|
|
83
77
|
config: ChainForkConfig,
|
|
84
78
|
emitter: ChainEventEmitter,
|
|
85
79
|
currentSlot: Slot,
|
|
86
|
-
state:
|
|
80
|
+
state: IBeaconStateView,
|
|
87
81
|
opts: ForkChoiceOpts,
|
|
88
82
|
justifiedBalancesGetter: JustifiedBalancesGetter,
|
|
89
83
|
metrics: Metrics | null,
|
|
90
84
|
logger?: Logger
|
|
91
85
|
): ForkChoice {
|
|
92
|
-
const {blockHeader, checkpoint} = computeAnchorCheckpoint(
|
|
86
|
+
const {blockHeader, checkpoint} = state.computeAnchorCheckpoint();
|
|
93
87
|
const finalizedCheckpoint = {...checkpoint};
|
|
94
88
|
const justifiedCheckpoint = {
|
|
95
89
|
...checkpoint,
|
|
@@ -100,19 +94,19 @@ export function initializeForkChoiceFromFinalizedState(
|
|
|
100
94
|
epoch: checkpoint.epoch === 0 ? checkpoint.epoch : checkpoint.epoch + 1,
|
|
101
95
|
};
|
|
102
96
|
|
|
103
|
-
const justifiedBalances = getEffectiveBalanceIncrementsZeroInactive(
|
|
97
|
+
const justifiedBalances = state.getEffectiveBalanceIncrementsZeroInactive();
|
|
104
98
|
|
|
105
99
|
// forkchoiceConstructor is only used for some test cases
|
|
106
100
|
// production code use ForkChoice constructor directly
|
|
107
101
|
const forkchoiceConstructor = opts.forkchoiceConstructor ?? ForkChoice;
|
|
108
102
|
|
|
109
|
-
const isForkPostGloas = (state
|
|
103
|
+
const isForkPostGloas = computeEpochAtSlot(state.slot) >= config.GLOAS_FORK_EPOCH;
|
|
110
104
|
|
|
111
105
|
// Determine justified checkpoint payload status
|
|
112
|
-
const justifiedPayloadStatus = getCheckpointPayloadStatus(state, justifiedCheckpoint.epoch);
|
|
106
|
+
const justifiedPayloadStatus = getCheckpointPayloadStatus(config, state, justifiedCheckpoint.epoch);
|
|
113
107
|
|
|
114
108
|
// Determine finalized checkpoint payload status
|
|
115
|
-
const finalizedPayloadStatus = getCheckpointPayloadStatus(state, finalizedCheckpoint.epoch);
|
|
109
|
+
const finalizedPayloadStatus = getCheckpointPayloadStatus(config, state, finalizedCheckpoint.epoch);
|
|
116
110
|
|
|
117
111
|
return new forkchoiceConstructor(
|
|
118
112
|
config,
|
|
@@ -148,21 +142,23 @@ export function initializeForkChoiceFromFinalizedState(
|
|
|
148
142
|
unrealizedFinalizedEpoch: finalizedCheckpoint.epoch,
|
|
149
143
|
unrealizedFinalizedRoot: toRootHex(finalizedCheckpoint.root),
|
|
150
144
|
|
|
151
|
-
...(isExecutionStateType
|
|
145
|
+
...(state.isExecutionStateType && state.isMergeTransitionComplete
|
|
152
146
|
? {
|
|
153
|
-
executionPayloadBlockHash: toRootHex(state.
|
|
154
|
-
|
|
147
|
+
executionPayloadBlockHash: toRootHex(state.latestBlockHash),
|
|
148
|
+
// TODO GLOAS: executionPayloadNumber is not tracked in BeaconState post-gloas (EIP-7732 removed
|
|
149
|
+
// latestExecutionPayloadHeader). Using 0 as unavailable fallback until a solution is found.
|
|
150
|
+
executionPayloadNumber: config.getForkSeq(state.slot) >= ForkSeq.gloas ? 0 : state.payloadBlockNumber,
|
|
155
151
|
executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
|
|
156
152
|
}
|
|
157
153
|
: {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
|
|
158
154
|
|
|
159
155
|
dataAvailabilityStatus: DataAvailabilityStatus.PreData,
|
|
160
156
|
payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL, // TODO GLOAS: Post-gloas how do we know if the checkpoint payload is FULL or EMPTY?
|
|
161
|
-
parentBlockHash: isForkPostGloas ? toRootHex(
|
|
157
|
+
parentBlockHash: isForkPostGloas ? toRootHex(state.latestBlockHash) : null,
|
|
162
158
|
},
|
|
163
159
|
currentSlot
|
|
164
160
|
),
|
|
165
|
-
state.
|
|
161
|
+
state.validatorCount,
|
|
166
162
|
metrics,
|
|
167
163
|
opts,
|
|
168
164
|
logger
|
|
@@ -176,15 +172,15 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
176
172
|
config: ChainForkConfig,
|
|
177
173
|
emitter: ChainEventEmitter,
|
|
178
174
|
currentSlot: Slot,
|
|
179
|
-
unfinalizedState:
|
|
175
|
+
unfinalizedState: IBeaconStateView,
|
|
180
176
|
opts: ForkChoiceOpts,
|
|
181
177
|
justifiedBalancesGetter: JustifiedBalancesGetter,
|
|
182
178
|
metrics: Metrics | null,
|
|
183
179
|
logger?: Logger
|
|
184
180
|
): ForkChoice {
|
|
185
|
-
const {blockHeader} = computeAnchorCheckpoint(
|
|
186
|
-
const finalizedCheckpoint = unfinalizedState.finalizedCheckpoint
|
|
187
|
-
const justifiedCheckpoint = unfinalizedState.currentJustifiedCheckpoint
|
|
181
|
+
const {blockHeader} = unfinalizedState.computeAnchorCheckpoint();
|
|
182
|
+
const finalizedCheckpoint = unfinalizedState.finalizedCheckpoint;
|
|
183
|
+
const justifiedCheckpoint = unfinalizedState.currentJustifiedCheckpoint;
|
|
188
184
|
const headRoot = toRootHex(ssz.phase0.BeaconBlockHeader.hashTreeRoot(blockHeader));
|
|
189
185
|
|
|
190
186
|
const logCtx = {
|
|
@@ -200,14 +196,14 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
200
196
|
logger?.warn("Initializing fork choice from unfinalized state", logCtx);
|
|
201
197
|
|
|
202
198
|
// this is not the justified state, but there is no other ways to get justified balances
|
|
203
|
-
const justifiedBalances = getEffectiveBalanceIncrementsZeroInactive(
|
|
199
|
+
const justifiedBalances = unfinalizedState.getEffectiveBalanceIncrementsZeroInactive();
|
|
204
200
|
|
|
205
|
-
const isForkPostGloas = (unfinalizedState
|
|
201
|
+
const isForkPostGloas = computeEpochAtSlot(unfinalizedState.slot) >= config.GLOAS_FORK_EPOCH;
|
|
206
202
|
|
|
207
203
|
// For unfinalized state, use getCheckpointPayloadStatus to determine the correct status.
|
|
208
204
|
// It checks state.execution_payload_availability to determine EMPTY vs FULL.
|
|
209
|
-
const justifiedPayloadStatus = getCheckpointPayloadStatus(unfinalizedState, justifiedCheckpoint.epoch);
|
|
210
|
-
const finalizedPayloadStatus = getCheckpointPayloadStatus(unfinalizedState, finalizedCheckpoint.epoch);
|
|
205
|
+
const justifiedPayloadStatus = getCheckpointPayloadStatus(config, unfinalizedState, justifiedCheckpoint.epoch);
|
|
206
|
+
const finalizedPayloadStatus = getCheckpointPayloadStatus(config, unfinalizedState, finalizedCheckpoint.epoch);
|
|
211
207
|
|
|
212
208
|
const store = new ForkChoiceStore(
|
|
213
209
|
currentSlot,
|
|
@@ -241,17 +237,20 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
241
237
|
unrealizedFinalizedEpoch: finalizedCheckpoint.epoch,
|
|
242
238
|
unrealizedFinalizedRoot: toRootHex(finalizedCheckpoint.root),
|
|
243
239
|
|
|
244
|
-
...(isExecutionStateType
|
|
240
|
+
...(unfinalizedState.isExecutionStateType && unfinalizedState.isMergeTransitionComplete
|
|
245
241
|
? {
|
|
246
|
-
executionPayloadBlockHash: toRootHex(unfinalizedState.
|
|
247
|
-
|
|
242
|
+
executionPayloadBlockHash: toRootHex(unfinalizedState.latestBlockHash),
|
|
243
|
+
// TODO GLOAS: executionPayloadNumber is not tracked in BeaconState post-gloas (EIP-7732 removed
|
|
244
|
+
// latestExecutionPayloadHeader). Using 0 as unavailable fallback until a solution is found.
|
|
245
|
+
executionPayloadNumber:
|
|
246
|
+
config.getForkSeq(unfinalizedState.slot) >= ForkSeq.gloas ? 0 : unfinalizedState.payloadBlockNumber,
|
|
248
247
|
executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
|
|
249
248
|
}
|
|
250
249
|
: {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
|
|
251
250
|
|
|
252
251
|
dataAvailabilityStatus: DataAvailabilityStatus.PreData,
|
|
253
252
|
payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL, // TODO GLOAS: Post-gloas how do we know if the checkpoint payload is FULL or EMPTY?
|
|
254
|
-
parentBlockHash: isForkPostGloas ? toRootHex(
|
|
253
|
+
parentBlockHash: isForkPostGloas ? toRootHex(unfinalizedState.latestBlockHash) : null,
|
|
255
254
|
};
|
|
256
255
|
|
|
257
256
|
const parentSlot = blockHeader.slot - 1;
|
|
@@ -265,7 +264,7 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
265
264
|
// dummy data, we're not able to regen state before headBlock
|
|
266
265
|
stateRoot: ZERO_HASH_HEX,
|
|
267
266
|
blockRoot: headBlock.parentRoot,
|
|
268
|
-
targetRoot: toRootHex(getBlockRootAtSlot(
|
|
267
|
+
targetRoot: toRootHex(unfinalizedState.getBlockRootAtSlot(computeStartSlotAtEpoch(parentEpoch))),
|
|
269
268
|
};
|
|
270
269
|
|
|
271
270
|
const justifiedBlock: ProtoBlock = {
|
|
@@ -303,13 +302,5 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
303
302
|
// production code use ForkChoice constructor directly
|
|
304
303
|
const forkchoiceConstructor = opts.forkchoiceConstructor ?? ForkChoice;
|
|
305
304
|
|
|
306
|
-
return new forkchoiceConstructor(
|
|
307
|
-
config,
|
|
308
|
-
store,
|
|
309
|
-
protoArray,
|
|
310
|
-
unfinalizedState.validators.length,
|
|
311
|
-
metrics,
|
|
312
|
-
opts,
|
|
313
|
-
logger
|
|
314
|
-
);
|
|
305
|
+
return new forkchoiceConstructor(config, store, protoArray, unfinalizedState.validatorCount, metrics, opts, logger);
|
|
315
306
|
}
|
package/src/chain/initState.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {ZERO_HASH} from "@lodestar/params";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
BeaconStateAllForks,
|
|
5
|
+
IBeaconStateView,
|
|
6
|
+
computeEpochAtSlot,
|
|
7
|
+
computeStartSlotAtEpoch,
|
|
8
|
+
} from "@lodestar/state-transition";
|
|
4
9
|
import {SignedBeaconBlock, ssz} from "@lodestar/types";
|
|
5
10
|
import {Logger, byteArrayEquals, toHex, toRootHex} from "@lodestar/utils";
|
|
6
11
|
import {GENESIS_SLOT} from "../constants/index.js";
|
|
@@ -119,7 +124,7 @@ export async function checkAndPersistAnchorState(
|
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
export function initBeaconMetrics(metrics: Metrics, state:
|
|
127
|
+
export function initBeaconMetrics(metrics: Metrics, state: IBeaconStateView): void {
|
|
123
128
|
metrics.headSlot.set(state.slot);
|
|
124
129
|
metrics.previousJustifiedEpoch.set(state.previousJustifiedCheckpoint.epoch);
|
|
125
130
|
metrics.currentJustifiedEpoch.set(state.currentJustifiedCheckpoint.epoch);
|
package/src/chain/interface.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Type} from "@chainsafe/ssz";
|
|
2
2
|
import {BeaconConfig} from "@lodestar/config";
|
|
3
3
|
import {CheckpointWithHex, CheckpointWithPayloadStatus, IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
|
|
4
|
-
import {
|
|
4
|
+
import {EpochShuffling, IBeaconStateView, PubkeyCache} from "@lodestar/state-transition";
|
|
5
5
|
import {
|
|
6
6
|
BeaconBlock,
|
|
7
7
|
BlindedBeaconBlock,
|
|
8
|
-
|
|
8
|
+
DataColumnSidecar,
|
|
9
9
|
Epoch,
|
|
10
10
|
Root,
|
|
11
11
|
RootHex,
|
|
@@ -159,6 +159,8 @@ export interface IBeaconChain {
|
|
|
159
159
|
close(): Promise<void>;
|
|
160
160
|
/** Chain has seen the specified block root or not. The block may not be processed yet, use forkchoice.hasBlock to check it */
|
|
161
161
|
seenBlock(blockRoot: RootHex): boolean;
|
|
162
|
+
/** Chain has seen a SignedExecutionPayloadEnvelope for this block root (via seenCache or fork choice FULL variant) */
|
|
163
|
+
seenPayloadEnvelope(blockRoot: RootHex): boolean;
|
|
162
164
|
/** Populate in-memory caches with persisted data. Call at least once on startup */
|
|
163
165
|
loadFromDisk(): Promise<void>;
|
|
164
166
|
/** Persist in-memory data to the DB. Call at least once before stopping the process */
|
|
@@ -166,9 +168,9 @@ export interface IBeaconChain {
|
|
|
166
168
|
|
|
167
169
|
validatorSeenAtEpoch(index: ValidatorIndex, epoch: Epoch): boolean;
|
|
168
170
|
|
|
169
|
-
getHeadState():
|
|
170
|
-
getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<
|
|
171
|
-
getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<
|
|
171
|
+
getHeadState(): IBeaconStateView;
|
|
172
|
+
getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<IBeaconStateView>;
|
|
173
|
+
getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<IBeaconStateView>;
|
|
172
174
|
|
|
173
175
|
getHistoricalStateBySlot(
|
|
174
176
|
slot: Slot
|
|
@@ -178,22 +180,22 @@ export interface IBeaconChain {
|
|
|
178
180
|
getStateBySlot(
|
|
179
181
|
slot: Slot,
|
|
180
182
|
opts?: StateGetOpts
|
|
181
|
-
): Promise<{state:
|
|
183
|
+
): Promise<{state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null>;
|
|
182
184
|
/** Returns a local state by state root */
|
|
183
185
|
getStateByStateRoot(
|
|
184
186
|
stateRoot: RootHex,
|
|
185
187
|
opts?: StateGetOpts
|
|
186
|
-
): Promise<{state:
|
|
188
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null>;
|
|
187
189
|
/** Return serialized bytes of a persisted checkpoint state */
|
|
188
190
|
getPersistedCheckpointState(checkpoint?: phase0.Checkpoint): Promise<Uint8Array | null>;
|
|
189
191
|
/** Returns a cached state by checkpoint */
|
|
190
192
|
getStateByCheckpoint(
|
|
191
193
|
checkpoint: CheckpointWithHex
|
|
192
|
-
): {state:
|
|
194
|
+
): {state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null;
|
|
193
195
|
/** Return state bytes by checkpoint */
|
|
194
196
|
getStateOrBytesByCheckpoint(
|
|
195
197
|
checkpoint: CheckpointWithPayloadStatus
|
|
196
|
-
): Promise<{state:
|
|
198
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null>;
|
|
197
199
|
|
|
198
200
|
/**
|
|
199
201
|
* Since we can have multiple parallel chains,
|
|
@@ -217,12 +219,13 @@ export interface IBeaconChain {
|
|
|
217
219
|
): Promise<{block: SignedBeaconBlock; executionOptimistic: boolean; finalized: boolean} | null>;
|
|
218
220
|
getBlobSidecars(blockSlot: Slot, blockRootHex: string): Promise<deneb.BlobSidecars | null>;
|
|
219
221
|
getSerializedBlobSidecars(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null>;
|
|
220
|
-
getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<
|
|
222
|
+
getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecar[]>;
|
|
221
223
|
getSerializedDataColumnSidecars(
|
|
222
224
|
blockSlot: Slot,
|
|
223
225
|
blockRootHex: string,
|
|
224
226
|
indices: number[]
|
|
225
227
|
): Promise<(Uint8Array | undefined)[]>;
|
|
228
|
+
getSerializedExecutionPayloadEnvelope(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null>;
|
|
226
229
|
|
|
227
230
|
produceCommonBlockBody(blockAttributes: BlockAttributes): Promise<CommonBlockBody>;
|
|
228
231
|
produceBlock(blockAttributes: BlockAttributes & {commonBlockBodyPromise: Promise<CommonBlockBody>}): Promise<{
|
|
@@ -261,14 +264,12 @@ export interface IBeaconChain {
|
|
|
261
264
|
|
|
262
265
|
persistBlock(data: BeaconBlock | BlindedBeaconBlock, suffix?: string): void;
|
|
263
266
|
persistInvalidStateRoot(
|
|
264
|
-
preState:
|
|
265
|
-
postState:
|
|
267
|
+
preState: IBeaconStateView,
|
|
268
|
+
postState: IBeaconStateView,
|
|
266
269
|
block: SignedBeaconBlock
|
|
267
270
|
): Promise<void>;
|
|
268
271
|
persistInvalidSszValue<T>(type: Type<T>, sszObject: T | Uint8Array, suffix?: string): void;
|
|
269
272
|
persistInvalidSszBytes(type: string, sszBytes: Uint8Array, suffix?: string): void;
|
|
270
|
-
/** Persist bad items to persistInvalidSszObjectsDir dir, for example invalid state, attestations etc. */
|
|
271
|
-
persistInvalidSszView(view: TreeView<CompositeTypeAny>, suffix?: string): void;
|
|
272
273
|
regenStateForAttestationVerification(
|
|
273
274
|
attEpoch: Epoch,
|
|
274
275
|
shufflingDependentRoot: RootHex,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {BitArray
|
|
1
|
+
import {BitArray} from "@chainsafe/ssz";
|
|
2
2
|
import {routes} from "@lodestar/api";
|
|
3
3
|
import {ChainForkConfig} from "@lodestar/config";
|
|
4
4
|
import {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isForkPostElectra,
|
|
22
22
|
} from "@lodestar/params";
|
|
23
23
|
import {
|
|
24
|
-
|
|
24
|
+
IBeaconStateView,
|
|
25
25
|
computeStartSlotAtEpoch,
|
|
26
26
|
computeSyncPeriodAtEpoch,
|
|
27
27
|
computeSyncPeriodAtSlot,
|
|
@@ -54,13 +54,7 @@ import {Metrics} from "../../metrics/index.js";
|
|
|
54
54
|
import {IClock} from "../../util/clock.js";
|
|
55
55
|
import {ChainEventEmitter} from "../emitter.js";
|
|
56
56
|
import {LightClientServerError, LightClientServerErrorCode} from "../errors/lightClientError.js";
|
|
57
|
-
import {
|
|
58
|
-
getBlockBodyExecutionHeaderProof,
|
|
59
|
-
getCurrentSyncCommitteeBranch,
|
|
60
|
-
getFinalizedRootProof,
|
|
61
|
-
getNextSyncCommitteeBranch,
|
|
62
|
-
getSyncCommitteesWitness,
|
|
63
|
-
} from "./proofs.js";
|
|
57
|
+
import {getBlockBodyExecutionHeaderProof, getCurrentSyncCommitteeBranch, getNextSyncCommitteeBranch} from "./proofs.js";
|
|
64
58
|
|
|
65
59
|
export type LightClientServerOpts = {
|
|
66
60
|
disableLightClientServerOnImportBlockHead?: boolean;
|
|
@@ -266,11 +260,7 @@ export class LightClientServer {
|
|
|
266
260
|
* - Persist state witness
|
|
267
261
|
* - Use block's syncAggregate
|
|
268
262
|
*/
|
|
269
|
-
onImportBlockHead(
|
|
270
|
-
block: BeaconBlock<ForkPostAltair>,
|
|
271
|
-
postState: CachedBeaconStateAltair,
|
|
272
|
-
parentBlockSlot: Slot
|
|
273
|
-
): void {
|
|
263
|
+
onImportBlockHead(block: BeaconBlock<ForkPostAltair>, postState: IBeaconStateView, parentBlockSlot: Slot): void {
|
|
274
264
|
// TEMP: To disable this functionality for fork_choice spec tests.
|
|
275
265
|
// Since the tests have deep-reorgs attested data is not available often printing lots of error logs.
|
|
276
266
|
// While this function is only called for head blocks, best to disable.
|
|
@@ -406,7 +396,7 @@ export class LightClientServer {
|
|
|
406
396
|
|
|
407
397
|
private async persistPostBlockImportData(
|
|
408
398
|
block: BeaconBlock<ForkPostAltair>,
|
|
409
|
-
postState:
|
|
399
|
+
postState: IBeaconStateView,
|
|
410
400
|
parentBlockSlot: Slot
|
|
411
401
|
): Promise<void> {
|
|
412
402
|
const blockSlot = block.slot;
|
|
@@ -416,7 +406,7 @@ export class LightClientServer {
|
|
|
416
406
|
const blockRoot = ssz.phase0.BeaconBlockHeader.hashTreeRoot(header.beacon);
|
|
417
407
|
const blockRootHex = toRootHex(blockRoot);
|
|
418
408
|
|
|
419
|
-
const syncCommitteeWitness = getSyncCommitteesWitness(
|
|
409
|
+
const syncCommitteeWitness = postState.getSyncCommitteesWitness();
|
|
420
410
|
|
|
421
411
|
// Only store current sync committee once per run
|
|
422
412
|
if (!this.storedCurrentSyncCommittee) {
|
|
@@ -466,7 +456,7 @@ export class LightClientServer {
|
|
|
466
456
|
isFinalized: true,
|
|
467
457
|
attestedHeader: header,
|
|
468
458
|
blockRoot,
|
|
469
|
-
finalityBranch: getFinalizedRootProof(
|
|
459
|
+
finalityBranch: postState.getFinalizedRootProof(),
|
|
470
460
|
finalizedCheckpoint,
|
|
471
461
|
}
|
|
472
462
|
: {
|
|
@@ -724,13 +714,10 @@ export class LightClientServer {
|
|
|
724
714
|
);
|
|
725
715
|
}
|
|
726
716
|
|
|
727
|
-
private async storeSyncCommittee(
|
|
728
|
-
syncCommittee: CompositeViewDU<typeof ssz.altair.SyncCommittee>,
|
|
729
|
-
syncCommitteeRoot: Uint8Array
|
|
730
|
-
): Promise<void> {
|
|
717
|
+
private async storeSyncCommittee(syncCommittee: altair.SyncCommittee, syncCommitteeRoot: Uint8Array): Promise<void> {
|
|
731
718
|
const isKnown = await this.db.syncCommittee.has(syncCommitteeRoot);
|
|
732
719
|
if (!isKnown) {
|
|
733
|
-
await this.db.syncCommittee.putBinary(syncCommitteeRoot,
|
|
720
|
+
await this.db.syncCommittee.putBinary(syncCommitteeRoot, ssz.altair.SyncCommittee.serialize(syncCommittee));
|
|
734
721
|
}
|
|
735
722
|
}
|
|
736
723
|
|