@lodestar/beacon-node 1.42.0-dev.d73eccfa56 → 1.42.0-dev.efc1ab8e31
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 +14 -2
- 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/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/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/types.d.ts +1 -0
- 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 +21 -21
- 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/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 +12 -12
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +47 -39
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +2 -2
- package/lib/chain/emitter.d.ts.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/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 +11 -12
- 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/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +14 -14
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +3 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +1 -1
- 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/metrics/metrics/lodestar.d.ts +12 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +19 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +2 -729
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/interface.d.ts +4 -2
- 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 +5 -0
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +4 -2
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +9 -3
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.js +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +24 -15
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +12 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +99 -78
- 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 +8 -2
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +7 -1
- 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 +8 -41
- package/lib/sync/unknownBlock.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 +16 -2
- 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/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/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/types.ts +1 -0
- package/src/chain/blocks/importBlock.ts +23 -25
- package/src/chain/blocks/importExecutionPayload.ts +89 -63
- package/src/chain/blocks/index.ts +3 -2
- 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 +75 -67
- package/src/chain/emitter.ts +2 -2
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/forkChoice/index.ts +33 -42
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +12 -13
- 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/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 +2 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +1 -1
- 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/metrics/metrics/lodestar.ts +23 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +15 -2
- package/src/network/libp2p/index.ts +5 -0
- package/src/network/network.ts +32 -4
- package/src/network/processor/extractSlotRootFns.ts +1 -1
- package/src/network/processor/gossipHandlers.ts +25 -16
- package/src/network/processor/index.ts +110 -89
- 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 +13 -0
- 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 +10 -50
- package/src/util/types.ts +6 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, isSyncCommitteeAggregator} from "@lodestar/state-transition";
|
|
3
3
|
import {ValidatorIndex, altair} from "@lodestar/types";
|
|
4
4
|
import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js";
|
|
5
5
|
import {IBeaconChain} from "../interface.js";
|
|
@@ -53,7 +53,7 @@ export async function validateSyncCommitteeGossipContributionAndProof(
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// [REJECT] The contribution has participants -- that is, any(contribution.aggregation_bits)
|
|
56
|
-
const syncCommitteeParticipantIndices = getContributionIndices(headState
|
|
56
|
+
const syncCommitteeParticipantIndices = getContributionIndices(headState, contribution);
|
|
57
57
|
if (syncCommitteeParticipantIndices.length === 0) {
|
|
58
58
|
throw new SyncCommitteeError(GossipAction.REJECT, {
|
|
59
59
|
code: SyncCommitteeErrorCode.NO_PARTICIPANT,
|
|
@@ -83,12 +83,7 @@ export async function validateSyncCommitteeGossipContributionAndProof(
|
|
|
83
83
|
|
|
84
84
|
// [REJECT] The aggregate signature is valid for the message beacon_block_root and aggregate pubkey derived from
|
|
85
85
|
// the participation info in aggregation_bits for the subcommittee specified by the contribution.subcommittee_index.
|
|
86
|
-
getSyncCommitteeContributionSignatureSet(
|
|
87
|
-
chain.config,
|
|
88
|
-
headState as CachedBeaconStateAltair,
|
|
89
|
-
contribution,
|
|
90
|
-
syncCommitteeParticipantIndices
|
|
91
|
-
),
|
|
86
|
+
getSyncCommitteeContributionSignatureSet(chain.config, headState, contribution, syncCommitteeParticipantIndices),
|
|
92
87
|
];
|
|
93
88
|
|
|
94
89
|
if (!(await chain.bls.verifySignatureSets(signatureSets, {batchable: true}))) {
|
|
@@ -109,12 +104,12 @@ export async function validateSyncCommitteeGossipContributionAndProof(
|
|
|
109
104
|
* - pubkeyCache
|
|
110
105
|
*/
|
|
111
106
|
function getContributionIndices(
|
|
112
|
-
state:
|
|
107
|
+
state: IBeaconStateView,
|
|
113
108
|
contribution: altair.SyncCommitteeContribution
|
|
114
109
|
): ValidatorIndex[] {
|
|
115
110
|
const startIndex = contribution.subcommitteeIndex * SYNC_COMMITTEE_SUBNET_SIZE;
|
|
116
111
|
|
|
117
|
-
const syncCommittee = state.
|
|
112
|
+
const syncCommittee = state.getIndexedSyncCommittee(contribution.slot);
|
|
118
113
|
// The bits in contribution.aggregationBits select validatorIndexes in the subcommittee starting at startIndex
|
|
119
114
|
const subcommitteeValidatorIndices = syncCommittee.validatorIndices.slice(
|
|
120
115
|
startIndex,
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BeaconStateView,
|
|
3
|
-
VoluntaryExitValidity,
|
|
4
|
-
getVoluntaryExitSignatureSet,
|
|
5
|
-
getVoluntaryExitValidity,
|
|
6
|
-
} from "@lodestar/state-transition";
|
|
1
|
+
import {VoluntaryExitValidity, getVoluntaryExitSignatureSet} from "@lodestar/state-transition";
|
|
7
2
|
import {phase0} from "@lodestar/types";
|
|
8
3
|
import {
|
|
9
4
|
GossipAction,
|
|
@@ -53,14 +48,14 @@ async function validateVoluntaryExit(
|
|
|
53
48
|
|
|
54
49
|
// [REJECT] All of the conditions within process_voluntary_exit pass validation.
|
|
55
50
|
// verifySignature = false, verified in batch below
|
|
56
|
-
const validity = getVoluntaryExitValidity(
|
|
51
|
+
const validity = state.getVoluntaryExitValidity(voluntaryExit, false);
|
|
57
52
|
if (validity !== VoluntaryExitValidity.valid) {
|
|
58
53
|
throw new VoluntaryExitError(GossipAction.REJECT, {
|
|
59
54
|
code: voluntaryExitValidityToErrorCode(validity),
|
|
60
55
|
});
|
|
61
56
|
}
|
|
62
57
|
|
|
63
|
-
const signatureSet = getVoluntaryExitSignatureSet(chain.config,
|
|
58
|
+
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state, voluntaryExit);
|
|
64
59
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
65
60
|
throw new VoluntaryExitError(GossipAction.REJECT, {
|
|
66
61
|
code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {ForkSeq, MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
CachedBeaconStateAltair,
|
|
4
|
+
IBeaconStateView,
|
|
6
5
|
ParticipationFlags,
|
|
7
6
|
computeEpochAtSlot,
|
|
8
7
|
computeStartSlotAtEpoch,
|
|
9
8
|
computeTimeAtSlot,
|
|
10
|
-
getBlockRootAtSlot,
|
|
11
9
|
getCurrentSlot,
|
|
12
10
|
parseAttesterFlags,
|
|
13
11
|
parseParticipationFlags,
|
|
@@ -102,7 +100,7 @@ export type ValidatorMonitor = {
|
|
|
102
100
|
syncAggregate: altair.SyncAggregate,
|
|
103
101
|
syncCommitteeIndices: Uint32Array
|
|
104
102
|
): void;
|
|
105
|
-
onceEveryEndOfEpoch(state:
|
|
103
|
+
onceEveryEndOfEpoch(state: IBeaconStateView): void;
|
|
106
104
|
scrapeMetrics(slotClock: Slot): void;
|
|
107
105
|
/** Returns the list of validator indices currently being monitored */
|
|
108
106
|
getMonitoredValidatorIndices(): ValidatorIndex[];
|
|
@@ -736,16 +734,19 @@ export function createValidatorMonitor(
|
|
|
736
734
|
return;
|
|
737
735
|
}
|
|
738
736
|
|
|
737
|
+
if (validators.size === 0) {
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
|
|
739
741
|
const rootCache = new RootHexCache(headState);
|
|
740
742
|
|
|
741
743
|
if (config.getForkSeq(headState.slot) >= ForkSeq.altair) {
|
|
742
|
-
const {previousEpochParticipation} = headState as CachedBeaconStateAltair;
|
|
743
744
|
const prevEpochStartSlot = computeStartSlotAtEpoch(prevEpoch);
|
|
744
|
-
const prevEpochTargetRoot = toRootHex(getBlockRootAtSlot(
|
|
745
|
+
const prevEpochTargetRoot = toRootHex(headState.getBlockRootAtSlot(prevEpochStartSlot));
|
|
745
746
|
|
|
746
747
|
// Check attestation performance
|
|
747
748
|
for (const [index, validator] of validators.entries()) {
|
|
748
|
-
const flags = parseParticipationFlags(
|
|
749
|
+
const flags = parseParticipationFlags(headState.getPreviousEpochParticipation(index));
|
|
749
750
|
const attestationSummary = validator.attestations.get(prevEpoch)?.get(prevEpochTargetRoot);
|
|
750
751
|
const summary = renderAttestationSummary(config, rootCache, attestationSummary, flags);
|
|
751
752
|
validatorMonitorMetrics?.prevEpochAttestationSummary.inc({summary});
|
|
@@ -757,9 +758,9 @@ export function createValidatorMonitor(
|
|
|
757
758
|
}
|
|
758
759
|
}
|
|
759
760
|
|
|
760
|
-
if (headState.
|
|
761
|
+
if (headState.previousProposers !== null) {
|
|
761
762
|
// proposersPrevEpoch is null on the first epoch of `headState` being generated
|
|
762
|
-
for (const [slotIndex, validatorIndex] of headState.
|
|
763
|
+
for (const [slotIndex, validatorIndex] of headState.previousProposers.entries()) {
|
|
763
764
|
const validator = validators.get(validatorIndex);
|
|
764
765
|
if (validator) {
|
|
765
766
|
// If expected proposer is a tracked validator
|
|
@@ -1139,12 +1140,12 @@ function renderBlockProposalSummary(
|
|
|
1139
1140
|
export class RootHexCache {
|
|
1140
1141
|
private readonly blockRootSlotCache = new Map<Slot, RootHex>();
|
|
1141
1142
|
|
|
1142
|
-
constructor(private readonly state:
|
|
1143
|
+
constructor(private readonly state: IBeaconStateView) {}
|
|
1143
1144
|
|
|
1144
1145
|
getBlockRootAtSlot(slot: Slot): RootHex {
|
|
1145
1146
|
let root = this.blockRootSlotCache.get(slot);
|
|
1146
1147
|
if (!root) {
|
|
1147
|
-
root = toRootHex(
|
|
1148
|
+
root = toRootHex(this.state.getBlockRootAtSlot(slot));
|
|
1148
1149
|
this.blockRootSlotCache.set(slot, root);
|
|
1149
1150
|
}
|
|
1150
1151
|
return root;
|
|
@@ -1712,33 +1712,37 @@ export function createLodestarMetrics(
|
|
|
1712
1712
|
}),
|
|
1713
1713
|
},
|
|
1714
1714
|
|
|
1715
|
-
//
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
name: "
|
|
1719
|
-
help: "Total number of gossip
|
|
1715
|
+
// some gossip messages need to wait for block to be processed before they can be processed
|
|
1716
|
+
awaitingBlockGossipMessages: {
|
|
1717
|
+
queue: register.gauge<{topic: GossipType}>({
|
|
1718
|
+
name: "lodestar_awaiting_block_gossip_messages_total",
|
|
1719
|
+
help: "Total number of gossip messages waiting for block to be processed",
|
|
1720
|
+
labelNames: ["topic"],
|
|
1720
1721
|
}),
|
|
1721
1722
|
countPerSlot: register.gauge({
|
|
1722
|
-
name: "
|
|
1723
|
-
help: "Total number of gossip
|
|
1723
|
+
name: "lodestar_awaiting_block_gossip_messages_per_slot_total",
|
|
1724
|
+
help: "Total number of gossip messages waiting for block to be processed per slot",
|
|
1724
1725
|
}),
|
|
1725
|
-
resolve: register.gauge({
|
|
1726
|
-
name: "
|
|
1727
|
-
help: "Total number of gossip
|
|
1726
|
+
resolve: register.gauge<{topic: GossipType}>({
|
|
1727
|
+
name: "lodestar_awaiting_block_gossip_messages_resolve_total",
|
|
1728
|
+
help: "Total number of gossip messages are reprocessed",
|
|
1729
|
+
labelNames: ["topic"],
|
|
1728
1730
|
}),
|
|
1729
|
-
waitSecBeforeResolve: register.gauge({
|
|
1730
|
-
name: "
|
|
1731
|
+
waitSecBeforeResolve: register.gauge<{topic: GossipType}>({
|
|
1732
|
+
name: "lodestar_awaiting_block_gossip_messages_wait_time_resolve_seconds",
|
|
1731
1733
|
help: "Time to wait for unknown block in seconds",
|
|
1734
|
+
labelNames: ["topic"],
|
|
1732
1735
|
}),
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1736
|
+
// having 2 labels here is not great for performance, however it's rarely happening and having the reason label is important for debugging
|
|
1737
|
+
reject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
|
|
1738
|
+
name: "lodestar_awaiting_block_gossip_messages_reject_total",
|
|
1739
|
+
help: "Total number of gossip messages are rejected to reprocess",
|
|
1740
|
+
labelNames: ["reason", "topic"],
|
|
1737
1741
|
}),
|
|
1738
|
-
waitSecBeforeReject: register.gauge<{reason: ReprocessRejectReason}>({
|
|
1739
|
-
name: "
|
|
1742
|
+
waitSecBeforeReject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
|
|
1743
|
+
name: "lodestar_awaiting_block_gossip_messages_wait_time_reject_seconds",
|
|
1740
1744
|
help: "Time to wait for unknown block before being rejected",
|
|
1741
|
-
labelNames: ["reason"],
|
|
1745
|
+
labelNames: ["reason", "topic"],
|
|
1742
1746
|
}),
|
|
1743
1747
|
},
|
|
1744
1748
|
|
|
@@ -24,12 +24,28 @@ const decoder = new snappyWasm.Decoder();
|
|
|
24
24
|
// Shared buffer to convert msgId to string
|
|
25
25
|
const sharedMsgIdBuf = Buffer.alloc(20);
|
|
26
26
|
|
|
27
|
+
// Cache topic -> seed to avoid per-message allocations on the hot path.
|
|
28
|
+
// Topics are a fixed set per fork (changes only at fork boundaries).
|
|
29
|
+
const topicSeedCache = new Map<string, bigint>();
|
|
30
|
+
|
|
27
31
|
/**
|
|
28
32
|
* The function used to generate a gossipsub message id
|
|
29
33
|
* We use the first 8 bytes of SHA256(data) for content addressing
|
|
30
34
|
*/
|
|
31
35
|
export function fastMsgIdFn(rpcMsg: RPC.Message): string {
|
|
32
36
|
if (rpcMsg.data) {
|
|
37
|
+
if (rpcMsg.topic) {
|
|
38
|
+
// Use topic-derived seed to prevent cross-topic deduplication of identical messages.
|
|
39
|
+
// SyncCommitteeMessages are published to multiple sync_committee_{subnet} topics with
|
|
40
|
+
// identical data, so hashing only the data incorrectly deduplicates across subnets.
|
|
41
|
+
// See https://github.com/ChainSafe/lodestar/issues/8294
|
|
42
|
+
let topicSeed = topicSeedCache.get(rpcMsg.topic);
|
|
43
|
+
if (topicSeed === undefined) {
|
|
44
|
+
topicSeed = xxhash.h64Raw(Buffer.from(rpcMsg.topic), h64Seed);
|
|
45
|
+
topicSeedCache.set(rpcMsg.topic, topicSeed);
|
|
46
|
+
}
|
|
47
|
+
return xxhash.h64Raw(rpcMsg.data, topicSeed).toString(16);
|
|
48
|
+
}
|
|
33
49
|
return xxhash.h64Raw(rpcMsg.data, h64Seed).toString(16);
|
|
34
50
|
}
|
|
35
51
|
return "0000000000000000";
|
package/src/network/interface.ts
CHANGED
|
@@ -38,7 +38,12 @@ import {
|
|
|
38
38
|
import {BlockInputSource} from "../chain/blocks/blockInput/types.js";
|
|
39
39
|
import {CustodyConfig} from "../util/dataColumns.js";
|
|
40
40
|
import {PeerIdStr} from "../util/peerId.js";
|
|
41
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
BeaconBlocksByRootRequest,
|
|
43
|
+
BlobSidecarsByRootRequest,
|
|
44
|
+
DataColumnSidecarsByRootRequest,
|
|
45
|
+
ExecutionPayloadEnvelopesByRootRequest,
|
|
46
|
+
} from "../util/types.js";
|
|
42
47
|
import {INetworkCorePublic} from "./core/types.js";
|
|
43
48
|
import {INetworkEventBus} from "./events.js";
|
|
44
49
|
import {GossipType} from "./gossip/interface.js";
|
|
@@ -68,7 +73,7 @@ export interface INetwork extends INetworkCorePublic {
|
|
|
68
73
|
reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): void;
|
|
69
74
|
shouldAggregate(subnet: SubnetID, slot: Slot): boolean;
|
|
70
75
|
reStatusPeers(peers: PeerIdStr[]): Promise<void>;
|
|
71
|
-
|
|
76
|
+
searchUnknownBlock(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void;
|
|
72
77
|
// ReqResp
|
|
73
78
|
sendBeaconBlocksByRange(peerId: PeerIdStr, request: phase0.BeaconBlocksByRangeRequest): Promise<SignedBeaconBlock[]>;
|
|
74
79
|
sendBeaconBlocksByRoot(peerId: PeerIdStr, request: BeaconBlocksByRootRequest): Promise<SignedBeaconBlock[]>;
|
|
@@ -82,6 +87,14 @@ export interface INetwork extends INetworkCorePublic {
|
|
|
82
87
|
peerId: PeerIdStr,
|
|
83
88
|
request: DataColumnSidecarsByRootRequest
|
|
84
89
|
): Promise<fulu.DataColumnSidecar[]>;
|
|
90
|
+
sendExecutionPayloadEnvelopesByRange(
|
|
91
|
+
peerId: PeerIdStr,
|
|
92
|
+
request: gloas.ExecutionPayloadEnvelopesByRangeRequest
|
|
93
|
+
): Promise<gloas.SignedExecutionPayloadEnvelope[]>;
|
|
94
|
+
sendExecutionPayloadEnvelopesByRoot(
|
|
95
|
+
peerId: PeerIdStr,
|
|
96
|
+
request: ExecutionPayloadEnvelopesByRootRequest
|
|
97
|
+
): Promise<gloas.SignedExecutionPayloadEnvelope[]>;
|
|
85
98
|
|
|
86
99
|
// Gossip
|
|
87
100
|
publishBeaconBlock(signedBlock: SignedBeaconBlock): Promise<number>;
|
|
@@ -88,6 +88,9 @@ export async function createNodeJsLibp2p(
|
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
if (networkOpts.quic) {
|
|
91
|
+
const quicMultiaddrs = localMultiaddrs.filter((ma) => ma.includes("/quic-v1"));
|
|
92
|
+
const hasIpv4Quic = quicMultiaddrs.some((ma) => ma.includes("/ip4/"));
|
|
93
|
+
const hasIpv6Quic = quicMultiaddrs.some((ma) => ma.includes("/ip6/"));
|
|
91
94
|
transports.unshift(
|
|
92
95
|
quic({
|
|
93
96
|
handshakeTimeout: 5_000,
|
|
@@ -96,6 +99,8 @@ export async function createNodeJsLibp2p(
|
|
|
96
99
|
maxConcurrentStreamLimit: 256,
|
|
97
100
|
maxStreamData: 10_000_000,
|
|
98
101
|
maxConnectionData: 15_000_000,
|
|
102
|
+
ipv4: hasIpv4Quic,
|
|
103
|
+
ipv6: hasIpv6Quic,
|
|
99
104
|
})
|
|
100
105
|
);
|
|
101
106
|
}
|
package/src/network/network.ts
CHANGED
|
@@ -40,7 +40,12 @@ import {IClock} from "../util/clock.js";
|
|
|
40
40
|
import {CustodyConfig} from "../util/dataColumns.js";
|
|
41
41
|
import {PeerIdStr, peerIdToString} from "../util/peerId.js";
|
|
42
42
|
import {promiseAllMaybeAsync} from "../util/promises.js";
|
|
43
|
-
import {
|
|
43
|
+
import {
|
|
44
|
+
BeaconBlocksByRootRequest,
|
|
45
|
+
BlobSidecarsByRootRequest,
|
|
46
|
+
DataColumnSidecarsByRootRequest,
|
|
47
|
+
ExecutionPayloadEnvelopesByRootRequest,
|
|
48
|
+
} from "../util/types.js";
|
|
44
49
|
import {INetworkCore, NetworkCore, WorkerNetworkCore} from "./core/index.js";
|
|
45
50
|
import {INetworkEventBus, NetworkEvent, NetworkEventBus, NetworkEventData} from "./events.js";
|
|
46
51
|
import {getActiveForkBoundaries} from "./forks.js";
|
|
@@ -161,7 +166,7 @@ export class Network implements INetwork {
|
|
|
161
166
|
const events = new NetworkEventBus();
|
|
162
167
|
const aggregatorTracker = new AggregatorTracker();
|
|
163
168
|
|
|
164
|
-
const activeValidatorCount = chain.getHeadState().
|
|
169
|
+
const activeValidatorCount = chain.getHeadState().activeValidatorCount;
|
|
165
170
|
const initialStatus = chain.getStatus();
|
|
166
171
|
const initialCustodyGroupCount = chain.custodyConfig.targetCustodyGroupCount;
|
|
167
172
|
|
|
@@ -277,8 +282,8 @@ export class Network implements INetwork {
|
|
|
277
282
|
return this.core.reStatusPeers(peers);
|
|
278
283
|
}
|
|
279
284
|
|
|
280
|
-
|
|
281
|
-
this.networkProcessor.
|
|
285
|
+
searchUnknownBlock(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void {
|
|
286
|
+
this.networkProcessor.searchUnknownBlock(slotRoot, source, peer);
|
|
282
287
|
}
|
|
283
288
|
|
|
284
289
|
async reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): Promise<void> {
|
|
@@ -636,6 +641,29 @@ export class Network implements INetwork {
|
|
|
636
641
|
);
|
|
637
642
|
}
|
|
638
643
|
|
|
644
|
+
async sendExecutionPayloadEnvelopesByRange(
|
|
645
|
+
peerId: PeerIdStr,
|
|
646
|
+
request: gloas.ExecutionPayloadEnvelopesByRangeRequest
|
|
647
|
+
): Promise<gloas.SignedExecutionPayloadEnvelope[]> {
|
|
648
|
+
return collectMaxResponseTyped(
|
|
649
|
+
this.sendReqRespRequest(peerId, ReqRespMethod.ExecutionPayloadEnvelopesByRange, [Version.V1], request),
|
|
650
|
+
request.count,
|
|
651
|
+
responseSszTypeByMethod[ReqRespMethod.ExecutionPayloadEnvelopesByRange]
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
async sendExecutionPayloadEnvelopesByRoot(
|
|
656
|
+
peerId: PeerIdStr,
|
|
657
|
+
request: ExecutionPayloadEnvelopesByRootRequest
|
|
658
|
+
): Promise<gloas.SignedExecutionPayloadEnvelope[]> {
|
|
659
|
+
return collectMaxResponseTyped(
|
|
660
|
+
this.sendReqRespRequest(peerId, ReqRespMethod.ExecutionPayloadEnvelopesByRoot, [Version.V1], request),
|
|
661
|
+
request.length,
|
|
662
|
+
responseSszTypeByMethod[ReqRespMethod.ExecutionPayloadEnvelopesByRoot],
|
|
663
|
+
this.chain.serializedCache
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
|
|
639
667
|
private sendReqRespRequest<Req>(
|
|
640
668
|
peerId: PeerIdStr,
|
|
641
669
|
method: ReqRespMethod,
|
|
@@ -17,7 +17,7 @@ import {ExtractSlotRootFns} from "./types.js";
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Extract the slot and block root of a gossip message form serialized data.
|
|
20
|
-
*
|
|
20
|
+
* Not applicable for all topics.
|
|
21
21
|
*/
|
|
22
22
|
export function createExtractBlockSlotRootFns(): ExtractSlotRootFns {
|
|
23
23
|
return {
|
|
@@ -777,9 +777,9 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
777
777
|
const {serializedData} = gossipData;
|
|
778
778
|
const syncCommittee = sszDeserialize(topic, serializedData);
|
|
779
779
|
const {subnet} = topic;
|
|
780
|
-
let
|
|
780
|
+
let indicesInSubcommittee: number[] = [0];
|
|
781
781
|
try {
|
|
782
|
-
|
|
782
|
+
indicesInSubcommittee = (await validateGossipSyncCommittee(chain, syncCommittee, subnet)).indicesInSubcommittee;
|
|
783
783
|
} catch (e) {
|
|
784
784
|
if (e instanceof SyncCommitteeError && e.action === GossipAction.REJECT) {
|
|
785
785
|
chain.persistInvalidSszValue(ssz.altair.SyncCommitteeMessage, syncCommittee, "gossip_reject");
|
|
@@ -787,11 +787,12 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
787
787
|
throw e;
|
|
788
788
|
}
|
|
789
789
|
|
|
790
|
-
// Handler
|
|
791
|
-
|
|
790
|
+
// Handler — add for ALL positions this validator holds in the subcommittee
|
|
792
791
|
try {
|
|
793
|
-
const
|
|
794
|
-
|
|
792
|
+
for (const indexInSubcommittee of indicesInSubcommittee) {
|
|
793
|
+
const insertOutcome = chain.syncCommitteeMessagePool.add(subnet, syncCommittee, indexInSubcommittee);
|
|
794
|
+
metrics?.opPool.syncCommitteeMessagePoolInsertOutcome.inc({insertOutcome});
|
|
795
|
+
}
|
|
795
796
|
} catch (e) {
|
|
796
797
|
logger.debug("Error adding to syncCommittee pool", {subnet}, e as Error);
|
|
797
798
|
}
|
|
@@ -840,36 +841,44 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
840
841
|
seenTimestampSec,
|
|
841
842
|
}: GossipHandlerParamGeneric<GossipType.execution_payload>) => {
|
|
842
843
|
const {serializedData} = gossipData;
|
|
843
|
-
const
|
|
844
|
+
const signedEnvelope = sszDeserialize(topic, serializedData);
|
|
845
|
+
const envelope = signedEnvelope.message;
|
|
844
846
|
// TODO GLOAS: handle BLOCK_ROOT_UNKNOWN error to trigger sync
|
|
845
|
-
await validateGossipExecutionPayloadEnvelope(chain,
|
|
847
|
+
await validateGossipExecutionPayloadEnvelope(chain, signedEnvelope);
|
|
846
848
|
|
|
847
|
-
const slot =
|
|
849
|
+
const slot = envelope.slot;
|
|
848
850
|
const delaySec = seenTimestampSec - computeTimeAtSlot(config, slot, chain.genesisTime);
|
|
849
851
|
metrics?.gossipExecutionPayloadEnvelope.elapsedTimeTillReceived.observe({source: OpSource.gossip}, delaySec);
|
|
850
|
-
chain.validatorMonitor?.registerExecutionPayloadEnvelope(OpSource.gossip, delaySec,
|
|
852
|
+
chain.validatorMonitor?.registerExecutionPayloadEnvelope(OpSource.gossip, delaySec, signedEnvelope);
|
|
851
853
|
|
|
852
|
-
const blockRootHex = toRootHex(
|
|
854
|
+
const blockRootHex = toRootHex(envelope.beaconBlockRoot);
|
|
853
855
|
const payloadInput = chain.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
854
856
|
|
|
855
857
|
if (!payloadInput) {
|
|
856
858
|
// This shouldn't happen because beacon block should have been imported and thus payload input should have been created.
|
|
857
|
-
throw new ExecutionPayloadEnvelopeError(GossipAction.
|
|
859
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
858
860
|
code: ExecutionPayloadEnvelopeErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING,
|
|
859
861
|
blockRoot: blockRootHex,
|
|
860
862
|
});
|
|
861
863
|
}
|
|
862
864
|
|
|
863
|
-
chain.serializedCache.set(
|
|
865
|
+
chain.serializedCache.set(signedEnvelope, serializedData);
|
|
864
866
|
|
|
865
867
|
payloadInput.addPayloadEnvelope({
|
|
866
|
-
envelope:
|
|
868
|
+
envelope: signedEnvelope,
|
|
867
869
|
source: PayloadEnvelopeInputSource.gossip,
|
|
868
870
|
seenTimestampSec,
|
|
869
871
|
peerIdStr,
|
|
870
872
|
});
|
|
871
873
|
|
|
872
|
-
|
|
874
|
+
chain.emitter.emit(routes.events.EventType.executionPayloadGossip, {
|
|
875
|
+
slot,
|
|
876
|
+
builderIndex: envelope.builderIndex,
|
|
877
|
+
blockHash: toRootHex(envelope.payload.blockHash),
|
|
878
|
+
blockRoot: blockRootHex,
|
|
879
|
+
stateRoot: toRootHex(envelope.stateRoot),
|
|
880
|
+
});
|
|
881
|
+
|
|
873
882
|
chain.processExecutionPayload(payloadInput, {validSignature: true}).catch((e) => {
|
|
874
883
|
chain.logger.debug("Error processing execution payload from gossip", {slot, root: blockRootHex}, e as Error);
|
|
875
884
|
});
|
|
@@ -1043,7 +1052,7 @@ export async function validateGossipFnRetryUnknownRoot<T>(
|
|
|
1043
1052
|
if (unknownBlockRootRetries === 0) {
|
|
1044
1053
|
// Trigger unknown block root search here
|
|
1045
1054
|
const rootHex = toRootHex(blockRoot);
|
|
1046
|
-
network.
|
|
1055
|
+
network.searchUnknownBlock({slot, root: rootHex}, BlockInputSource.gossip);
|
|
1047
1056
|
}
|
|
1048
1057
|
|
|
1049
1058
|
if (unknownBlockRootRetries++ < MAX_UNKNOWN_BLOCK_ROOT_RETRIES) {
|