@lodestar/beacon-node 1.42.0-dev.1d50253953 → 1.42.0-dev.2219bb0cb8
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 +45 -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 +35 -29
- 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 +16 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +123 -66
- 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 +15 -5
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +4 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/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 +16 -14
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +11 -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 +9 -10
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +7 -7
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +32 -17
- 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 +28 -6
- 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 +7 -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/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/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js +2 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js +2 -0
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +7 -3
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +6 -0
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +7 -3
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +70 -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 +23 -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 +62 -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 +38 -43
- 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 +167 -98
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +11 -5
- 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 +21 -15
- package/src/chain/lightClient/index.ts +17 -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 +13 -16
- package/src/chain/produceBlock/produceBlockBody.ts +51 -48
- 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 +31 -10
- 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 +7 -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/beaconBlocksByRange.ts +3 -1
- package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +3 -0
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +15 -3
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +11 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +19 -3
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +96 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +34 -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/chain.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import {PrivateKey} from "@libp2p/interface";
|
|
3
|
-
import {
|
|
3
|
+
import {Type} from "@chainsafe/ssz";
|
|
4
4
|
import {BeaconConfig} from "@lodestar/config";
|
|
5
5
|
import {
|
|
6
6
|
CheckpointWithPayloadStatus,
|
|
@@ -14,36 +14,30 @@ import {LoggerNode} from "@lodestar/logger/node";
|
|
|
14
14
|
import {
|
|
15
15
|
BUILDER_INDEX_SELF_BUILD,
|
|
16
16
|
EFFECTIVE_BALANCE_INCREMENT,
|
|
17
|
-
ForkPostFulu,
|
|
17
|
+
type ForkPostFulu,
|
|
18
|
+
type ForkPostGloas,
|
|
18
19
|
GENESIS_SLOT,
|
|
19
20
|
SLOTS_PER_EPOCH,
|
|
20
|
-
isForkPostElectra,
|
|
21
21
|
isForkPostGloas,
|
|
22
22
|
} from "@lodestar/params";
|
|
23
23
|
import {
|
|
24
|
-
BeaconStateAllForks,
|
|
25
|
-
BeaconStateElectra,
|
|
26
|
-
CachedBeaconStateAllForks,
|
|
27
|
-
CachedBeaconStateGloas,
|
|
28
24
|
EffectiveBalanceIncrements,
|
|
29
25
|
EpochShuffling,
|
|
26
|
+
IBeaconStateView,
|
|
30
27
|
PubkeyCache,
|
|
31
|
-
computeAnchorCheckpoint,
|
|
32
|
-
computeAttestationsRewards,
|
|
33
|
-
computeBlockRewards,
|
|
34
28
|
computeEndSlotAtEpoch,
|
|
35
29
|
computeEpochAtSlot,
|
|
36
30
|
computeStartSlotAtEpoch,
|
|
37
|
-
computeSyncCommitteeRewards,
|
|
38
|
-
getEffectiveBalanceIncrementsZeroInactive,
|
|
39
31
|
getEffectiveBalancesFromStateBytes,
|
|
40
|
-
|
|
32
|
+
isStatePostAltair,
|
|
33
|
+
isStatePostElectra,
|
|
34
|
+
isStatePostGloas,
|
|
41
35
|
} from "@lodestar/state-transition";
|
|
42
36
|
import {
|
|
43
37
|
BeaconBlock,
|
|
44
38
|
BlindedBeaconBlock,
|
|
45
39
|
BlindedBeaconBlockBody,
|
|
46
|
-
|
|
40
|
+
DataColumnSidecar,
|
|
47
41
|
Epoch,
|
|
48
42
|
Root,
|
|
49
43
|
RootHex,
|
|
@@ -106,7 +100,7 @@ import {
|
|
|
106
100
|
} from "./opPools/index.js";
|
|
107
101
|
import {IChainOptions} from "./options.js";
|
|
108
102
|
import {PrepareNextSlotScheduler} from "./prepareNextSlot.js";
|
|
109
|
-
import {
|
|
103
|
+
import {computeNewStateRoot, computePayloadEnvelopeStateRoot} from "./produceBlock/computeNewStateRoot.js";
|
|
110
104
|
import {AssembledBlockType, BlockType, ProduceFullGloas, ProduceResult} from "./produceBlock/index.js";
|
|
111
105
|
import {BlockAttributes, produceBlockBody, produceCommonBlockBody} from "./produceBlock/produceBlockBody.js";
|
|
112
106
|
import {QueuedStateRegenerator, RegenCaller} from "./regen/index.js";
|
|
@@ -283,7 +277,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
283
277
|
clock?: IClock;
|
|
284
278
|
metrics: Metrics | null;
|
|
285
279
|
validatorMonitor: ValidatorMonitor | null;
|
|
286
|
-
anchorState:
|
|
280
|
+
anchorState: IBeaconStateView;
|
|
287
281
|
isAnchorStateFinalized: boolean;
|
|
288
282
|
executionEngine: IExecutionEngine;
|
|
289
283
|
executionBuilder?: IExecutionBuilder;
|
|
@@ -359,16 +353,16 @@ export class BeaconChain implements IBeaconChain {
|
|
|
359
353
|
|
|
360
354
|
this.shufflingCache = new ShufflingCache(metrics, logger, this.opts, [
|
|
361
355
|
{
|
|
362
|
-
shuffling: anchorState.
|
|
363
|
-
decisionRoot: anchorState.
|
|
356
|
+
shuffling: anchorState.getPreviousShuffling(),
|
|
357
|
+
decisionRoot: anchorState.previousDecisionRoot,
|
|
364
358
|
},
|
|
365
359
|
{
|
|
366
|
-
shuffling: anchorState.
|
|
367
|
-
decisionRoot: anchorState.
|
|
360
|
+
shuffling: anchorState.getCurrentShuffling(),
|
|
361
|
+
decisionRoot: anchorState.currentDecisionRoot,
|
|
368
362
|
},
|
|
369
363
|
{
|
|
370
|
-
shuffling: anchorState.
|
|
371
|
-
decisionRoot: anchorState.
|
|
364
|
+
shuffling: anchorState.getNextShuffling(),
|
|
365
|
+
decisionRoot: anchorState.nextDecisionRoot,
|
|
372
366
|
},
|
|
373
367
|
]);
|
|
374
368
|
|
|
@@ -377,7 +371,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
377
371
|
|
|
378
372
|
const fileDataStore = opts.nHistoricalStatesFileDataStore ?? true;
|
|
379
373
|
const blockStateCache = new FIFOBlockStateCache(this.opts, {metrics});
|
|
380
|
-
this.bufferPool = new BufferPool(anchorState.
|
|
374
|
+
this.bufferPool = new BufferPool(anchorState.serializedSize(), metrics);
|
|
381
375
|
|
|
382
376
|
this.cpStateDatastore = fileDataStore ? new FileCPStateDatastore(dataDir) : new DbCPStateDatastore(this.db);
|
|
383
377
|
const checkpointStateCache: CheckpointStateCache = new PersistentCheckpointStateCache(
|
|
@@ -393,10 +387,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
393
387
|
this.opts
|
|
394
388
|
);
|
|
395
389
|
|
|
396
|
-
const {checkpoint} = computeAnchorCheckpoint(
|
|
390
|
+
const {checkpoint} = anchorState.computeAnchorCheckpoint();
|
|
397
391
|
blockStateCache.add(anchorState);
|
|
398
392
|
blockStateCache.setHeadState(anchorState);
|
|
399
|
-
const payloadPresent = getCheckpointPayloadStatus(anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
393
|
+
const payloadPresent = getCheckpointPayloadStatus(config, anchorState, checkpoint.epoch) === PayloadStatus.FULL;
|
|
400
394
|
checkpointStateCache.add(checkpoint, anchorState, payloadPresent);
|
|
401
395
|
|
|
402
396
|
const forkChoice = initializeForkChoice(
|
|
@@ -513,7 +507,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
513
507
|
}
|
|
514
508
|
|
|
515
509
|
seenBlock(blockRoot: RootHex): boolean {
|
|
516
|
-
return this.seenBlockInputCache.
|
|
510
|
+
return this.seenBlockInputCache.hasBlock(blockRoot) || this.forkChoice.hasBlockHexUnsafe(blockRoot);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
seenPayloadEnvelope(blockRoot: RootHex): boolean {
|
|
514
|
+
return this.seenPayloadEnvelopeInputCache.hasPayload(blockRoot) || this.forkChoice.hasPayloadHexUnsafe(blockRoot);
|
|
517
515
|
}
|
|
518
516
|
|
|
519
517
|
regenCanAcceptWork(): boolean {
|
|
@@ -557,7 +555,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
557
555
|
await this.opPool.toPersisted(this.db);
|
|
558
556
|
}
|
|
559
557
|
|
|
560
|
-
getHeadState():
|
|
558
|
+
getHeadState(): IBeaconStateView {
|
|
561
559
|
// head state should always exist
|
|
562
560
|
const head = this.forkChoice.getHead();
|
|
563
561
|
const headState = this.regen.getClosestHeadState(head);
|
|
@@ -567,11 +565,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
567
565
|
return headState;
|
|
568
566
|
}
|
|
569
567
|
|
|
570
|
-
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<
|
|
568
|
+
async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
571
569
|
return this.getHeadStateAtEpoch(this.clock.currentEpoch, regenCaller);
|
|
572
570
|
}
|
|
573
571
|
|
|
574
|
-
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<
|
|
572
|
+
async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<IBeaconStateView> {
|
|
575
573
|
// using getHeadState() means we'll use checkpointStateCache if it's available
|
|
576
574
|
const headState = this.getHeadState();
|
|
577
575
|
// head state is in the same epoch, or we pulled up head state already from past epoch
|
|
@@ -588,7 +586,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
588
586
|
async getStateBySlot(
|
|
589
587
|
slot: Slot,
|
|
590
588
|
opts?: StateGetOpts
|
|
591
|
-
): Promise<{state:
|
|
589
|
+
): Promise<{state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
592
590
|
const finalizedBlock = this.forkChoice.getFinalizedBlock();
|
|
593
591
|
|
|
594
592
|
if (slot < finalizedBlock.slot) {
|
|
@@ -638,15 +636,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
638
636
|
async getStateByStateRoot(
|
|
639
637
|
stateRoot: RootHex,
|
|
640
638
|
opts?: StateGetOpts
|
|
641
|
-
): Promise<{state:
|
|
639
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
642
640
|
if (opts?.allowRegen) {
|
|
643
641
|
const state = await this.regen.getState(stateRoot, RegenCaller.restApi);
|
|
644
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
642
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
643
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(state.latestBlockHeader)
|
|
644
|
+
);
|
|
645
645
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
646
646
|
return {
|
|
647
647
|
state,
|
|
648
648
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
649
|
-
finalized: state.
|
|
649
|
+
finalized: state.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
652
|
|
|
@@ -657,12 +657,14 @@ export class BeaconChain implements IBeaconChain {
|
|
|
657
657
|
// TODO: This is very inneficient for debug requests of serialized content, since it deserializes to serialize again
|
|
658
658
|
const cachedStateCtx = this.regen.getStateSync(stateRoot);
|
|
659
659
|
if (cachedStateCtx) {
|
|
660
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
660
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
661
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
662
|
+
);
|
|
661
663
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
662
664
|
return {
|
|
663
665
|
state: cachedStateCtx,
|
|
664
666
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
665
|
-
finalized: cachedStateCtx.
|
|
667
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
666
668
|
};
|
|
667
669
|
}
|
|
668
670
|
|
|
@@ -689,17 +691,19 @@ export class BeaconChain implements IBeaconChain {
|
|
|
689
691
|
|
|
690
692
|
getStateByCheckpoint(
|
|
691
693
|
checkpoint: CheckpointWithPayloadStatus
|
|
692
|
-
): {state:
|
|
694
|
+
): {state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null {
|
|
693
695
|
// finalized or justified checkpoint states maynot be available with PersistentCheckpointStateCache, use getCheckpointStateOrBytes() api to get Uint8Array
|
|
694
696
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
695
697
|
const cachedStateCtx = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
696
698
|
if (cachedStateCtx) {
|
|
697
|
-
const block = this.forkChoice.getBlockDefaultStatus(
|
|
699
|
+
const block = this.forkChoice.getBlockDefaultStatus(
|
|
700
|
+
ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
|
|
701
|
+
);
|
|
698
702
|
const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
|
|
699
703
|
return {
|
|
700
704
|
state: cachedStateCtx,
|
|
701
705
|
executionOptimistic: block != null && isOptimisticBlock(block),
|
|
702
|
-
finalized: cachedStateCtx.
|
|
706
|
+
finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
|
|
703
707
|
};
|
|
704
708
|
}
|
|
705
709
|
|
|
@@ -708,7 +712,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
708
712
|
|
|
709
713
|
async getStateOrBytesByCheckpoint(
|
|
710
714
|
checkpoint: CheckpointWithPayloadStatus
|
|
711
|
-
): Promise<{state:
|
|
715
|
+
): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
712
716
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
713
717
|
const cachedStateCtx = await this.regen.getCheckpointStateOrBytes(checkpointHexPayload);
|
|
714
718
|
if (cachedStateCtx) {
|
|
@@ -858,20 +862,66 @@ export class BeaconChain implements IBeaconChain {
|
|
|
858
862
|
return null;
|
|
859
863
|
}
|
|
860
864
|
|
|
861
|
-
async
|
|
862
|
-
const
|
|
863
|
-
if (
|
|
864
|
-
|
|
865
|
-
|
|
865
|
+
async getSerializedExecutionPayloadEnvelope(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null> {
|
|
866
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
867
|
+
if (payloadInput?.hasPayloadEnvelope()) {
|
|
868
|
+
const envelope = payloadInput.getPayloadEnvelope();
|
|
869
|
+
const serialized = this.serializedCache.get(envelope);
|
|
870
|
+
if (serialized) {
|
|
871
|
+
return serialized;
|
|
872
|
+
}
|
|
873
|
+
return ssz.gloas.SignedExecutionPayloadEnvelope.serialize(envelope);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
return (
|
|
877
|
+
(await this.db.executionPayloadEnvelope.getBinary(fromHex(blockRootHex))) ??
|
|
878
|
+
(await this.db.executionPayloadEnvelopeArchive.getBinary(blockSlot)) ??
|
|
879
|
+
null
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
async getExecutionPayloadEnvelope(
|
|
884
|
+
blockSlot: Slot,
|
|
885
|
+
blockRootHex: string
|
|
886
|
+
): Promise<gloas.SignedExecutionPayloadEnvelope | null> {
|
|
887
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
888
|
+
if (payloadInput?.hasPayloadEnvelope()) {
|
|
889
|
+
return payloadInput.getPayloadEnvelope();
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
return (
|
|
893
|
+
(await this.db.executionPayloadEnvelope.get(fromHex(blockRootHex))) ??
|
|
894
|
+
(await this.db.executionPayloadEnvelopeArchive.get(blockSlot)) ??
|
|
895
|
+
null
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
async getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecar[]> {
|
|
900
|
+
const fork = this.config.getForkName(blockSlot);
|
|
901
|
+
|
|
902
|
+
if (isForkPostGloas(fork)) {
|
|
903
|
+
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
904
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
905
|
+
if (payloadInput) {
|
|
906
|
+
return payloadInput.getAllColumns();
|
|
907
|
+
}
|
|
908
|
+
} else {
|
|
909
|
+
// Before gloas, columns are tracked in BlockInput
|
|
910
|
+
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
911
|
+
if (blockInput) {
|
|
912
|
+
if (!isBlockInputColumns(blockInput)) {
|
|
913
|
+
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
914
|
+
}
|
|
915
|
+
return blockInput.getAllColumns();
|
|
866
916
|
}
|
|
867
|
-
return blockInput.getAllColumns();
|
|
868
917
|
}
|
|
918
|
+
|
|
869
919
|
const sidecarsUnfinalized = await this.db.dataColumnSidecar.values(fromHex(blockRootHex));
|
|
870
920
|
if (sidecarsUnfinalized.length > 0) {
|
|
871
|
-
return sidecarsUnfinalized
|
|
921
|
+
return sidecarsUnfinalized;
|
|
872
922
|
}
|
|
873
923
|
const sidecarsFinalized = await this.db.dataColumnSidecarArchive.values(blockSlot);
|
|
874
|
-
return sidecarsFinalized
|
|
924
|
+
return sidecarsFinalized;
|
|
875
925
|
}
|
|
876
926
|
|
|
877
927
|
async getSerializedDataColumnSidecars(
|
|
@@ -879,23 +929,45 @@ export class BeaconChain implements IBeaconChain {
|
|
|
879
929
|
blockRootHex: string,
|
|
880
930
|
indices: number[]
|
|
881
931
|
): Promise<(Uint8Array | undefined)[]> {
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
932
|
+
const fork = this.config.getForkName(blockSlot);
|
|
933
|
+
|
|
934
|
+
if (isForkPostGloas(fork)) {
|
|
935
|
+
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
936
|
+
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
937
|
+
if (payloadInput) {
|
|
938
|
+
return indices.map((index) => {
|
|
939
|
+
const sidecar = payloadInput.getColumn(index);
|
|
940
|
+
if (!sidecar) {
|
|
941
|
+
return undefined;
|
|
942
|
+
}
|
|
943
|
+
const serialized = this.serializedCache.get(sidecar);
|
|
944
|
+
if (serialized) {
|
|
945
|
+
return serialized;
|
|
946
|
+
}
|
|
947
|
+
return sszTypesFor(fork as ForkPostGloas).DataColumnSidecar.serialize(sidecar);
|
|
948
|
+
});
|
|
886
949
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
if (serialized) {
|
|
894
|
-
return serialized;
|
|
950
|
+
} else {
|
|
951
|
+
// Before gloas, columns are tracked in BlockInput
|
|
952
|
+
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
953
|
+
if (blockInput) {
|
|
954
|
+
if (!isBlockInputColumns(blockInput)) {
|
|
955
|
+
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
895
956
|
}
|
|
896
|
-
return
|
|
897
|
-
|
|
957
|
+
return indices.map((index) => {
|
|
958
|
+
const sidecar = blockInput.getColumn(index);
|
|
959
|
+
if (!sidecar) {
|
|
960
|
+
return undefined;
|
|
961
|
+
}
|
|
962
|
+
const serialized = this.serializedCache.get(sidecar);
|
|
963
|
+
if (serialized) {
|
|
964
|
+
return serialized;
|
|
965
|
+
}
|
|
966
|
+
return sszTypesFor(blockInput.forkName as ForkPostFulu).DataColumnSidecar.serialize(sidecar);
|
|
967
|
+
});
|
|
968
|
+
}
|
|
898
969
|
}
|
|
970
|
+
|
|
899
971
|
const sidecarsUnfinalized = await this.db.dataColumnSidecar.getManyBinary(fromHex(blockRootHex), indices);
|
|
900
972
|
if (sidecarsUnfinalized.some((sidecar) => sidecar != null)) {
|
|
901
973
|
return sidecarsUnfinalized;
|
|
@@ -952,14 +1024,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
952
1024
|
consensusBlockValue: Wei;
|
|
953
1025
|
shouldOverrideBuilder?: boolean;
|
|
954
1026
|
}> {
|
|
955
|
-
const fork = this.config.getForkName(slot);
|
|
956
1027
|
const state = await this.regen.getBlockSlotState(
|
|
957
1028
|
parentBlock,
|
|
958
1029
|
slot,
|
|
959
1030
|
{dontTransferCache: true},
|
|
960
1031
|
RegenCaller.produceBlock
|
|
961
1032
|
);
|
|
962
|
-
const proposerIndex = state.
|
|
1033
|
+
const proposerIndex = state.getBeaconProposer(slot);
|
|
963
1034
|
const proposerPubKey = this.pubkeyCache.getOrThrow(proposerIndex).toBytes();
|
|
964
1035
|
|
|
965
1036
|
const {body, produceResult, executionPayloadValue, shouldOverrideBuilder} = await produceBlockBody.call(
|
|
@@ -981,7 +1052,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
981
1052
|
// The hashtree root computed here for debug log will get cached and hence won't introduce additional delays
|
|
982
1053
|
const bodyRoot =
|
|
983
1054
|
produceResult.type === BlockType.Full
|
|
984
|
-
?
|
|
1055
|
+
? this.config.getForkTypes(slot).BeaconBlockBody.hashTreeRoot(body)
|
|
985
1056
|
: this.config
|
|
986
1057
|
.getPostBellatrixForkTypes(slot)
|
|
987
1058
|
.BlindedBeaconBlockBody.hashTreeRoot(body as BlindedBeaconBlockBody);
|
|
@@ -999,14 +1070,15 @@ export class BeaconChain implements IBeaconChain {
|
|
|
999
1070
|
body,
|
|
1000
1071
|
} as AssembledBlockType<T>;
|
|
1001
1072
|
|
|
1002
|
-
const {newStateRoot, proposerReward,
|
|
1073
|
+
const {newStateRoot, proposerReward, postBlockState} = computeNewStateRoot(this.metrics, state, block);
|
|
1003
1074
|
block.stateRoot = newStateRoot;
|
|
1004
1075
|
const blockRoot =
|
|
1005
1076
|
produceResult.type === BlockType.Full
|
|
1006
|
-
?
|
|
1077
|
+
? this.config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block)
|
|
1007
1078
|
: this.config.getPostBellatrixForkTypes(slot).BlindedBeaconBlock.hashTreeRoot(block as BlindedBeaconBlock);
|
|
1008
1079
|
const blockRootHex = toRootHex(blockRoot);
|
|
1009
1080
|
|
|
1081
|
+
const fork = this.config.getForkName(slot);
|
|
1010
1082
|
if (isForkPostGloas(fork)) {
|
|
1011
1083
|
// TODO GLOAS: we should retire BlockType post-gloas, may need a new enum for self vs non-self built
|
|
1012
1084
|
if (produceResult.type !== BlockType.Full) {
|
|
@@ -1022,8 +1094,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1022
1094
|
slot,
|
|
1023
1095
|
stateRoot: ZERO_HASH,
|
|
1024
1096
|
};
|
|
1025
|
-
|
|
1026
|
-
|
|
1097
|
+
if (!isStatePostGloas(postBlockState)) {
|
|
1098
|
+
throw Error(`Expected gloas+ post-state for execution payload envelope, got fork=${postBlockState.forkName}`);
|
|
1099
|
+
}
|
|
1100
|
+
const payloadEnvelopeStateRoot = computePayloadEnvelopeStateRoot(this.metrics, postBlockState, envelope);
|
|
1101
|
+
gloasResult.payloadEnvelopeStateRoot = payloadEnvelopeStateRoot;
|
|
1027
1102
|
}
|
|
1028
1103
|
|
|
1029
1104
|
// Track the produced block for consensus broadcast validations, later validation, etc.
|
|
@@ -1143,8 +1218,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1143
1218
|
* persist preState, postState and block for further investigation.
|
|
1144
1219
|
*/
|
|
1145
1220
|
async persistInvalidStateRoot(
|
|
1146
|
-
preState:
|
|
1147
|
-
postState:
|
|
1221
|
+
preState: IBeaconStateView,
|
|
1222
|
+
postState: IBeaconStateView,
|
|
1148
1223
|
block: SignedBeaconBlock
|
|
1149
1224
|
): Promise<void> {
|
|
1150
1225
|
const blockSlot = block.message.slot;
|
|
@@ -1159,13 +1234,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1159
1234
|
`${logStr}_block`
|
|
1160
1235
|
),
|
|
1161
1236
|
this.persistSszObject(
|
|
1162
|
-
`preState_slot_${preState.slot}
|
|
1237
|
+
`preState_slot_${preState.slot}_BeaconState`,
|
|
1163
1238
|
preState.serialize(),
|
|
1164
1239
|
preState.hashTreeRoot(),
|
|
1165
1240
|
`${logStr}_pre_state`
|
|
1166
1241
|
),
|
|
1167
1242
|
this.persistSszObject(
|
|
1168
|
-
`postState_slot_${postState.slot}
|
|
1243
|
+
`postState_slot_${postState.slot}_BeaconState`,
|
|
1169
1244
|
postState.serialize(),
|
|
1170
1245
|
postState.hashTreeRoot(),
|
|
1171
1246
|
`${logStr}_post_state`
|
|
@@ -1185,12 +1260,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1185
1260
|
}
|
|
1186
1261
|
}
|
|
1187
1262
|
|
|
1188
|
-
persistInvalidSszView(view: TreeView<CompositeTypeAny>, suffix?: string): void {
|
|
1189
|
-
if (this.opts.persistInvalidSszObjects) {
|
|
1190
|
-
void this.persistSszObject(view.type.typeName, view.serialize(), view.hashTreeRoot(), suffix);
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
1263
|
/**
|
|
1195
1264
|
* Regenerate state for attestation verification, this does not happen with default chain option of maxSkipSlots = 32 .
|
|
1196
1265
|
* However, need to handle just in case. Lodestar doesn't support multiple regen state requests for attestation verification
|
|
@@ -1208,7 +1277,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1208
1277
|
this.shufflingCache.insertPromise(attEpoch, shufflingDependentRoot);
|
|
1209
1278
|
const blockEpoch = computeEpochAtSlot(attHeadBlock.slot);
|
|
1210
1279
|
|
|
1211
|
-
let state:
|
|
1280
|
+
let state: IBeaconStateView;
|
|
1212
1281
|
if (blockEpoch < attEpoch - 1) {
|
|
1213
1282
|
// thanks to one epoch look ahead, we don't need to dial up to attEpoch
|
|
1214
1283
|
const targetSlot = computeStartSlotAtEpoch(attEpoch - 1);
|
|
@@ -1226,7 +1295,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1226
1295
|
}
|
|
1227
1296
|
// resolve the promise to unblock other calls of the same epoch and dependent root
|
|
1228
1297
|
this.shufflingCache.processState(state);
|
|
1229
|
-
return state.
|
|
1298
|
+
return state.getShufflingAtEpoch(attEpoch);
|
|
1230
1299
|
}
|
|
1231
1300
|
|
|
1232
1301
|
/**
|
|
@@ -1236,7 +1305,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1236
1305
|
*/
|
|
1237
1306
|
private justifiedBalancesGetter(
|
|
1238
1307
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1239
|
-
blockState:
|
|
1308
|
+
blockState: IBeaconStateView
|
|
1240
1309
|
): EffectiveBalanceIncrements {
|
|
1241
1310
|
this.metrics?.balancesCache.requests.inc();
|
|
1242
1311
|
|
|
@@ -1263,7 +1332,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1263
1332
|
});
|
|
1264
1333
|
}
|
|
1265
1334
|
|
|
1266
|
-
return getEffectiveBalanceIncrementsZeroInactive(
|
|
1335
|
+
return state.getEffectiveBalanceIncrementsZeroInactive();
|
|
1267
1336
|
}
|
|
1268
1337
|
|
|
1269
1338
|
/**
|
|
@@ -1275,8 +1344,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1275
1344
|
*/
|
|
1276
1345
|
private closestJustifiedBalancesStateToCheckpoint(
|
|
1277
1346
|
checkpoint: CheckpointWithPayloadStatus,
|
|
1278
|
-
blockState:
|
|
1279
|
-
): {state:
|
|
1347
|
+
blockState: IBeaconStateView
|
|
1348
|
+
): {state: IBeaconStateView; stateId: string; shouldWarn: boolean} {
|
|
1280
1349
|
const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
|
|
1281
1350
|
const state = this.regen.getCheckpointStateSync(checkpointHexPayload);
|
|
1282
1351
|
if (state) {
|
|
@@ -1356,13 +1425,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1356
1425
|
metrics.chain.blacklistedBlocks.set(this.blacklistedBlocks.size);
|
|
1357
1426
|
|
|
1358
1427
|
const headState = this.getHeadState();
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
metrics.pendingDeposits.set(headStateElectra.pendingDeposits.length);
|
|
1364
|
-
metrics.pendingPartialWithdrawals.set(headStateElectra.pendingPartialWithdrawals.length);
|
|
1365
|
-
metrics.pendingConsolidations.set(headStateElectra.pendingConsolidations.length);
|
|
1428
|
+
if (isStatePostElectra(headState)) {
|
|
1429
|
+
metrics.pendingDeposits.set(headState.pendingDepositsCount);
|
|
1430
|
+
metrics.pendingPartialWithdrawals.set(headState.pendingPartialWithdrawalsCount);
|
|
1431
|
+
metrics.pendingConsolidations.set(headState.pendingConsolidationsCount);
|
|
1366
1432
|
}
|
|
1367
1433
|
}
|
|
1368
1434
|
|
|
@@ -1426,7 +1492,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1426
1492
|
this.logger.verbose("Fork choice justified", {epoch: cp.epoch, root: cp.rootHex});
|
|
1427
1493
|
}
|
|
1428
1494
|
|
|
1429
|
-
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state:
|
|
1495
|
+
private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state: IBeaconStateView): void {
|
|
1430
1496
|
// Defer to not block other checkpoint event handlers, which can cause lightclient update delays
|
|
1431
1497
|
callInNextEventLoop(() => {
|
|
1432
1498
|
this.shufflingCache.processState(state);
|
|
@@ -1512,7 +1578,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1512
1578
|
if (stateOrBytes instanceof Uint8Array) {
|
|
1513
1579
|
effectiveBalances = getEffectiveBalancesFromStateBytes(this.config, stateOrBytes, validatorIndices);
|
|
1514
1580
|
} else {
|
|
1515
|
-
effectiveBalances = validatorIndices.map((index) => stateOrBytes.
|
|
1581
|
+
effectiveBalances = validatorIndices.map((index) => stateOrBytes.getValidator(index).effectiveBalance ?? 0);
|
|
1516
1582
|
}
|
|
1517
1583
|
}
|
|
1518
1584
|
|
|
@@ -1562,11 +1628,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1562
1628
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1563
1629
|
}
|
|
1564
1630
|
|
|
1565
|
-
preState = processSlots(
|
|
1631
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1566
1632
|
|
|
1567
1633
|
const proposerRewards = this.regen.getStateSync(toRootHex(block.stateRoot))?.proposerRewards ?? undefined;
|
|
1568
1634
|
|
|
1569
|
-
return computeBlockRewards(
|
|
1635
|
+
return preState.computeBlockRewards(block, proposerRewards);
|
|
1570
1636
|
}
|
|
1571
1637
|
|
|
1572
1638
|
async getAttestationsRewards(
|
|
@@ -1590,7 +1656,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1590
1656
|
throw Error(`State is not in cache for slot ${slot}`);
|
|
1591
1657
|
}
|
|
1592
1658
|
|
|
1593
|
-
const rewards = await computeAttestationsRewards(
|
|
1659
|
+
const rewards = await cachedState.computeAttestationsRewards(validatorIds);
|
|
1594
1660
|
|
|
1595
1661
|
return {rewards, executionOptimistic, finalized};
|
|
1596
1662
|
}
|
|
@@ -1605,8 +1671,11 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1605
1671
|
throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
|
|
1606
1672
|
}
|
|
1607
1673
|
|
|
1608
|
-
preState = processSlots(
|
|
1674
|
+
preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
|
|
1675
|
+
if (!isStatePostAltair(preState)) {
|
|
1676
|
+
throw new Error("Sync committee rewards are not supported before Altair");
|
|
1677
|
+
}
|
|
1609
1678
|
|
|
1610
|
-
return computeSyncCommitteeRewards(
|
|
1679
|
+
return preState.computeSyncCommitteeRewards(block, validatorIds ?? []);
|
|
1611
1680
|
}
|
|
1612
1681
|
}
|
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
|
/**
|