@lodestar/beacon-node 1.42.0-dev.d73eccfa56 → 1.42.0-dev.e8407e9657
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +25 -13
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +27 -32
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +4 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +27 -27
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -3
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +5 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +34 -22
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -8
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +78 -51
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +3 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.d.ts +21 -15
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +2 -2
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +4 -4
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +5 -5
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +4 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +15 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +102 -59
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +31 -9
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +12 -3
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +4 -4
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +27 -23
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +2 -2
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +15 -14
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +4 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +10 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +3 -3
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +3 -4
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +12 -16
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +13 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +14 -14
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +6 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +6 -6
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +14 -14
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attestation.js +3 -3
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +3 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +185 -6
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +4 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +2 -3
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +1 -2
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +13 -12
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +3 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +9 -7
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/buckets.d.ts +2 -2
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js +4 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +32 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +52 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/interface.d.ts +7 -4
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +22 -11
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +7 -4
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +12 -3
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +7 -2
- package/lib/network/options.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +25 -5
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +265 -80
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +22 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +311 -80
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +9 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +10 -4
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +16 -4
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +1 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +2 -2
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -2
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +10 -43
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +3 -3
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +4 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +3 -3
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +10 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +3 -3
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +21 -10
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/dataColumns.d.ts +18 -11
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +51 -17
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +6 -2
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +49 -25
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +19 -2
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +173 -3
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +33 -16
- package/src/api/impl/beacon/pool/index.ts +1 -1
- package/src/api/impl/beacon/state/index.ts +29 -41
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +4 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +29 -41
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -4
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +5 -4
- package/src/chain/blocks/importBlock.ts +41 -26
- package/src/chain/blocks/importExecutionPayload.ts +89 -63
- package/src/chain/blocks/index.ts +3 -2
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/types.ts +26 -15
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -14
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +138 -91
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/forkChoice/index.ts +33 -42
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +16 -15
- package/src/chain/lightClient/index.ts +9 -22
- package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +6 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +6 -10
- package/src/chain/produceBlock/produceBlockBody.ts +22 -49
- package/src/chain/regen/interface.ts +13 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
- package/src/chain/serializeState.ts +3 -3
- package/src/chain/shufflingCache.ts +5 -7
- package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
- package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
- package/src/chain/stateCache/types.ts +14 -18
- package/src/chain/validation/attestation.ts +3 -3
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +2 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +3 -7
- package/src/chain/validation/executionPayloadEnvelope.ts +2 -8
- package/src/chain/validation/payloadAttestationMessage.ts +2 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +21 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +12 -11
- package/src/db/buckets.ts +2 -2
- package/src/db/repositories/dataColumnSidecar.ts +4 -2
- package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
- package/src/metrics/metrics/lodestar.ts +57 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +18 -4
- package/src/network/libp2p/index.ts +24 -13
- package/src/network/network.ts +39 -8
- package/src/network/options.ts +7 -2
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +329 -94
- package/src/network/processor/index.ts +393 -92
- package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +26 -5
- package/src/node/nodejs.ts +3 -5
- package/src/node/notifier.ts +4 -10
- package/src/sync/backfill/backfill.ts +3 -3
- package/src/sync/unknownBlock.ts +13 -53
- package/src/sync/utils/downloadByRange.ts +9 -7
- package/src/sync/utils/downloadByRoot.ts +16 -12
- package/src/util/blobs.ts +35 -15
- package/src/util/dataColumns.ts +69 -25
- package/src/util/execution.ts +49 -30
- package/src/util/sszBytes.ts +223 -7
- package/src/util/types.ts +6 -0
|
@@ -2,7 +2,7 @@ import {routes} from "@lodestar/api";
|
|
|
2
2
|
import {ForkSeq} from "@lodestar/params";
|
|
3
3
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
4
4
|
import {RootHex, Slot, SlotRootHex} from "@lodestar/types";
|
|
5
|
-
import {Logger, MapDef, mapValues,
|
|
5
|
+
import {Logger, MapDef, mapValues, sleep} from "@lodestar/utils";
|
|
6
6
|
import {BlockInputSource} from "../../chain/blocks/blockInput/types.js";
|
|
7
7
|
import {ChainEvent} from "../../chain/emitter.js";
|
|
8
8
|
import {GossipErrorCode} from "../../chain/errors/gossipValidation.js";
|
|
@@ -12,6 +12,16 @@ import {Metrics} from "../../metrics/metrics.js";
|
|
|
12
12
|
import {ClockEvent} from "../../util/clock.js";
|
|
13
13
|
import {callInNextEventLoop} from "../../util/eventLoop.js";
|
|
14
14
|
import {PeerIdStr} from "../../util/peerId.js";
|
|
15
|
+
import {
|
|
16
|
+
getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized,
|
|
17
|
+
getIndexFromSignedAggregateAndProofSerialized,
|
|
18
|
+
getIndexFromSingleAttestationSerialized,
|
|
19
|
+
getParentBlockHashFromGloasSignedBeaconBlockSerialized,
|
|
20
|
+
getParentBlockHashFromSignedExecutionPayloadBidSerialized,
|
|
21
|
+
getParentBlockRootFromSignedExecutionPayloadBidSerialized,
|
|
22
|
+
getParentRootFromSignedBeaconBlockSerialized,
|
|
23
|
+
getPayloadPresentFromPayloadAttestationMessageSerialized,
|
|
24
|
+
} from "../../util/sszBytes.js";
|
|
15
25
|
import {NetworkEvent, NetworkEventBus} from "../events.js";
|
|
16
26
|
import {
|
|
17
27
|
GossipHandlers,
|
|
@@ -87,27 +97,29 @@ const executeGossipWorkOrder = Object.keys(executeGossipWorkOrderObj) as (keyof
|
|
|
87
97
|
// TODO: Arbitrary constant, check metrics
|
|
88
98
|
const MAX_JOBS_SUBMITTED_PER_TICK = 128;
|
|
89
99
|
|
|
90
|
-
// How many
|
|
100
|
+
// How many gossip messages we keep before new ones get dropped.
|
|
91
101
|
const MAX_QUEUED_UNKNOWN_BLOCK_GOSSIP_OBJECTS = 16_384;
|
|
102
|
+
// TODO gloas: arbitrary constant, check metrics.
|
|
103
|
+
const MAX_QUEUED_UNKNOWN_PAYLOAD_GOSSIP_OBJECTS = 1024;
|
|
92
104
|
|
|
93
|
-
// We don't want to process too many
|
|
94
|
-
// As seen on mainnet,
|
|
105
|
+
// We don't want to process too many gossip messages in a single tick
|
|
106
|
+
// As seen on mainnet, gossip messages concurrency metric ranges from 1000 to 2000
|
|
95
107
|
// so make this constant a little bit conservative
|
|
96
|
-
const
|
|
108
|
+
const MAX_AWAITING_GOSSIP_OBJECTS_PER_TICK = 1024;
|
|
97
109
|
|
|
98
110
|
// Same motivation to JobItemQueue, we don't want to block the event loop
|
|
99
|
-
const
|
|
111
|
+
const AWAITING_GOSSIP_OBJECTS_YIELD_EVERY_MS = 50;
|
|
100
112
|
|
|
101
113
|
/**
|
|
102
114
|
* Reprocess reject reason for metrics
|
|
103
115
|
*/
|
|
104
116
|
export enum ReprocessRejectReason {
|
|
105
117
|
/**
|
|
106
|
-
* There are too many
|
|
118
|
+
* There are too many gossip messages that have unknown block root.
|
|
107
119
|
*/
|
|
108
120
|
reached_limit = "reached_limit",
|
|
109
121
|
/**
|
|
110
|
-
* The awaiting
|
|
122
|
+
* The awaiting gossip message is pruned per clock slot.
|
|
111
123
|
*/
|
|
112
124
|
expired = "expired",
|
|
113
125
|
}
|
|
@@ -126,6 +138,20 @@ export enum CannotAcceptWorkReason {
|
|
|
126
138
|
regen = "regen_busy",
|
|
127
139
|
}
|
|
128
140
|
|
|
141
|
+
/**
|
|
142
|
+
* No metrics needed here; using a number to keep it lightweight
|
|
143
|
+
*/
|
|
144
|
+
enum PreprocessAction {
|
|
145
|
+
AwaitBlock,
|
|
146
|
+
AwaitEnvelope,
|
|
147
|
+
PushToQueue,
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
type PreprocessResult =
|
|
151
|
+
| {action: PreprocessAction.PushToQueue}
|
|
152
|
+
| {action: PreprocessAction.AwaitBlock; root: RootHex}
|
|
153
|
+
| {action: PreprocessAction.AwaitEnvelope; root: RootHex};
|
|
154
|
+
|
|
129
155
|
/**
|
|
130
156
|
* Network processor handles the gossip queues and throtles processing to not overload the main thread
|
|
131
157
|
* - Decides when to process work and what to process
|
|
@@ -137,7 +163,7 @@ export enum CannotAcceptWorkReason {
|
|
|
137
163
|
*
|
|
138
164
|
* ### PendingGossipsubMessage beacon_attestation example
|
|
139
165
|
*
|
|
140
|
-
* For
|
|
166
|
+
* For gossip messages, processing the message includes the steps:
|
|
141
167
|
* 1. Pre shuffling sync validation
|
|
142
168
|
* 2. Retrieve shuffling: async + goes into the regen queue and can be expensive
|
|
143
169
|
* 3. Pre sig validation sync validation
|
|
@@ -156,11 +182,14 @@ export class NetworkProcessor {
|
|
|
156
182
|
private readonly gossipQueues: ReturnType<typeof createGossipQueues>;
|
|
157
183
|
private readonly gossipTopicConcurrency: {[K in GossipType]: number};
|
|
158
184
|
private readonly extractBlockSlotRootFns = createExtractBlockSlotRootFns();
|
|
159
|
-
// we may not receive the block for Attestation and SignedAggregateAndProof messages, in that case PendingGossipsubMessage needs
|
|
185
|
+
// we may not receive the block for messages like Attestation and SignedAggregateAndProof messages, in that case PendingGossipsubMessage needs
|
|
160
186
|
// to be stored in this Map and reprocessed once the block comes
|
|
161
|
-
private readonly
|
|
162
|
-
|
|
163
|
-
|
|
187
|
+
private readonly awaitingMessagesByBlockRoot: MapDef<RootHex, Set<PendingGossipsubMessage>>;
|
|
188
|
+
// we may not receive the payload for messages like payload_attestation_message messages, in that case PendingGossipsubMessage needs
|
|
189
|
+
// to be stored in this Map and reprocessed once the payload comes
|
|
190
|
+
private readonly awaitingMessagesByPayloadBlockRoot: MapDef<RootHex, Set<PendingGossipsubMessage>>;
|
|
191
|
+
private unknownBlocksBySlot = new MapDef<Slot, Set<RootHex>>(() => new Set());
|
|
192
|
+
private unknownEnvelopesBySlot = new MapDef<Slot, Set<RootHex>>(() => new Set());
|
|
164
193
|
|
|
165
194
|
constructor(
|
|
166
195
|
modules: NetworkProcessorModules,
|
|
@@ -180,13 +209,13 @@ export class NetworkProcessor {
|
|
|
180
209
|
modules
|
|
181
210
|
);
|
|
182
211
|
|
|
183
|
-
events.on(NetworkEvent.pendingGossipsubMessage, this.onPendingGossipsubMessage
|
|
184
|
-
this.chain.emitter.on(routes.events.EventType.block, this.onBlockProcessed
|
|
185
|
-
this.chain.
|
|
212
|
+
events.on(NetworkEvent.pendingGossipsubMessage, this.onPendingGossipsubMessage);
|
|
213
|
+
this.chain.emitter.on(routes.events.EventType.block, this.onBlockProcessed);
|
|
214
|
+
this.chain.emitter.on(routes.events.EventType.executionPayload, this.onPayloadEnvelopeProcessed);
|
|
215
|
+
this.chain.clock.on(ClockEvent.slot, this.onClockSlot);
|
|
186
216
|
|
|
187
|
-
this.
|
|
188
|
-
|
|
189
|
-
);
|
|
217
|
+
this.awaitingMessagesByBlockRoot = new MapDef<RootHex, Set<PendingGossipsubMessage>>(() => new Set());
|
|
218
|
+
this.awaitingMessagesByPayloadBlockRoot = new MapDef<RootHex, Set<PendingGossipsubMessage>>(() => new Set());
|
|
190
219
|
|
|
191
220
|
// TODO: Implement queues and priorization for ReqResp incoming requests
|
|
192
221
|
// Listens to NetworkEvent.reqRespIncomingRequest event
|
|
@@ -198,7 +227,8 @@ export class NetworkProcessor {
|
|
|
198
227
|
metrics.gossipValidationQueue.keySize.set({topic}, this.gossipQueues[topic].keySize);
|
|
199
228
|
metrics.gossipValidationQueue.concurrency.set({topic}, this.gossipTopicConcurrency[topic]);
|
|
200
229
|
}
|
|
201
|
-
metrics.
|
|
230
|
+
metrics.awaitingBlockGossipMessages.countPerSlot.set(this.unknownBlockGossipsubMessagesCount);
|
|
231
|
+
metrics.awaitingPayloadGossipMessages.countPerSlot.set(this.unknownPayloadGossipsubMessagesCount);
|
|
202
232
|
// specific metric for beacon_attestation topic
|
|
203
233
|
metrics.gossipValidationQueue.keyAge.reset();
|
|
204
234
|
for (const ageMs of this.gossipQueues.beacon_attestation.getDataAgeMs()) {
|
|
@@ -215,6 +245,7 @@ export class NetworkProcessor {
|
|
|
215
245
|
async stop(): Promise<void> {
|
|
216
246
|
this.events.off(NetworkEvent.pendingGossipsubMessage, this.onPendingGossipsubMessage);
|
|
217
247
|
this.chain.emitter.off(routes.events.EventType.block, this.onBlockProcessed);
|
|
248
|
+
this.chain.emitter.off(routes.events.EventType.executionPayload, this.onPayloadEnvelopeProcessed);
|
|
218
249
|
this.chain.emitter.off(ClockEvent.slot, this.onClockSlot);
|
|
219
250
|
}
|
|
220
251
|
|
|
@@ -233,72 +264,274 @@ export class NetworkProcessor {
|
|
|
233
264
|
return queue.getAll();
|
|
234
265
|
}
|
|
235
266
|
|
|
236
|
-
|
|
237
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Search block via `ChainEvent.unknownBlockRoot` event
|
|
269
|
+
* Slot is the message slot, which is not necessarily the same as the block's slot, but it can be used for a good prune strategy.
|
|
270
|
+
* In the rare case, if 2 messages on 2 slots search for the same root (for example beacon_attestation) we may emit the same root twice but BlockInputSync should handle it well.
|
|
271
|
+
*/
|
|
272
|
+
searchUnknownBlock({slot, root}: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void {
|
|
273
|
+
if (
|
|
274
|
+
this.chain.seenBlock(root) ||
|
|
275
|
+
this.awaitingMessagesByBlockRoot.has(root) ||
|
|
276
|
+
this.unknownBlocksBySlot.getOrDefault(slot).has(root)
|
|
277
|
+
) {
|
|
238
278
|
return;
|
|
239
279
|
}
|
|
240
280
|
// Search for the unknown block
|
|
241
|
-
this.
|
|
281
|
+
this.unknownBlocksBySlot.getOrDefault(slot).add(root);
|
|
242
282
|
this.chain.emitter.emit(ChainEvent.unknownBlockRoot, {rootHex: root, peer, source});
|
|
243
283
|
}
|
|
244
284
|
|
|
245
|
-
|
|
285
|
+
/**
|
|
286
|
+
* Search envelope via `ChainEvent.unknownEnvelopeBlockRoot` event
|
|
287
|
+
* Slot is the message slot, which is not necessarily the same as the envelope's slot, but it can be used for a good prune strategy.
|
|
288
|
+
* In the rare case, if 2 messages on 2 slots search for the same root (for example beacon_attestation) we may emit the same root twice but BlockInputSync should handle it well.
|
|
289
|
+
*/
|
|
290
|
+
searchUnknownEnvelope({slot, root}: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void {
|
|
291
|
+
if (
|
|
292
|
+
this.chain.seenPayloadEnvelope(root) ||
|
|
293
|
+
this.awaitingMessagesByPayloadBlockRoot.has(root) ||
|
|
294
|
+
this.unknownEnvelopesBySlot.getOrDefault(slot).has(root)
|
|
295
|
+
) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
this.unknownEnvelopesBySlot.getOrDefault(slot).add(root);
|
|
299
|
+
this.chain.emitter.emit(ChainEvent.unknownEnvelopeBlockRoot, {rootHex: root, peer, source});
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
private onPendingGossipsubMessage = (message: PendingGossipsubMessage): void => {
|
|
246
303
|
const topicType = message.topic.type;
|
|
247
304
|
const extractBlockSlotRootFn = this.extractBlockSlotRootFns[topicType];
|
|
248
|
-
|
|
249
|
-
if
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
305
|
+
|
|
306
|
+
// 1st extract round: make sure slot is in range and if block root is not available
|
|
307
|
+
// proactively search for it + queue the message
|
|
308
|
+
const slotRoot = extractBlockSlotRootFn
|
|
309
|
+
? extractBlockSlotRootFn(message.msg.data, message.topic.boundary.fork)
|
|
310
|
+
: null;
|
|
311
|
+
if (slotRoot === null) {
|
|
312
|
+
// some messages don't have slot and root
|
|
313
|
+
// if the msg.data is invalid, message will be rejected when deserializing data in later phase (gossipValidatorFn)
|
|
314
|
+
this.pushPendingGossipsubMessageToQueue(message);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// common check for all topics
|
|
319
|
+
// DOS protection: avoid processing messages that are too old
|
|
320
|
+
const {slot, root} = slotRoot;
|
|
321
|
+
const clockSlot = this.chain.clock.currentSlot;
|
|
322
|
+
const {fork} = message.topic.boundary;
|
|
323
|
+
let earliestPermissableSlot = clockSlot - DEFAULT_EARLIEST_PERMISSIBLE_SLOT_DISTANCE;
|
|
324
|
+
if (ForkSeq[fork] >= ForkSeq.deneb && topicType === GossipType.beacon_attestation) {
|
|
325
|
+
// post deneb, the attestations could be in current or previous epoch
|
|
326
|
+
earliestPermissableSlot = computeStartSlotAtEpoch(this.chain.clock.currentEpoch - 1);
|
|
327
|
+
}
|
|
328
|
+
if (slot < earliestPermissableSlot) {
|
|
329
|
+
// No need to report the dropped job to gossip. It will be eventually pruned from the mcache
|
|
330
|
+
this.metrics?.networkProcessor.gossipValidationError.inc({
|
|
331
|
+
topic: topicType,
|
|
332
|
+
error: GossipErrorCode.PAST_SLOT,
|
|
333
|
+
});
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
message.msgSlot = slot;
|
|
338
|
+
|
|
339
|
+
// this determines whether this message needs to wait for a Block or Envelope
|
|
340
|
+
// a message should only wait for what it voted for, hence we don't want to put it on both queues
|
|
341
|
+
let preprocessResult: PreprocessResult = {action: PreprocessAction.PushToQueue};
|
|
342
|
+
// no need to check if root is a descendant of the current finalized block, it will be checked once we validate the message if needed
|
|
343
|
+
if (root && !this.chain.forkChoice.hasBlockHexUnsafe(root)) {
|
|
344
|
+
// starting from GLOAS, unknown root from data_column_sidecar also falls into this case
|
|
345
|
+
this.searchUnknownBlock({slot, root}, BlockInputSource.network_processor, message.propagationSource.toString());
|
|
346
|
+
// for beacon_attestation and beacon_aggregate_and_proof messages, this is only temporary.
|
|
347
|
+
// if "index = 1" we need to await for the Envelope instead
|
|
348
|
+
preprocessResult = {action: PreprocessAction.AwaitBlock, root};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// 2nd extract round for some specific topics
|
|
352
|
+
// we separate the search action from the await action
|
|
353
|
+
|
|
354
|
+
// beacon_block: proactively search for parent block/envelope across all forks, but never queue.
|
|
355
|
+
// BlockInputSync handles cascading recovery if the gossip handler throws.
|
|
356
|
+
if (topicType === GossipType.beacon_block) {
|
|
357
|
+
const parentRoot = getParentRootFromSignedBeaconBlockSerialized(message.msg.data);
|
|
358
|
+
if (parentRoot) {
|
|
359
|
+
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
360
|
+
// GLOAS: also check parent envelope, same logic as execution_payload_bid
|
|
361
|
+
const parentBlockHash = getParentBlockHashFromGloasSignedBeaconBlockSerialized(message.msg.data);
|
|
362
|
+
if (parentBlockHash && !this.chain.forkChoice.getBlockHexAndBlockHash(parentRoot, parentBlockHash)) {
|
|
363
|
+
const protoBlock = this.chain.forkChoice.getBlockHexDefaultStatus(parentRoot);
|
|
364
|
+
if (protoBlock === null) {
|
|
365
|
+
this.searchUnknownBlock(
|
|
366
|
+
{slot, root: parentRoot},
|
|
367
|
+
BlockInputSource.network_processor,
|
|
368
|
+
message.propagationSource.toString()
|
|
369
|
+
);
|
|
370
|
+
} else if (
|
|
371
|
+
protoBlock.executionPayloadBlockHash &&
|
|
372
|
+
protoBlock.executionPayloadBlockHash !== parentBlockHash
|
|
373
|
+
) {
|
|
374
|
+
// only search for the envelope by block root if we're sure there is one. Otherwise UnknownBlockSync will penalize the peer.
|
|
375
|
+
this.searchUnknownEnvelope(
|
|
376
|
+
{slot, root: parentRoot},
|
|
377
|
+
BlockInputSource.network_processor,
|
|
378
|
+
message.propagationSource.toString()
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
} else if (!this.chain.forkChoice.hasBlockHexUnsafe(parentRoot)) {
|
|
383
|
+
this.searchUnknownBlock(
|
|
384
|
+
{slot, root: parentRoot},
|
|
385
|
+
BlockInputSource.network_processor,
|
|
386
|
+
message.propagationSource.toString()
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
preprocessResult = {action: PreprocessAction.PushToQueue};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
394
|
+
// specific check for each topic
|
|
395
|
+
// note that it's supposed to NOT queue beacon_block (handled above) and execution_payload because it's not a one-off;
|
|
396
|
+
// for those topics, gossip handlers will throw and BlockInputSync will handle a tree of them instead
|
|
397
|
+
switch (topicType) {
|
|
398
|
+
case GossipType.beacon_attestation:
|
|
399
|
+
case GossipType.beacon_aggregate_and_proof: {
|
|
400
|
+
if (root == null) break;
|
|
401
|
+
const attIndex =
|
|
402
|
+
topicType === GossipType.beacon_attestation
|
|
403
|
+
? getIndexFromSingleAttestationSerialized(fork, message.msg.data)
|
|
404
|
+
: getIndexFromSignedAggregateAndProofSerialized(message.msg.data);
|
|
405
|
+
if (attIndex === 1 && !this.chain.forkChoice.hasPayloadHexUnsafe(root)) {
|
|
406
|
+
// ptc attestation votes for the payload but the envelope is not yet known
|
|
407
|
+
this.searchUnknownEnvelope(
|
|
408
|
+
{slot, root},
|
|
409
|
+
BlockInputSource.network_processor,
|
|
410
|
+
message.propagationSource.toString()
|
|
411
|
+
);
|
|
412
|
+
preprocessResult = {action: PreprocessAction.AwaitEnvelope, root};
|
|
413
|
+
}
|
|
414
|
+
break;
|
|
262
415
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
416
|
+
case GossipType.payload_attestation_message: {
|
|
417
|
+
if (root == null) break;
|
|
418
|
+
const payloadPresent = getPayloadPresentFromPayloadAttestationMessageSerialized(message.msg.data);
|
|
419
|
+
if (payloadPresent && !this.chain.forkChoice.hasPayloadHexUnsafe(root)) {
|
|
420
|
+
this.searchUnknownEnvelope(
|
|
421
|
+
{slot, root},
|
|
422
|
+
BlockInputSource.network_processor,
|
|
423
|
+
message.propagationSource.toString()
|
|
424
|
+
);
|
|
425
|
+
preprocessResult = {action: PreprocessAction.AwaitEnvelope, root};
|
|
426
|
+
}
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
case GossipType.data_column_sidecar: {
|
|
430
|
+
if (root == null) break;
|
|
431
|
+
if (!this.chain.forkChoice.hasPayloadHexUnsafe(root)) {
|
|
432
|
+
this.searchUnknownEnvelope(
|
|
433
|
+
{slot, root},
|
|
434
|
+
BlockInputSource.network_processor,
|
|
435
|
+
message.propagationSource.toString()
|
|
436
|
+
);
|
|
437
|
+
// do not await the envelope, we can do gossip validation
|
|
438
|
+
// also do not reset preprocessResult, we may already await for the block
|
|
439
|
+
}
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
case GossipType.execution_payload: {
|
|
443
|
+
// extractBlockSlotRootFn does not return a root for this topic.
|
|
444
|
+
// Extract beacon_block_root directly and proactively trigger block sync if missing.
|
|
445
|
+
// Do NOT await the block — the handler runs immediately; BlockInputSync handles recovery.
|
|
446
|
+
const blockRoot = getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized(message.msg.data);
|
|
447
|
+
if (blockRoot && !this.chain.forkChoice.hasBlockHexUnsafe(blockRoot)) {
|
|
448
|
+
this.searchUnknownBlock(
|
|
449
|
+
{slot, root: blockRoot},
|
|
450
|
+
BlockInputSource.network_processor,
|
|
451
|
+
message.propagationSource.toString()
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
// do not await the block, we want UnknownBlockSync to handle it.
|
|
455
|
+
preprocessResult = {action: PreprocessAction.PushToQueue};
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
case GossipType.execution_payload_bid: {
|
|
459
|
+
// instead of searching for the message root, this searches for the parent root
|
|
460
|
+
const parentBlockRoot = getParentBlockRootFromSignedExecutionPayloadBidSerialized(message.msg.data);
|
|
461
|
+
const parentBlockHash = getParentBlockHashFromSignedExecutionPayloadBidSerialized(message.msg.data);
|
|
462
|
+
if (
|
|
463
|
+
parentBlockRoot &&
|
|
464
|
+
parentBlockHash &&
|
|
465
|
+
!this.chain.forkChoice.getBlockHexAndBlockHash(parentBlockRoot, parentBlockHash)
|
|
466
|
+
) {
|
|
467
|
+
const protoBlock = this.chain.forkChoice.getBlockHexDefaultStatus(parentBlockRoot);
|
|
468
|
+
if (protoBlock === null) {
|
|
469
|
+
this.searchUnknownBlock(
|
|
470
|
+
{slot, root: parentBlockRoot},
|
|
471
|
+
BlockInputSource.network_processor,
|
|
472
|
+
message.propagationSource.toString()
|
|
473
|
+
);
|
|
474
|
+
preprocessResult = {action: PreprocessAction.AwaitBlock, root: parentBlockRoot};
|
|
475
|
+
} else if (
|
|
476
|
+
protoBlock.executionPayloadBlockHash &&
|
|
477
|
+
protoBlock.executionPayloadBlockHash !== parentBlockHash
|
|
478
|
+
) {
|
|
479
|
+
this.searchUnknownEnvelope(
|
|
480
|
+
{slot, root: parentBlockRoot},
|
|
481
|
+
BlockInputSource.network_processor,
|
|
482
|
+
message.propagationSource.toString()
|
|
483
|
+
);
|
|
484
|
+
preprocessResult = {action: PreprocessAction.AwaitEnvelope, root: parentBlockRoot};
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
switch (preprocessResult.action) {
|
|
493
|
+
case PreprocessAction.PushToQueue:
|
|
494
|
+
this.pushPendingGossipsubMessageToQueue(message);
|
|
495
|
+
break;
|
|
496
|
+
case PreprocessAction.AwaitBlock: {
|
|
497
|
+
if (this.unknownBlockGossipsubMessagesCount > MAX_QUEUED_UNKNOWN_BLOCK_GOSSIP_OBJECTS) {
|
|
498
|
+
// No need to report the dropped job to gossip. It will be eventually pruned from the mcache
|
|
499
|
+
this.metrics?.awaitingBlockGossipMessages.reject.inc({
|
|
500
|
+
reason: ReprocessRejectReason.reached_limit,
|
|
266
501
|
topic: topicType,
|
|
267
|
-
error: GossipErrorCode.PAST_SLOT,
|
|
268
502
|
});
|
|
269
503
|
return;
|
|
270
504
|
}
|
|
271
|
-
message.msgSlot = slot;
|
|
272
|
-
// check if we processed a block with this root
|
|
273
|
-
// no need to check if root is a descendant of the current finalized block, it will be checked once we validate the message if needed
|
|
274
|
-
if (root && !this.chain.forkChoice.hasBlockHexUnsafe(root)) {
|
|
275
|
-
this.searchUnknownSlotRoot({slot, root}, BlockInputSource.gossip, message.propagationSource.toString());
|
|
276
|
-
|
|
277
|
-
if (this.unknownBlockGossipsubMessagesCount > MAX_QUEUED_UNKNOWN_BLOCK_GOSSIP_OBJECTS) {
|
|
278
|
-
// TODO: Should report the dropped job to gossip? It will be eventually pruned from the mcache
|
|
279
|
-
this.metrics?.reprocessGossipAttestations.reject.inc({reason: ReprocessRejectReason.reached_limit});
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
505
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
506
|
+
this.metrics?.awaitingBlockGossipMessages.queue.inc({topic: topicType});
|
|
507
|
+
const awaitingGossipsubMessages = this.awaitingMessagesByBlockRoot.getOrDefault(preprocessResult.root);
|
|
508
|
+
awaitingGossipsubMessages.add(message);
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
case PreprocessAction.AwaitEnvelope: {
|
|
512
|
+
if (this.unknownPayloadGossipsubMessagesCount > MAX_QUEUED_UNKNOWN_PAYLOAD_GOSSIP_OBJECTS) {
|
|
513
|
+
this.metrics?.awaitingPayloadGossipMessages.reject.inc({
|
|
514
|
+
reason: ReprocessRejectReason.reached_limit,
|
|
515
|
+
topic: topicType,
|
|
516
|
+
});
|
|
288
517
|
return;
|
|
289
518
|
}
|
|
519
|
+
|
|
520
|
+
this.metrics?.awaitingPayloadGossipMessages.queue.inc({topic: topicType});
|
|
521
|
+
const awaitingPayloadGossipsubMessages = this.awaitingMessagesByPayloadBlockRoot.getOrDefault(
|
|
522
|
+
preprocessResult.root
|
|
523
|
+
);
|
|
524
|
+
awaitingPayloadGossipsubMessages.add(message);
|
|
525
|
+
break;
|
|
290
526
|
}
|
|
291
527
|
}
|
|
292
|
-
|
|
293
|
-
// bypass the check for other messages
|
|
294
|
-
this.pushPendingGossipsubMessageToQueue(message);
|
|
295
|
-
}
|
|
528
|
+
};
|
|
296
529
|
|
|
297
530
|
private pushPendingGossipsubMessageToQueue(message: PendingGossipsubMessage): void {
|
|
298
531
|
const topicType = message.topic.type;
|
|
299
532
|
const droppedCount = this.gossipQueues[topicType].add(message);
|
|
300
533
|
if (droppedCount) {
|
|
301
|
-
//
|
|
534
|
+
// No need to report the dropped job to gossip. It will be eventually pruned from the mcache
|
|
302
535
|
this.metrics?.gossipValidationQueue.droppedJobs.inc({topic: message.topic.type}, droppedCount);
|
|
303
536
|
}
|
|
304
537
|
|
|
@@ -306,59 +539,111 @@ export class NetworkProcessor {
|
|
|
306
539
|
this.executeWork();
|
|
307
540
|
}
|
|
308
541
|
|
|
309
|
-
private async
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}: {
|
|
313
|
-
slot: Slot;
|
|
314
|
-
block: string;
|
|
315
|
-
executionOptimistic: boolean;
|
|
316
|
-
}): Promise<void> {
|
|
317
|
-
const byRootGossipsubMessages = this.awaitingGossipsubMessagesByRootBySlot.getOrDefault(slot);
|
|
318
|
-
const waitingGossipsubMessages = byRootGossipsubMessages.getOrDefault(rootHex);
|
|
319
|
-
if (waitingGossipsubMessages.size === 0) {
|
|
542
|
+
private onBlockProcessed = async ({block: rootHex}: {block: string; executionOptimistic: boolean}): Promise<void> => {
|
|
543
|
+
const waitingGossipsubMessages = this.awaitingMessagesByBlockRoot.get(rootHex);
|
|
544
|
+
if (!waitingGossipsubMessages || waitingGossipsubMessages.size === 0) {
|
|
320
545
|
return;
|
|
321
546
|
}
|
|
322
547
|
|
|
323
|
-
this.metrics?.reprocessGossipAttestations.resolve.inc(waitingGossipsubMessages.size);
|
|
324
548
|
const nowSec = Date.now() / 1000;
|
|
325
549
|
let count = 0;
|
|
326
550
|
// TODO: we can group attestations to process in batches but since we have the SeenAttestationDatas
|
|
327
551
|
// cache, it may not be necessary at this time
|
|
328
552
|
for (const message of waitingGossipsubMessages) {
|
|
329
|
-
|
|
553
|
+
const topicType = message.topic.type;
|
|
554
|
+
this.metrics?.awaitingBlockGossipMessages.waitSecBeforeResolve.set(
|
|
555
|
+
{topic: topicType},
|
|
556
|
+
nowSec - message.seenTimestampSec
|
|
557
|
+
);
|
|
558
|
+
this.metrics?.awaitingBlockGossipMessages.resolve.inc({topic: topicType});
|
|
330
559
|
this.pushPendingGossipsubMessageToQueue(message);
|
|
331
560
|
count++;
|
|
332
561
|
// don't want to block the event loop, worse case it'd wait for 16_084 / 1024 * 50ms = 800ms which is not a big deal
|
|
333
|
-
if (count ===
|
|
562
|
+
if (count === MAX_AWAITING_GOSSIP_OBJECTS_PER_TICK) {
|
|
334
563
|
count = 0;
|
|
335
|
-
await sleep(
|
|
564
|
+
await sleep(AWAITING_GOSSIP_OBJECTS_YIELD_EVERY_MS);
|
|
336
565
|
}
|
|
337
566
|
}
|
|
338
567
|
|
|
339
|
-
|
|
340
|
-
}
|
|
568
|
+
this.awaitingMessagesByBlockRoot.delete(rootHex);
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
private onPayloadEnvelopeProcessed = async ({blockRoot: rootHex}: {blockRoot: RootHex}): Promise<void> => {
|
|
572
|
+
const waitingGossipsubMessages = this.awaitingMessagesByPayloadBlockRoot.get(rootHex);
|
|
573
|
+
if (!waitingGossipsubMessages || waitingGossipsubMessages.size === 0) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
const nowSec = Date.now() / 1000;
|
|
578
|
+
let count = 0;
|
|
579
|
+
for (const message of waitingGossipsubMessages) {
|
|
580
|
+
const topicType = message.topic.type;
|
|
581
|
+
this.metrics?.awaitingPayloadGossipMessages.waitSecBeforeResolve.set(
|
|
582
|
+
{topic: topicType},
|
|
583
|
+
nowSec - message.seenTimestampSec
|
|
584
|
+
);
|
|
585
|
+
this.metrics?.awaitingPayloadGossipMessages.resolve.inc({topic: topicType});
|
|
586
|
+
this.pushPendingGossipsubMessageToQueue(message);
|
|
587
|
+
count++;
|
|
588
|
+
if (count === MAX_AWAITING_GOSSIP_OBJECTS_PER_TICK) {
|
|
589
|
+
count = 0;
|
|
590
|
+
await sleep(AWAITING_GOSSIP_OBJECTS_YIELD_EVERY_MS);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
this.awaitingMessagesByPayloadBlockRoot.delete(rootHex);
|
|
595
|
+
};
|
|
341
596
|
|
|
342
|
-
private onClockSlot(clockSlot: Slot): void {
|
|
597
|
+
private onClockSlot = (clockSlot: Slot): void => {
|
|
343
598
|
const nowSec = Date.now() / 1000;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
599
|
+
const minSlot = clockSlot - MAX_UNKNOWN_ROOTS_SLOT_CACHE_SIZE;
|
|
600
|
+
|
|
601
|
+
for (const [slot, roots] of this.unknownBlocksBySlot) {
|
|
602
|
+
if (slot > minSlot) continue;
|
|
603
|
+
for (const rootHex of roots) {
|
|
604
|
+
const gossipMessages = this.awaitingMessagesByBlockRoot.get(rootHex);
|
|
605
|
+
if (gossipMessages !== undefined) {
|
|
347
606
|
for (const message of gossipMessages) {
|
|
348
|
-
|
|
349
|
-
this.metrics?.
|
|
350
|
-
|
|
607
|
+
const topicType = message.topic.type;
|
|
608
|
+
this.metrics?.awaitingBlockGossipMessages.reject.inc({
|
|
609
|
+
topic: topicType,
|
|
610
|
+
reason: ReprocessRejectReason.expired,
|
|
611
|
+
});
|
|
612
|
+
this.metrics?.awaitingBlockGossipMessages.waitSecBeforeReject.set(
|
|
613
|
+
{topic: topicType, reason: ReprocessRejectReason.expired},
|
|
351
614
|
nowSec - message.seenTimestampSec
|
|
352
615
|
);
|
|
353
|
-
//
|
|
616
|
+
// No need to report the dropped job to gossip. It will be eventually pruned from the mcache
|
|
354
617
|
}
|
|
618
|
+
this.awaitingMessagesByBlockRoot.delete(rootHex);
|
|
355
619
|
}
|
|
356
|
-
this.awaitingGossipsubMessagesByRootBySlot.delete(slot);
|
|
357
620
|
}
|
|
621
|
+
this.unknownBlocksBySlot.delete(slot);
|
|
358
622
|
}
|
|
359
|
-
|
|
360
|
-
this.
|
|
361
|
-
|
|
623
|
+
|
|
624
|
+
for (const [slot, roots] of this.unknownEnvelopesBySlot) {
|
|
625
|
+
if (slot > minSlot) continue;
|
|
626
|
+
for (const rootHex of roots) {
|
|
627
|
+
const gossipMessages = this.awaitingMessagesByPayloadBlockRoot.get(rootHex);
|
|
628
|
+
if (gossipMessages !== undefined) {
|
|
629
|
+
for (const message of gossipMessages) {
|
|
630
|
+
const topicType = message.topic.type;
|
|
631
|
+
this.metrics?.awaitingPayloadGossipMessages.reject.inc({
|
|
632
|
+
topic: topicType,
|
|
633
|
+
reason: ReprocessRejectReason.expired,
|
|
634
|
+
});
|
|
635
|
+
this.metrics?.awaitingPayloadGossipMessages.waitSecBeforeReject.set(
|
|
636
|
+
{topic: topicType, reason: ReprocessRejectReason.expired},
|
|
637
|
+
nowSec - message.seenTimestampSec
|
|
638
|
+
);
|
|
639
|
+
// No need to report the dropped job to gossip. It will be eventually pruned from the mcache
|
|
640
|
+
}
|
|
641
|
+
this.awaitingMessagesByPayloadBlockRoot.delete(rootHex);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
this.unknownEnvelopesBySlot.delete(slot);
|
|
645
|
+
}
|
|
646
|
+
};
|
|
362
647
|
|
|
363
648
|
private executeWork(): void {
|
|
364
649
|
// TODO: Maybe de-bounce by timing the last time executeWork was run
|
|
@@ -496,4 +781,20 @@ export class NetworkProcessor {
|
|
|
496
781
|
|
|
497
782
|
return null;
|
|
498
783
|
}
|
|
784
|
+
|
|
785
|
+
private get unknownBlockGossipsubMessagesCount(): number {
|
|
786
|
+
let count = 0;
|
|
787
|
+
for (const messages of this.awaitingMessagesByBlockRoot.values()) {
|
|
788
|
+
count += messages.size;
|
|
789
|
+
}
|
|
790
|
+
return count;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
private get unknownPayloadGossipsubMessagesCount(): number {
|
|
794
|
+
let count = 0;
|
|
795
|
+
for (const messages of this.awaitingMessagesByPayloadBlockRoot.values()) {
|
|
796
|
+
count += messages.size;
|
|
797
|
+
}
|
|
798
|
+
return count;
|
|
799
|
+
}
|
|
499
800
|
}
|
|
@@ -297,6 +297,19 @@ export class ReqRespBeaconNode extends ReqResp {
|
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
301
|
+
protocolsAtFork.push(
|
|
302
|
+
[
|
|
303
|
+
protocols.ExecutionPayloadEnvelopesByRoot(fork, this.config),
|
|
304
|
+
this.getHandler(ReqRespMethod.ExecutionPayloadEnvelopesByRoot),
|
|
305
|
+
],
|
|
306
|
+
[
|
|
307
|
+
protocols.ExecutionPayloadEnvelopesByRange(fork, this.config),
|
|
308
|
+
this.getHandler(ReqRespMethod.ExecutionPayloadEnvelopesByRange),
|
|
309
|
+
]
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
300
313
|
return protocolsAtFork;
|
|
301
314
|
}
|
|
302
315
|
|