@lodestar/beacon-node 1.42.0-dev.f6213da56d → 1.42.0-dev.fb8f8a700e
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.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +5 -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 +38 -40
- 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 +8 -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 +33 -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 +37 -23
- 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 +87 -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 +5 -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 +4 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +15 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +110 -62
- 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 +30 -24
- 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 +13 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/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 +10 -4
- 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 +21 -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/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 +10 -7
- 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 +5 -3
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +5 -3
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/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 +17 -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 +5 -2
- 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 +11 -9
- 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/gossip/topic.d.ts +2 -729
- package/lib/network/gossip/topic.d.ts.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 +269 -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 +313 -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 +3 -3
- 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 +25 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +189 -2
- 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 +5 -1
- package/src/api/impl/beacon/state/index.ts +43 -55
- 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 +8 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +36 -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 +50 -31
- package/src/chain/blocks/importExecutionPayload.ts +98 -62
- 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 +10 -14
- package/src/chain/blocks/verifyBlocksSignatures.ts +10 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +148 -95
- 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 +35 -41
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +16 -15
- package/src/chain/lightClient/index.ts +9 -18
- package/src/chain/opPools/aggregatedAttestationPool.ts +20 -21
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- 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 +14 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +7 -10
- package/src/chain/produceBlock/produceBlockBody.ts +38 -45
- 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/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +3 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +10 -10
- package/src/chain/validation/executionPayloadEnvelope.ts +5 -4
- package/src/chain/validation/payloadAttestationMessage.ts +6 -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 +25 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +9 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +15 -13
- 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 +334 -94
- package/src/network/processor/index.ts +395 -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 +6 -5
- package/src/node/notifier.ts +5 -6
- 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 +245 -3
- 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> {}
|
|
@@ -12,16 +12,12 @@ import {
|
|
|
12
12
|
} from "@lodestar/fork-choice";
|
|
13
13
|
import {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
|
-
|
|
22
|
-
|
|
23
|
-
isExecutionStateType,
|
|
24
|
-
isMergeTransitionComplete,
|
|
19
|
+
isStatePostBellatrix,
|
|
20
|
+
isStatePostGloas,
|
|
25
21
|
} from "@lodestar/state-transition";
|
|
26
22
|
import {Slot, ssz} from "@lodestar/types";
|
|
27
23
|
import {Logger, toRootHex} from "@lodestar/utils";
|
|
@@ -46,7 +42,7 @@ export function initializeForkChoice(
|
|
|
46
42
|
config: ChainForkConfig,
|
|
47
43
|
emitter: ChainEventEmitter,
|
|
48
44
|
currentSlot: Slot,
|
|
49
|
-
state:
|
|
45
|
+
state: IBeaconStateView,
|
|
50
46
|
isFinalizedState: boolean,
|
|
51
47
|
opts: ForkChoiceOpts,
|
|
52
48
|
justifiedBalancesGetter: JustifiedBalancesGetter,
|
|
@@ -83,13 +79,13 @@ export function initializeForkChoiceFromFinalizedState(
|
|
|
83
79
|
config: ChainForkConfig,
|
|
84
80
|
emitter: ChainEventEmitter,
|
|
85
81
|
currentSlot: Slot,
|
|
86
|
-
state:
|
|
82
|
+
state: IBeaconStateView,
|
|
87
83
|
opts: ForkChoiceOpts,
|
|
88
84
|
justifiedBalancesGetter: JustifiedBalancesGetter,
|
|
89
85
|
metrics: Metrics | null,
|
|
90
86
|
logger?: Logger
|
|
91
87
|
): ForkChoice {
|
|
92
|
-
const {blockHeader, checkpoint} = computeAnchorCheckpoint(
|
|
88
|
+
const {blockHeader, checkpoint} = state.computeAnchorCheckpoint();
|
|
93
89
|
const finalizedCheckpoint = {...checkpoint};
|
|
94
90
|
const justifiedCheckpoint = {
|
|
95
91
|
...checkpoint,
|
|
@@ -100,19 +96,19 @@ export function initializeForkChoiceFromFinalizedState(
|
|
|
100
96
|
epoch: checkpoint.epoch === 0 ? checkpoint.epoch : checkpoint.epoch + 1,
|
|
101
97
|
};
|
|
102
98
|
|
|
103
|
-
const justifiedBalances = getEffectiveBalanceIncrementsZeroInactive(
|
|
99
|
+
const justifiedBalances = state.getEffectiveBalanceIncrementsZeroInactive();
|
|
104
100
|
|
|
105
101
|
// forkchoiceConstructor is only used for some test cases
|
|
106
102
|
// production code use ForkChoice constructor directly
|
|
107
103
|
const forkchoiceConstructor = opts.forkchoiceConstructor ?? ForkChoice;
|
|
108
104
|
|
|
109
|
-
const isForkPostGloas = (state
|
|
105
|
+
const isForkPostGloas = computeEpochAtSlot(state.slot) >= config.GLOAS_FORK_EPOCH;
|
|
110
106
|
|
|
111
107
|
// Determine justified checkpoint payload status
|
|
112
|
-
const justifiedPayloadStatus = getCheckpointPayloadStatus(state, justifiedCheckpoint.epoch);
|
|
108
|
+
const justifiedPayloadStatus = getCheckpointPayloadStatus(config, state, justifiedCheckpoint.epoch);
|
|
113
109
|
|
|
114
110
|
// Determine finalized checkpoint payload status
|
|
115
|
-
const finalizedPayloadStatus = getCheckpointPayloadStatus(state, finalizedCheckpoint.epoch);
|
|
111
|
+
const finalizedPayloadStatus = getCheckpointPayloadStatus(config, state, finalizedCheckpoint.epoch);
|
|
116
112
|
|
|
117
113
|
return new forkchoiceConstructor(
|
|
118
114
|
config,
|
|
@@ -148,21 +144,23 @@ export function initializeForkChoiceFromFinalizedState(
|
|
|
148
144
|
unrealizedFinalizedEpoch: finalizedCheckpoint.epoch,
|
|
149
145
|
unrealizedFinalizedRoot: toRootHex(finalizedCheckpoint.root),
|
|
150
146
|
|
|
151
|
-
...(
|
|
147
|
+
...(isStatePostBellatrix(state) && state.isExecutionStateType && state.isMergeTransitionComplete
|
|
152
148
|
? {
|
|
153
|
-
executionPayloadBlockHash: toRootHex(state.
|
|
154
|
-
|
|
149
|
+
executionPayloadBlockHash: toRootHex(state.latestBlockHash),
|
|
150
|
+
// TODO GLOAS: executionPayloadNumber is not tracked in BeaconState post-gloas (EIP-7732 removed
|
|
151
|
+
// latestExecutionPayloadHeader). Using 0 as unavailable fallback until a solution is found.
|
|
152
|
+
executionPayloadNumber: isStatePostGloas(state) ? 0 : state.payloadBlockNumber,
|
|
155
153
|
executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
|
|
156
154
|
}
|
|
157
155
|
: {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
|
|
158
156
|
|
|
159
157
|
dataAvailabilityStatus: DataAvailabilityStatus.PreData,
|
|
160
158
|
payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL, // TODO GLOAS: Post-gloas how do we know if the checkpoint payload is FULL or EMPTY?
|
|
161
|
-
parentBlockHash:
|
|
159
|
+
parentBlockHash: isStatePostGloas(state) ? toRootHex(state.latestBlockHash) : null,
|
|
162
160
|
},
|
|
163
161
|
currentSlot
|
|
164
162
|
),
|
|
165
|
-
state.
|
|
163
|
+
state.validatorCount,
|
|
166
164
|
metrics,
|
|
167
165
|
opts,
|
|
168
166
|
logger
|
|
@@ -176,15 +174,15 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
176
174
|
config: ChainForkConfig,
|
|
177
175
|
emitter: ChainEventEmitter,
|
|
178
176
|
currentSlot: Slot,
|
|
179
|
-
unfinalizedState:
|
|
177
|
+
unfinalizedState: IBeaconStateView,
|
|
180
178
|
opts: ForkChoiceOpts,
|
|
181
179
|
justifiedBalancesGetter: JustifiedBalancesGetter,
|
|
182
180
|
metrics: Metrics | null,
|
|
183
181
|
logger?: Logger
|
|
184
182
|
): ForkChoice {
|
|
185
|
-
const {blockHeader} = computeAnchorCheckpoint(
|
|
186
|
-
const finalizedCheckpoint = unfinalizedState.finalizedCheckpoint
|
|
187
|
-
const justifiedCheckpoint = unfinalizedState.currentJustifiedCheckpoint
|
|
183
|
+
const {blockHeader} = unfinalizedState.computeAnchorCheckpoint();
|
|
184
|
+
const finalizedCheckpoint = unfinalizedState.finalizedCheckpoint;
|
|
185
|
+
const justifiedCheckpoint = unfinalizedState.currentJustifiedCheckpoint;
|
|
188
186
|
const headRoot = toRootHex(ssz.phase0.BeaconBlockHeader.hashTreeRoot(blockHeader));
|
|
189
187
|
|
|
190
188
|
const logCtx = {
|
|
@@ -200,14 +198,14 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
200
198
|
logger?.warn("Initializing fork choice from unfinalized state", logCtx);
|
|
201
199
|
|
|
202
200
|
// this is not the justified state, but there is no other ways to get justified balances
|
|
203
|
-
const justifiedBalances = getEffectiveBalanceIncrementsZeroInactive(
|
|
201
|
+
const justifiedBalances = unfinalizedState.getEffectiveBalanceIncrementsZeroInactive();
|
|
204
202
|
|
|
205
|
-
const isForkPostGloas = (unfinalizedState
|
|
203
|
+
const isForkPostGloas = computeEpochAtSlot(unfinalizedState.slot) >= config.GLOAS_FORK_EPOCH;
|
|
206
204
|
|
|
207
205
|
// For unfinalized state, use getCheckpointPayloadStatus to determine the correct status.
|
|
208
206
|
// 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);
|
|
207
|
+
const justifiedPayloadStatus = getCheckpointPayloadStatus(config, unfinalizedState, justifiedCheckpoint.epoch);
|
|
208
|
+
const finalizedPayloadStatus = getCheckpointPayloadStatus(config, unfinalizedState, finalizedCheckpoint.epoch);
|
|
211
209
|
|
|
212
210
|
const store = new ForkChoiceStore(
|
|
213
211
|
currentSlot,
|
|
@@ -241,17 +239,21 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
241
239
|
unrealizedFinalizedEpoch: finalizedCheckpoint.epoch,
|
|
242
240
|
unrealizedFinalizedRoot: toRootHex(finalizedCheckpoint.root),
|
|
243
241
|
|
|
244
|
-
...(
|
|
242
|
+
...(isStatePostBellatrix(unfinalizedState) &&
|
|
243
|
+
unfinalizedState.isExecutionStateType &&
|
|
244
|
+
unfinalizedState.isMergeTransitionComplete
|
|
245
245
|
? {
|
|
246
|
-
executionPayloadBlockHash: toRootHex(unfinalizedState.
|
|
247
|
-
|
|
246
|
+
executionPayloadBlockHash: toRootHex(unfinalizedState.latestBlockHash),
|
|
247
|
+
// TODO GLOAS: executionPayloadNumber is not tracked in BeaconState post-gloas (EIP-7732 removed
|
|
248
|
+
// latestExecutionPayloadHeader). Using 0 as unavailable fallback until a solution is found.
|
|
249
|
+
executionPayloadNumber: isStatePostGloas(unfinalizedState) ? 0 : unfinalizedState.payloadBlockNumber,
|
|
248
250
|
executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
|
|
249
251
|
}
|
|
250
252
|
: {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
|
|
251
253
|
|
|
252
254
|
dataAvailabilityStatus: DataAvailabilityStatus.PreData,
|
|
253
255
|
payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL, // TODO GLOAS: Post-gloas how do we know if the checkpoint payload is FULL or EMPTY?
|
|
254
|
-
parentBlockHash:
|
|
256
|
+
parentBlockHash: isStatePostGloas(unfinalizedState) ? toRootHex(unfinalizedState.latestBlockHash) : null,
|
|
255
257
|
};
|
|
256
258
|
|
|
257
259
|
const parentSlot = blockHeader.slot - 1;
|
|
@@ -265,7 +267,7 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
265
267
|
// dummy data, we're not able to regen state before headBlock
|
|
266
268
|
stateRoot: ZERO_HASH_HEX,
|
|
267
269
|
blockRoot: headBlock.parentRoot,
|
|
268
|
-
targetRoot: toRootHex(getBlockRootAtSlot(
|
|
270
|
+
targetRoot: toRootHex(unfinalizedState.getBlockRootAtSlot(computeStartSlotAtEpoch(parentEpoch))),
|
|
269
271
|
};
|
|
270
272
|
|
|
271
273
|
const justifiedBlock: ProtoBlock = {
|
|
@@ -303,13 +305,5 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
303
305
|
// production code use ForkChoice constructor directly
|
|
304
306
|
const forkchoiceConstructor = opts.forkchoiceConstructor ?? ForkChoice;
|
|
305
307
|
|
|
306
|
-
return new forkchoiceConstructor(
|
|
307
|
-
config,
|
|
308
|
-
store,
|
|
309
|
-
protoArray,
|
|
310
|
-
unfinalizedState.validators.length,
|
|
311
|
-
metrics,
|
|
312
|
-
opts,
|
|
313
|
-
logger
|
|
314
|
-
);
|
|
308
|
+
return new forkchoiceConstructor(config, store, protoArray, unfinalizedState.validatorCount, metrics, opts, logger);
|
|
315
309
|
}
|
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
|
+
type IBeaconStateViewAltair,
|
|
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;
|
|
@@ -268,7 +262,7 @@ export class LightClientServer {
|
|
|
268
262
|
*/
|
|
269
263
|
onImportBlockHead(
|
|
270
264
|
block: BeaconBlock<ForkPostAltair>,
|
|
271
|
-
postState:
|
|
265
|
+
postState: IBeaconStateViewAltair,
|
|
272
266
|
parentBlockSlot: Slot
|
|
273
267
|
): void {
|
|
274
268
|
// TEMP: To disable this functionality for fork_choice spec tests.
|
|
@@ -406,7 +400,7 @@ export class LightClientServer {
|
|
|
406
400
|
|
|
407
401
|
private async persistPostBlockImportData(
|
|
408
402
|
block: BeaconBlock<ForkPostAltair>,
|
|
409
|
-
postState:
|
|
403
|
+
postState: IBeaconStateViewAltair,
|
|
410
404
|
parentBlockSlot: Slot
|
|
411
405
|
): Promise<void> {
|
|
412
406
|
const blockSlot = block.slot;
|
|
@@ -416,7 +410,7 @@ export class LightClientServer {
|
|
|
416
410
|
const blockRoot = ssz.phase0.BeaconBlockHeader.hashTreeRoot(header.beacon);
|
|
417
411
|
const blockRootHex = toRootHex(blockRoot);
|
|
418
412
|
|
|
419
|
-
const syncCommitteeWitness = getSyncCommitteesWitness(
|
|
413
|
+
const syncCommitteeWitness = postState.getSyncCommitteesWitness();
|
|
420
414
|
|
|
421
415
|
// Only store current sync committee once per run
|
|
422
416
|
if (!this.storedCurrentSyncCommittee) {
|
|
@@ -466,7 +460,7 @@ export class LightClientServer {
|
|
|
466
460
|
isFinalized: true,
|
|
467
461
|
attestedHeader: header,
|
|
468
462
|
blockRoot,
|
|
469
|
-
finalityBranch: getFinalizedRootProof(
|
|
463
|
+
finalityBranch: postState.getFinalizedRootProof(),
|
|
470
464
|
finalizedCheckpoint,
|
|
471
465
|
}
|
|
472
466
|
: {
|
|
@@ -724,13 +718,10 @@ export class LightClientServer {
|
|
|
724
718
|
);
|
|
725
719
|
}
|
|
726
720
|
|
|
727
|
-
private async storeSyncCommittee(
|
|
728
|
-
syncCommittee: CompositeViewDU<typeof ssz.altair.SyncCommittee>,
|
|
729
|
-
syncCommitteeRoot: Uint8Array
|
|
730
|
-
): Promise<void> {
|
|
721
|
+
private async storeSyncCommittee(syncCommittee: altair.SyncCommittee, syncCommitteeRoot: Uint8Array): Promise<void> {
|
|
731
722
|
const isKnown = await this.db.syncCommittee.has(syncCommitteeRoot);
|
|
732
723
|
if (!isKnown) {
|
|
733
|
-
await this.db.syncCommittee.putBinary(syncCommitteeRoot,
|
|
724
|
+
await this.db.syncCommittee.putBinary(syncCommitteeRoot, ssz.altair.SyncCommittee.serialize(syncCommittee));
|
|
734
725
|
}
|
|
735
726
|
}
|
|
736
727
|
|