@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/sync/unknownBlock.ts
CHANGED
|
@@ -64,7 +64,7 @@ enum FetchResult {
|
|
|
64
64
|
*
|
|
65
65
|
* - publishBlock
|
|
66
66
|
* - gossipHandlers
|
|
67
|
-
* -
|
|
67
|
+
* - searchUnknownBlock
|
|
68
68
|
* = produceSyncCommitteeContribution
|
|
69
69
|
* = validateGossipFnRetryUnknownRoot
|
|
70
70
|
* * submitPoolAttestationsV2
|
|
@@ -115,7 +115,7 @@ export class BlockInputSync {
|
|
|
115
115
|
this.logger.verbose("BlockInputSync enabled.");
|
|
116
116
|
this.chain.emitter.on(ChainEvent.unknownBlockRoot, this.onUnknownBlockRoot);
|
|
117
117
|
this.chain.emitter.on(ChainEvent.incompleteBlockInput, this.onIncompleteBlockInput);
|
|
118
|
-
this.chain.emitter.on(ChainEvent.
|
|
118
|
+
this.chain.emitter.on(ChainEvent.blockUnknownParent, this.onUnknownParent);
|
|
119
119
|
this.network.events.on(NetworkEvent.peerConnected, this.onPeerConnected);
|
|
120
120
|
this.network.events.on(NetworkEvent.peerDisconnected, this.onPeerDisconnected);
|
|
121
121
|
this.subscribedToNetworkEvents = true;
|
|
@@ -126,7 +126,7 @@ export class BlockInputSync {
|
|
|
126
126
|
this.logger.verbose("BlockInputSync disabled.");
|
|
127
127
|
this.chain.emitter.off(ChainEvent.unknownBlockRoot, this.onUnknownBlockRoot);
|
|
128
128
|
this.chain.emitter.off(ChainEvent.incompleteBlockInput, this.onIncompleteBlockInput);
|
|
129
|
-
this.chain.emitter.off(ChainEvent.
|
|
129
|
+
this.chain.emitter.off(ChainEvent.blockUnknownParent, this.onUnknownParent);
|
|
130
130
|
this.network.events.off(NetworkEvent.peerConnected, this.onPeerConnected);
|
|
131
131
|
this.network.events.off(NetworkEvent.peerDisconnected, this.onPeerDisconnected);
|
|
132
132
|
this.subscribedToNetworkEvents = false;
|
|
@@ -171,7 +171,7 @@ export class BlockInputSync {
|
|
|
171
171
|
/**
|
|
172
172
|
* Process an unknownBlockParent event and register the block in `pendingBlocks` Map.
|
|
173
173
|
*/
|
|
174
|
-
private onUnknownParent = (data: ChainEventData[ChainEvent.
|
|
174
|
+
private onUnknownParent = (data: ChainEventData[ChainEvent.blockUnknownParent]): void => {
|
|
175
175
|
try {
|
|
176
176
|
this.addByRootHex(data.blockInput.parentRootHex, data.peer);
|
|
177
177
|
this.addByBlockInput(data.blockInput, data.peer);
|
|
@@ -481,7 +481,7 @@ export class BlockInputSync {
|
|
|
481
481
|
* From a set of shuffled peers:
|
|
482
482
|
* - fetch the block
|
|
483
483
|
* - from deneb, fetch all missing blobs
|
|
484
|
-
* - from peerDAS, fetch sampled
|
|
484
|
+
* - from peerDAS, fetch sampled columns
|
|
485
485
|
* TODO: this means we only have block root, and nothing else. Consider to reflect this in the function name
|
|
486
486
|
* prefulu, will attempt a max of `MAX_ATTEMPTS_PER_BLOCK` on different peers, postfulu we may attempt more as defined in `getMaxDownloadAttempts()` function
|
|
487
487
|
* Also verifies the received block root + returns the peer that provided the block for future downscoring.
|
|
@@ -489,10 +489,7 @@ export class BlockInputSync {
|
|
|
489
489
|
private async fetchBlockInput(cacheItem: BlockInputSyncCacheItem): Promise<PendingBlockInput> {
|
|
490
490
|
const rootHex = getBlockInputSyncCacheItemRootHex(cacheItem);
|
|
491
491
|
const excludedPeers = new Set<PeerIdStr>();
|
|
492
|
-
const defaultPendingColumns =
|
|
493
|
-
this.config.getForkSeq(this.chain.clock.currentSlot) >= ForkSeq.fulu
|
|
494
|
-
? new Set(this.network.custodyConfig.sampledColumns)
|
|
495
|
-
: null;
|
|
492
|
+
const defaultPendingColumns = new Set(this.network.custodyConfig.sampledColumns);
|
|
496
493
|
|
|
497
494
|
const fetchStartSec = Date.now() / 1000;
|
|
498
495
|
let slot = isPendingBlockInput(cacheItem) ? cacheItem.blockInput.slot : undefined;
|
|
@@ -506,14 +503,10 @@ export class BlockInputSync {
|
|
|
506
503
|
isPendingBlockInput(cacheItem) && isBlockInputColumns(cacheItem.blockInput)
|
|
507
504
|
? new Set(cacheItem.blockInput.getMissingSampledColumnMeta().missing)
|
|
508
505
|
: defaultPendingColumns;
|
|
509
|
-
// pendingDataColumns is null pre-fulu
|
|
510
506
|
const peerMeta = this.peerBalancer.bestPeerForPendingColumns(pendingColumns, excludedPeers);
|
|
511
507
|
if (peerMeta === null) {
|
|
512
508
|
// no more peer with needed columns to try, throw error
|
|
513
|
-
|
|
514
|
-
if (pendingColumns) {
|
|
515
|
-
message += ` with needed columns=${prettyPrintIndices(Array.from(pendingColumns))}`;
|
|
516
|
-
}
|
|
509
|
+
const message = `Error fetching UnknownBlockRoot slot=${slot} root=${rootHex} after ${i}: cannot find peer with needed columns=${prettyPrintIndices(Array.from(pendingColumns))}`;
|
|
517
510
|
this.metrics?.blockInputSync.fetchTimeSec.observe(
|
|
518
511
|
{result: FetchResult.FailureTriedAllPeers},
|
|
519
512
|
Date.now() / 1000 - fetchStartSec
|
|
@@ -650,7 +643,7 @@ export class BlockInputSync {
|
|
|
650
643
|
// TODO(fulu): why is this commented out here?
|
|
651
644
|
//
|
|
652
645
|
// this.knownBadBlocks.add(block.blockRootHex);
|
|
653
|
-
// for (const peerIdStr of block.
|
|
646
|
+
// for (const peerIdStr of block.peerIdStrings) {
|
|
654
647
|
// // TODO: Refactor peerRpcScores to work with peerIdStr only
|
|
655
648
|
// this.network.reportPeer(peerIdStr, PeerAction.LowToleranceError, "BadBlockByRoot");
|
|
656
649
|
// }
|
|
@@ -729,11 +722,11 @@ export class UnknownBlockPeerBalancer {
|
|
|
729
722
|
}
|
|
730
723
|
|
|
731
724
|
/**
|
|
732
|
-
* called from
|
|
725
|
+
* called from fetchBlockInput() where we only have block root and nothing else
|
|
733
726
|
* excludedPeers are the peers that we requested already so we don't want to try again
|
|
734
727
|
* pendingColumns is empty for prefulu, or the 1st time we we download a block by root
|
|
735
728
|
*/
|
|
736
|
-
bestPeerForPendingColumns(pendingColumns: Set<number
|
|
729
|
+
bestPeerForPendingColumns(pendingColumns: Set<number>, excludedPeers: Set<PeerIdStr>): PeerSyncMeta | null {
|
|
737
730
|
const eligiblePeers = this.filterPeers(pendingColumns, excludedPeers);
|
|
738
731
|
if (eligiblePeers.length === 0) {
|
|
739
732
|
return null;
|
|
@@ -750,37 +743,6 @@ export class UnknownBlockPeerBalancer {
|
|
|
750
743
|
return this.peersMeta.get(bestPeerId) ?? null;
|
|
751
744
|
}
|
|
752
745
|
|
|
753
|
-
/**
|
|
754
|
-
* called from fetchUnavailableBlockInput() where we have either BlockInput or NullBlockInput
|
|
755
|
-
* excludedPeers are the peers that we requested already so we don't want to try again
|
|
756
|
-
*/
|
|
757
|
-
bestPeerForBlockInput(blockInput: IBlockInput, excludedPeers: Set<PeerIdStr>): PeerSyncMeta | null {
|
|
758
|
-
const eligiblePeers: PeerIdStr[] = [];
|
|
759
|
-
|
|
760
|
-
if (isBlockInputColumns(blockInput)) {
|
|
761
|
-
const pendingDataColumns: Set<number> = new Set(blockInput.getMissingSampledColumnMeta().missing);
|
|
762
|
-
// there could be no pending column in case when block is still missing
|
|
763
|
-
eligiblePeers.push(...this.filterPeers(pendingDataColumns, excludedPeers));
|
|
764
|
-
} else {
|
|
765
|
-
// prefulu
|
|
766
|
-
eligiblePeers.push(...this.filterPeers(null, excludedPeers));
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
if (eligiblePeers.length === 0) {
|
|
770
|
-
return null;
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
const sortedEligiblePeers = sortBy(
|
|
774
|
-
shuffle(eligiblePeers),
|
|
775
|
-
// prefer peers with least active req
|
|
776
|
-
(peerId) => this.activeRequests.get(peerId) ?? 0
|
|
777
|
-
);
|
|
778
|
-
|
|
779
|
-
const bestPeerId = sortedEligiblePeers[0];
|
|
780
|
-
this.onRequest(bestPeerId);
|
|
781
|
-
return this.peersMeta.get(bestPeerId) ?? null;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
746
|
/**
|
|
785
747
|
* Consumers don't need to call this method directly, it is called internally by bestPeer*() methods
|
|
786
748
|
* make this public for testing
|
|
@@ -804,8 +766,7 @@ export class UnknownBlockPeerBalancer {
|
|
|
804
766
|
return totalActiveRequests;
|
|
805
767
|
}
|
|
806
768
|
|
|
807
|
-
|
|
808
|
-
private filterPeers(pendingDataColumns: Set<number> | null, excludedPeers: Set<PeerIdStr>): PeerIdStr[] {
|
|
769
|
+
private filterPeers(pendingDataColumns: Set<number>, excludedPeers: Set<PeerIdStr>): PeerIdStr[] {
|
|
809
770
|
let maxColumnCount = 0;
|
|
810
771
|
const considerPeers: {peerId: PeerIdStr; columnCount: number}[] = [];
|
|
811
772
|
for (const [peerId, syncMeta] of this.peersMeta.entries()) {
|
|
@@ -820,13 +781,12 @@ export class UnknownBlockPeerBalancer {
|
|
|
820
781
|
continue;
|
|
821
782
|
}
|
|
822
783
|
|
|
823
|
-
if (pendingDataColumns
|
|
824
|
-
// prefulu, no pending columns
|
|
784
|
+
if (pendingDataColumns.size === 0) {
|
|
825
785
|
considerPeers.push({peerId, columnCount: 0});
|
|
826
786
|
continue;
|
|
827
787
|
}
|
|
828
788
|
|
|
829
|
-
//
|
|
789
|
+
// find peers that have custody columns that we need
|
|
830
790
|
const {custodyColumns: peerColumns} = syncMeta;
|
|
831
791
|
// check if the peer has all needed columns
|
|
832
792
|
// get match
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "../../chain/blocks/blockInput/index.js";
|
|
12
12
|
import {SeenBlockInput} from "../../chain/seenCache/seenGossipBlockInput.js";
|
|
13
13
|
import {validateBlockBlobSidecars} from "../../chain/validation/blobSidecar.js";
|
|
14
|
-
import {
|
|
14
|
+
import {validateFuluBlockDataColumnSidecars} from "../../chain/validation/dataColumnSidecar.js";
|
|
15
15
|
import {BeaconMetrics} from "../../metrics/metrics/beacon.js";
|
|
16
16
|
import {INetwork} from "../../network/index.js";
|
|
17
17
|
import {getBlobKzgCommitments} from "../../util/dataColumns.js";
|
|
@@ -27,7 +27,7 @@ export type DownloadByRangeRequests = {
|
|
|
27
27
|
export type DownloadByRangeResponses = {
|
|
28
28
|
blocks?: SignedBeaconBlock[];
|
|
29
29
|
blobSidecars?: deneb.BlobSidecars;
|
|
30
|
-
columnSidecars?: fulu.
|
|
30
|
+
columnSidecars?: fulu.DataColumnSidecar[];
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export type DownloadAndCacheByRangeProps = DownloadByRangeRequests & {
|
|
@@ -58,7 +58,7 @@ export type ValidatedBlobSidecars = {
|
|
|
58
58
|
|
|
59
59
|
export type ValidatedColumnSidecars = {
|
|
60
60
|
blockRoot: Uint8Array;
|
|
61
|
-
columnSidecars: fulu.
|
|
61
|
+
columnSidecars: fulu.DataColumnSidecar[];
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export type ValidatedResponses = {
|
|
@@ -245,7 +245,7 @@ export async function requestByRange({
|
|
|
245
245
|
}): Promise<DownloadByRangeResponses> {
|
|
246
246
|
let blocks: undefined | SignedBeaconBlock[];
|
|
247
247
|
let blobSidecars: undefined | deneb.BlobSidecars;
|
|
248
|
-
let columnSidecars: undefined | fulu.
|
|
248
|
+
let columnSidecars: undefined | fulu.DataColumnSidecar[];
|
|
249
249
|
|
|
250
250
|
const requests: Promise<unknown>[] = [];
|
|
251
251
|
|
|
@@ -268,7 +268,7 @@ export async function requestByRange({
|
|
|
268
268
|
if (columnsRequest) {
|
|
269
269
|
requests.push(
|
|
270
270
|
network.sendDataColumnSidecarsByRange(peerIdStr, columnsRequest).then((columnResponse) => {
|
|
271
|
-
columnSidecars = columnResponse;
|
|
271
|
+
columnSidecars = columnResponse as fulu.DataColumnSidecar[];
|
|
272
272
|
})
|
|
273
273
|
);
|
|
274
274
|
}
|
|
@@ -615,11 +615,13 @@ export async function validateColumnsByRangeResponse(
|
|
|
615
615
|
config: ChainForkConfig,
|
|
616
616
|
request: fulu.DataColumnSidecarsByRangeRequest,
|
|
617
617
|
blocks: ValidatedBlock[],
|
|
618
|
-
columnSidecars: fulu.
|
|
618
|
+
columnSidecars: fulu.DataColumnSidecar[],
|
|
619
619
|
peerDasMetrics?: BeaconMetrics["peerDas"] | null
|
|
620
620
|
): Promise<WarnResult<ValidatedColumnSidecars[], DownloadByRangeError>> {
|
|
621
621
|
const warnings: DownloadByRangeError[] = [];
|
|
622
622
|
|
|
623
|
+
// TODO GLOAS: Extend by range column sync to support gloas.DataColumnSidecar and
|
|
624
|
+
// validate against the block bid commitments instead of the fulu signed header shape
|
|
623
625
|
const seenColumns = new Map<Slot, Map<number, fulu.DataColumnSidecar>>();
|
|
624
626
|
let currentSlot = -1;
|
|
625
627
|
let currentIndex = -1;
|
|
@@ -767,7 +769,7 @@ export async function validateColumnsByRangeResponse(
|
|
|
767
769
|
}
|
|
768
770
|
|
|
769
771
|
validationPromises.push(
|
|
770
|
-
|
|
772
|
+
validateFuluBlockDataColumnSidecars(
|
|
771
773
|
null, // do not pass chain here so we do not validate header signature
|
|
772
774
|
slot,
|
|
773
775
|
blockRoot,
|
|
@@ -8,7 +8,7 @@ import {BlockInputSource, IBlockInput} from "../../chain/blocks/blockInput/types
|
|
|
8
8
|
import {ChainEventEmitter} from "../../chain/emitter.js";
|
|
9
9
|
import {IBeaconChain} from "../../chain/interface.js";
|
|
10
10
|
import {validateBlockBlobSidecars} from "../../chain/validation/blobSidecar.js";
|
|
11
|
-
import {
|
|
11
|
+
import {validateFuluBlockDataColumnSidecars} from "../../chain/validation/dataColumnSidecar.js";
|
|
12
12
|
import {INetwork} from "../../network/interface.js";
|
|
13
13
|
import {PeerSyncMeta} from "../../network/peers/peersData.js";
|
|
14
14
|
import {prettyPrintPeerIdStr} from "../../network/util.js";
|
|
@@ -52,7 +52,7 @@ export type FetchByRootAndValidateColumnsProps = FetchByRootCoreProps & {
|
|
|
52
52
|
export type FetchByRootResponses = {
|
|
53
53
|
block: SignedBeaconBlock;
|
|
54
54
|
blobSidecars?: deneb.BlobSidecars;
|
|
55
|
-
columnSidecars?: fulu.
|
|
55
|
+
columnSidecars?: fulu.DataColumnSidecar[];
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
export type DownloadByRootProps = FetchByRootCoreProps & {
|
|
@@ -213,7 +213,7 @@ export async function fetchByRoot({
|
|
|
213
213
|
}: FetchByRootProps): Promise<WarnResult<FetchByRootResponses, DownloadByRootError>> {
|
|
214
214
|
let block: SignedBeaconBlock;
|
|
215
215
|
let blobSidecars: deneb.BlobSidecars | undefined;
|
|
216
|
-
let columnSidecarResult: WarnResult<fulu.
|
|
216
|
+
let columnSidecarResult: WarnResult<fulu.DataColumnSidecar[], DownloadByRootError> | undefined;
|
|
217
217
|
const {peerId: peerIdStr} = peerMeta;
|
|
218
218
|
|
|
219
219
|
if (isPendingBlockInput(cacheItem)) {
|
|
@@ -376,7 +376,7 @@ export async function fetchAndValidateColumns({
|
|
|
376
376
|
block,
|
|
377
377
|
blockRoot,
|
|
378
378
|
missing,
|
|
379
|
-
}: FetchByRootAndValidateColumnsProps): Promise<WarnResult<fulu.
|
|
379
|
+
}: FetchByRootAndValidateColumnsProps): Promise<WarnResult<fulu.DataColumnSidecar[], DownloadByRootError>> {
|
|
380
380
|
const {peerId: peerIdStr} = peerMeta;
|
|
381
381
|
const slot = block.message.slot;
|
|
382
382
|
const blobCount = getBlobKzgCommitments(forkName, block).length;
|
|
@@ -387,9 +387,11 @@ export async function fetchAndValidateColumns({
|
|
|
387
387
|
const blockRootHex = toRootHex(blockRoot);
|
|
388
388
|
const peerColumns = new Set(peerMeta.custodyColumns ?? []);
|
|
389
389
|
const requestedColumns = missing.filter((c) => peerColumns.has(c));
|
|
390
|
-
|
|
390
|
+
// TODO GLOAS: Extend by root column sync to support gloas.DataColumnSidecar and
|
|
391
|
+
// validate against block bid commitments instead of the fulu signed header shape
|
|
392
|
+
const columnSidecars = (await network.sendDataColumnSidecarsByRoot(peerIdStr, [
|
|
391
393
|
{blockRoot, columns: requestedColumns},
|
|
392
|
-
]);
|
|
394
|
+
])) as fulu.DataColumnSidecar[];
|
|
393
395
|
|
|
394
396
|
const warnings: DownloadByRootError[] = [];
|
|
395
397
|
|
|
@@ -440,7 +442,8 @@ export async function fetchAndValidateColumns({
|
|
|
440
442
|
);
|
|
441
443
|
}
|
|
442
444
|
|
|
443
|
-
|
|
445
|
+
// TODO GLOAS: Swap to fork-aware column validation once post-gloas by-root sync is implemented
|
|
446
|
+
await validateFuluBlockDataColumnSidecars(chain, slot, blockRoot, blobCount, columnSidecars, chain?.metrics?.peerDas);
|
|
444
447
|
|
|
445
448
|
return {result: columnSidecars, warnings: warnings.length > 0 ? warnings : null};
|
|
446
449
|
}
|
|
@@ -451,11 +454,12 @@ export async function fetchColumnsByRoot({
|
|
|
451
454
|
peerMeta,
|
|
452
455
|
blockRoot,
|
|
453
456
|
missing,
|
|
454
|
-
}: Pick<
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
}: Pick<FetchByRootAndValidateColumnsProps, "network" | "peerMeta" | "blockRoot" | "missing">): Promise<
|
|
458
|
+
fulu.DataColumnSidecar[]
|
|
459
|
+
> {
|
|
460
|
+
return (await network.sendDataColumnSidecarsByRoot(peerMeta.peerId, [
|
|
461
|
+
{blockRoot, columns: missing},
|
|
462
|
+
])) as fulu.DataColumnSidecar[];
|
|
459
463
|
}
|
|
460
464
|
|
|
461
465
|
export enum DownloadByRootErrorCode {
|
package/src/util/blobs.ts
CHANGED
|
@@ -13,7 +13,17 @@ import {
|
|
|
13
13
|
VERSIONED_HASH_VERSION_KZG,
|
|
14
14
|
} from "@lodestar/params";
|
|
15
15
|
import {signedBlockToSignedHeader} from "@lodestar/state-transition";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
BeaconBlockBody,
|
|
18
|
+
DataColumnSidecar,
|
|
19
|
+
SSZTypesFor,
|
|
20
|
+
SignedBeaconBlock,
|
|
21
|
+
deneb,
|
|
22
|
+
fulu,
|
|
23
|
+
gloas,
|
|
24
|
+
isGloasDataColumnSidecar,
|
|
25
|
+
ssz,
|
|
26
|
+
} from "@lodestar/types";
|
|
17
27
|
import {kzg} from "./kzg.js";
|
|
18
28
|
|
|
19
29
|
type VersionHash = Uint8Array;
|
|
@@ -71,8 +81,8 @@ export function getBlobSidecars(
|
|
|
71
81
|
* See https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.4/specs/fulu/das-core.md#recover_matrix
|
|
72
82
|
*/
|
|
73
83
|
export async function dataColumnMatrixRecovery(
|
|
74
|
-
partialSidecars: Map<number,
|
|
75
|
-
): Promise<
|
|
84
|
+
partialSidecars: Map<number, DataColumnSidecar>
|
|
85
|
+
): Promise<DataColumnSidecar[] | null> {
|
|
76
86
|
const columnCount = partialSidecars.size;
|
|
77
87
|
if (columnCount < NUMBER_OF_COLUMNS / 2) {
|
|
78
88
|
// We don't have enough columns to recover
|
|
@@ -92,7 +102,7 @@ export async function dataColumnMatrixRecovery(
|
|
|
92
102
|
// should not happen because we check the size of the cache before this
|
|
93
103
|
throw new Error("No data column found in cache to recover from");
|
|
94
104
|
}
|
|
95
|
-
const blobCount = firstDataColumn.
|
|
105
|
+
const blobCount = firstDataColumn.column.length;
|
|
96
106
|
|
|
97
107
|
const fullColumns: Array<Uint8Array[]> = Array.from(
|
|
98
108
|
{length: NUMBER_OF_COLUMNS},
|
|
@@ -121,7 +131,7 @@ export async function dataColumnMatrixRecovery(
|
|
|
121
131
|
}
|
|
122
132
|
}
|
|
123
133
|
|
|
124
|
-
const result:
|
|
134
|
+
const result: DataColumnSidecar[] = new Array(NUMBER_OF_COLUMNS);
|
|
125
135
|
|
|
126
136
|
for (let columnIndex = 0; columnIndex < NUMBER_OF_COLUMNS; columnIndex++) {
|
|
127
137
|
let sidecar = partialSidecars.get(columnIndex);
|
|
@@ -131,14 +141,24 @@ export async function dataColumnMatrixRecovery(
|
|
|
131
141
|
continue;
|
|
132
142
|
}
|
|
133
143
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
if (isGloasDataColumnSidecar(firstDataColumn)) {
|
|
145
|
+
sidecar = {
|
|
146
|
+
index: columnIndex,
|
|
147
|
+
column: fullColumns[columnIndex],
|
|
148
|
+
kzgProofs: Array.from({length: blobCount}, (_, rowIndex) => blobProofs[rowIndex][columnIndex]),
|
|
149
|
+
slot: firstDataColumn.slot,
|
|
150
|
+
beaconBlockRoot: firstDataColumn.beaconBlockRoot,
|
|
151
|
+
} satisfies gloas.DataColumnSidecar;
|
|
152
|
+
} else {
|
|
153
|
+
sidecar = {
|
|
154
|
+
index: columnIndex,
|
|
155
|
+
column: fullColumns[columnIndex],
|
|
156
|
+
kzgCommitments: firstDataColumn.kzgCommitments,
|
|
157
|
+
kzgProofs: Array.from({length: blobCount}, (_, rowIndex) => blobProofs[rowIndex][columnIndex]),
|
|
158
|
+
signedBlockHeader: firstDataColumn.signedBlockHeader,
|
|
159
|
+
kzgCommitmentsInclusionProof: firstDataColumn.kzgCommitmentsInclusionProof,
|
|
160
|
+
} satisfies fulu.DataColumnSidecar;
|
|
161
|
+
}
|
|
142
162
|
result[columnIndex] = sidecar;
|
|
143
163
|
}
|
|
144
164
|
|
|
@@ -149,7 +169,7 @@ export async function dataColumnMatrixRecovery(
|
|
|
149
169
|
* Reconstruct blobs from a set of data columns, at least 50%+ of all the columns
|
|
150
170
|
* must be provided to allow to reconstruct the full data matrix
|
|
151
171
|
*/
|
|
152
|
-
export async function reconstructBlobs(sidecars:
|
|
172
|
+
export async function reconstructBlobs(sidecars: DataColumnSidecar[], indices?: number[]): Promise<deneb.Blobs> {
|
|
153
173
|
if (sidecars.length < NUMBER_OF_COLUMNS / 2) {
|
|
154
174
|
throw Error(
|
|
155
175
|
`Expected at least ${NUMBER_OF_COLUMNS / 2} data columns to reconstruct blobs, received ${sidecars.length}`
|
|
@@ -188,7 +208,7 @@ export async function reconstructBlobs(sidecars: DataColumnSidecars, indices?: n
|
|
|
188
208
|
* Recover cells for specific blob indices from a set of data columns
|
|
189
209
|
*/
|
|
190
210
|
async function recoverBlobCells(
|
|
191
|
-
partialSidecars:
|
|
211
|
+
partialSidecars: DataColumnSidecar[],
|
|
192
212
|
blobIndices: number[]
|
|
193
213
|
): Promise<Map<number, fulu.Cell[]> | null> {
|
|
194
214
|
const columnCount = partialSidecars.length;
|
package/src/util/dataColumns.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
BeaconBlockBody,
|
|
17
17
|
ColumnIndex,
|
|
18
18
|
CustodyIndex,
|
|
19
|
+
DataColumnSidecar,
|
|
19
20
|
Root,
|
|
20
21
|
SSZTypesFor,
|
|
21
22
|
SignedBeaconBlock,
|
|
@@ -24,11 +25,13 @@ import {
|
|
|
24
25
|
deneb,
|
|
25
26
|
fulu,
|
|
26
27
|
gloas,
|
|
28
|
+
isGloasDataColumnSidecar,
|
|
27
29
|
ssz,
|
|
28
30
|
} from "@lodestar/types";
|
|
29
31
|
import {bytesToBigInt} from "@lodestar/utils";
|
|
30
32
|
import {BlockInputColumns} from "../chain/blocks/blockInput/blockInput.js";
|
|
31
33
|
import {BlockInputSource} from "../chain/blocks/blockInput/types.js";
|
|
34
|
+
import {PayloadEnvelopeInput, PayloadEnvelopeInputSource} from "../chain/blocks/payloadEnvelopeInput/index.js";
|
|
32
35
|
import {ChainEvent, ChainEventEmitter} from "../chain/emitter.js";
|
|
33
36
|
import {Metrics} from "../metrics/metrics.js";
|
|
34
37
|
import {NodeId} from "../network/subnets/index.js";
|
|
@@ -287,17 +290,17 @@ export function getBlobKzgCommitments(
|
|
|
287
290
|
* SPEC FUNCTION
|
|
288
291
|
* https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.4/specs/fulu/validator.md#get_data_column_sidecars
|
|
289
292
|
*/
|
|
290
|
-
export function
|
|
293
|
+
export function getFuluDataColumnSidecars(
|
|
291
294
|
signedBlockHeader: SignedBeaconBlockHeader,
|
|
292
295
|
kzgCommitments: deneb.KZGCommitment[],
|
|
293
296
|
kzgCommitmentsInclusionProof: fulu.KzgCommitmentsInclusionProof,
|
|
294
297
|
cellsAndKzgProofs: {cells: Uint8Array[]; proofs: Uint8Array[]}[]
|
|
295
|
-
): fulu.
|
|
298
|
+
): fulu.DataColumnSidecar[] {
|
|
296
299
|
if (cellsAndKzgProofs.length !== kzgCommitments.length) {
|
|
297
300
|
throw Error("Invalid cellsAndKzgProofs length for getDataColumnSidecars");
|
|
298
301
|
}
|
|
299
302
|
|
|
300
|
-
const sidecars: fulu.
|
|
303
|
+
const sidecars: fulu.DataColumnSidecar[] = [];
|
|
301
304
|
for (let columnIndex = 0; columnIndex < NUMBER_OF_COLUMNS; columnIndex++) {
|
|
302
305
|
const columnCells = [];
|
|
303
306
|
const columnProofs = [];
|
|
@@ -322,13 +325,14 @@ export function getDataColumnSidecars(
|
|
|
322
325
|
* block, assemble the sidecars which can be distributed to peers.
|
|
323
326
|
*
|
|
324
327
|
* SPEC FUNCTION
|
|
325
|
-
* https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.4/specs/fulu/validator.md#get_data_column_sidecars_from_block
|
|
328
|
+
* fulu: https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.4/specs/fulu/validator.md#get_data_column_sidecars_from_block
|
|
329
|
+
* gloas: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.3/specs/gloas/builder.md#modified-get_data_column_sidecars_from_block
|
|
326
330
|
*/
|
|
327
331
|
export function getDataColumnSidecarsFromBlock(
|
|
328
332
|
config: ChainForkConfig,
|
|
329
333
|
signedBlock: SignedBeaconBlock<ForkPostFulu>,
|
|
330
334
|
cellsAndKzgProofs: {cells: Uint8Array[]; proofs: Uint8Array[]}[]
|
|
331
|
-
):
|
|
335
|
+
): DataColumnSidecar[] {
|
|
332
336
|
const fork = config.getForkName(signedBlock.message.slot);
|
|
333
337
|
const blobKzgCommitments = getBlobKzgCommitments(fork, signedBlock);
|
|
334
338
|
|
|
@@ -336,11 +340,21 @@ export function getDataColumnSidecarsFromBlock(
|
|
|
336
340
|
if (blobKzgCommitments.length === 0) {
|
|
337
341
|
return [];
|
|
338
342
|
}
|
|
339
|
-
const signedBlockHeader = signedBlockToSignedHeader(config, signedBlock);
|
|
340
343
|
|
|
344
|
+
if (isForkPostGloas(fork)) {
|
|
345
|
+
const beaconBlockRoot = config.getForkTypes(signedBlock.message.slot).BeaconBlock.hashTreeRoot(signedBlock.message);
|
|
346
|
+
return getGloasDataColumnSidecars(signedBlock.message.slot, beaconBlockRoot, cellsAndKzgProofs);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const signedBlockHeader = signedBlockToSignedHeader(config, signedBlock);
|
|
341
350
|
const kzgCommitmentsInclusionProof = computePostFuluKzgCommitmentsInclusionProof(fork, signedBlock.message.body);
|
|
342
351
|
|
|
343
|
-
return
|
|
352
|
+
return getFuluDataColumnSidecars(
|
|
353
|
+
signedBlockHeader,
|
|
354
|
+
blobKzgCommitments,
|
|
355
|
+
kzgCommitmentsInclusionProof,
|
|
356
|
+
cellsAndKzgProofs
|
|
357
|
+
);
|
|
344
358
|
}
|
|
345
359
|
|
|
346
360
|
/**
|
|
@@ -348,13 +362,18 @@ export function getDataColumnSidecarsFromBlock(
|
|
|
348
362
|
* to the commitments it contains, assemble all sidecars for distribution to peers.
|
|
349
363
|
*
|
|
350
364
|
* SPEC FUNCTION
|
|
351
|
-
* https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.4/specs/fulu/validator.md#get_data_column_sidecars_from_column_sidecar
|
|
365
|
+
* fulu: https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.4/specs/fulu/validator.md#get_data_column_sidecars_from_column_sidecar
|
|
366
|
+
* gloas: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.3/specs/gloas/validator.md#modified-get_data_column_sidecars_from_column_sidecar
|
|
352
367
|
*/
|
|
353
368
|
export function getDataColumnSidecarsFromColumnSidecar(
|
|
354
|
-
sidecar:
|
|
369
|
+
sidecar: DataColumnSidecar,
|
|
355
370
|
cellsAndKzgProofs: {cells: Uint8Array[]; proofs: Uint8Array[]}[]
|
|
356
|
-
):
|
|
357
|
-
|
|
371
|
+
): DataColumnSidecar[] {
|
|
372
|
+
if (isGloasDataColumnSidecar(sidecar)) {
|
|
373
|
+
return getGloasDataColumnSidecars(sidecar.slot, sidecar.beaconBlockRoot, cellsAndKzgProofs);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return getFuluDataColumnSidecars(
|
|
358
377
|
sidecar.signedBlockHeader,
|
|
359
378
|
sidecar.kzgCommitments,
|
|
360
379
|
sidecar.kzgCommitmentsInclusionProof,
|
|
@@ -362,21 +381,32 @@ export function getDataColumnSidecarsFromColumnSidecar(
|
|
|
362
381
|
);
|
|
363
382
|
}
|
|
364
383
|
|
|
384
|
+
export function getDataColumnSidecarSlot(sidecar: DataColumnSidecar): Slot {
|
|
385
|
+
if (isGloasDataColumnSidecar(sidecar)) {
|
|
386
|
+
return sidecar.slot;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
return sidecar.signedBlockHeader.message.slot;
|
|
390
|
+
}
|
|
391
|
+
|
|
365
392
|
/**
|
|
366
393
|
* In Gloas, data column sidecars have a simplified structure with `slot` and `beaconBlockRoot`
|
|
367
394
|
* instead of `signedBlockHeader`, `kzgCommitments`, and `kzgCommitmentsInclusionProof`.
|
|
395
|
+
*
|
|
396
|
+
* SPEC FUNCTION
|
|
397
|
+
* https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.3/specs/gloas/builder.md#modified-get_data_column_sidecars
|
|
368
398
|
*/
|
|
369
|
-
export function
|
|
399
|
+
export function getGloasDataColumnSidecars(
|
|
370
400
|
slot: Slot,
|
|
371
401
|
beaconBlockRoot: Root,
|
|
372
402
|
cellsAndKzgProofs: {cells: Uint8Array[]; proofs: Uint8Array[]}[]
|
|
373
|
-
): gloas.
|
|
403
|
+
): gloas.DataColumnSidecar[] {
|
|
374
404
|
// No need to create data column sidecars if there are no blobs
|
|
375
405
|
if (cellsAndKzgProofs.length === 0) {
|
|
376
406
|
return [];
|
|
377
407
|
}
|
|
378
408
|
|
|
379
|
-
const sidecars: gloas.
|
|
409
|
+
const sidecars: gloas.DataColumnSidecar[] = [];
|
|
380
410
|
for (let columnIndex = 0; columnIndex < NUMBER_OF_COLUMNS; columnIndex++) {
|
|
381
411
|
const column: Uint8Array[] = [];
|
|
382
412
|
const kzgProofs: Uint8Array[] = [];
|
|
@@ -399,11 +429,11 @@ export function getDataColumnSidecarsForGloas(
|
|
|
399
429
|
* If we receive more than half of NUMBER_OF_COLUMNS (64) we should recover all remaining columns
|
|
400
430
|
*/
|
|
401
431
|
export async function recoverDataColumnSidecars(
|
|
402
|
-
|
|
432
|
+
input: BlockInputColumns | PayloadEnvelopeInput,
|
|
403
433
|
emitter: ChainEventEmitter,
|
|
404
434
|
metrics: Metrics | null
|
|
405
435
|
): Promise<DataColumnReconstructionCode> {
|
|
406
|
-
const existingColumns =
|
|
436
|
+
const existingColumns = input.getAllColumns();
|
|
407
437
|
const columnCount = existingColumns.length;
|
|
408
438
|
if (columnCount >= NUMBER_OF_COLUMNS) {
|
|
409
439
|
// We have all columns
|
|
@@ -416,7 +446,7 @@ export async function recoverDataColumnSidecars(
|
|
|
416
446
|
}
|
|
417
447
|
|
|
418
448
|
metrics?.recoverDataColumnSidecars.custodyBeforeReconstruction.set(columnCount);
|
|
419
|
-
const partialSidecars = new Map<number,
|
|
449
|
+
const partialSidecars = new Map<number, DataColumnSidecar>();
|
|
420
450
|
for (const columnSidecar of existingColumns) {
|
|
421
451
|
// the more columns we put, the slower the recover
|
|
422
452
|
if (partialSidecars.size >= NUMBER_OF_COLUMNS / 2) {
|
|
@@ -434,7 +464,7 @@ export async function recoverDataColumnSidecars(
|
|
|
434
464
|
return DataColumnReconstructionCode.NullReturned;
|
|
435
465
|
}
|
|
436
466
|
|
|
437
|
-
if (
|
|
467
|
+
if (input.getAllColumns().length === NUMBER_OF_COLUMNS) {
|
|
438
468
|
// either gossip or getBlobsV2 resolved availability while we were recovering
|
|
439
469
|
metrics?.dataColumns.alreadyAdded.inc(fullSidecars.length);
|
|
440
470
|
return DataColumnReconstructionCode.SuccessLate;
|
|
@@ -450,13 +480,27 @@ export async function recoverDataColumnSidecars(
|
|
|
450
480
|
// the node MAY delete the DataColumnSidecar if it is not part of the node's custody requirement.
|
|
451
481
|
const sidecarsToPublish = [];
|
|
452
482
|
for (const columnSidecar of fullSidecars) {
|
|
453
|
-
if (!
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
483
|
+
if (!input.hasColumn(columnSidecar.index)) {
|
|
484
|
+
if (input instanceof PayloadEnvelopeInput) {
|
|
485
|
+
if (!isGloasDataColumnSidecar(columnSidecar)) {
|
|
486
|
+
throw new Error(`Expected gloas DataColumnSidecar for block ${input.blockRootHex}`);
|
|
487
|
+
}
|
|
488
|
+
input.addColumn({
|
|
489
|
+
columnSidecar,
|
|
490
|
+
seenTimestampSec: Date.now() / 1000,
|
|
491
|
+
source: PayloadEnvelopeInputSource.recovery,
|
|
492
|
+
});
|
|
493
|
+
} else {
|
|
494
|
+
if (isGloasDataColumnSidecar(columnSidecar)) {
|
|
495
|
+
throw new Error(`Expected fulu DataColumnSidecar for block ${input.blockRootHex}`);
|
|
496
|
+
}
|
|
497
|
+
input.addColumn({
|
|
498
|
+
blockRootHex: input.blockRootHex,
|
|
499
|
+
columnSidecar,
|
|
500
|
+
seenTimestampSec: Date.now() / 1000,
|
|
501
|
+
source: BlockInputSource.recovery,
|
|
502
|
+
});
|
|
503
|
+
}
|
|
460
504
|
sidecarsToPublish.push(columnSidecar);
|
|
461
505
|
}
|
|
462
506
|
}
|