@lodestar/beacon-node 1.42.0-dev.f6213da56d → 1.42.0-dev.fb8f8a700e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +25 -13
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +5 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +38 -40
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +8 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +33 -27
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -3
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +5 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +37 -23
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -8
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +87 -51
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +3 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.d.ts +21 -15
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +2 -2
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +4 -4
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +5 -5
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +5 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +4 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +15 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +110 -62
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +31 -9
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +12 -3
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +4 -4
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +30 -24
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +2 -2
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +15 -14
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +4 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +13 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +10 -4
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +3 -4
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +21 -16
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +13 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +14 -14
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +6 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +6 -6
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +14 -14
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +3 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +185 -6
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +10 -7
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +5 -3
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +5 -3
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +17 -12
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +5 -2
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +3 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +11 -9
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/buckets.d.ts +2 -2
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js +4 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +32 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +52 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +2 -729
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/interface.d.ts +7 -4
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +22 -11
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +7 -4
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +12 -3
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +7 -2
- package/lib/network/options.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +25 -5
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +269 -80
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +22 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +313 -80
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +9 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +10 -4
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +16 -4
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +3 -3
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +2 -2
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -2
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +10 -43
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +3 -3
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +4 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +3 -3
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +10 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +3 -3
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +21 -10
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/dataColumns.d.ts +18 -11
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +51 -17
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +6 -2
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +49 -25
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +25 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +189 -2
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +33 -16
- package/src/api/impl/beacon/pool/index.ts +5 -1
- package/src/api/impl/beacon/state/index.ts +43 -55
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +8 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +36 -41
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -4
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +5 -4
- package/src/chain/blocks/importBlock.ts +50 -31
- package/src/chain/blocks/importExecutionPayload.ts +98 -62
- package/src/chain/blocks/index.ts +3 -2
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/types.ts +26 -15
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +10 -14
- package/src/chain/blocks/verifyBlocksSignatures.ts +10 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +148 -95
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/forkChoice/index.ts +35 -41
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +16 -15
- package/src/chain/lightClient/index.ts +9 -18
- package/src/chain/opPools/aggregatedAttestationPool.ts +20 -21
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +14 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +7 -10
- package/src/chain/produceBlock/produceBlockBody.ts +38 -45
- package/src/chain/regen/interface.ts +13 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
- package/src/chain/serializeState.ts +3 -3
- package/src/chain/shufflingCache.ts +5 -7
- package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
- package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
- package/src/chain/stateCache/types.ts +14 -18
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +3 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +10 -10
- package/src/chain/validation/executionPayloadEnvelope.ts +5 -4
- package/src/chain/validation/payloadAttestationMessage.ts +6 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +25 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +9 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +15 -13
- package/src/db/buckets.ts +2 -2
- package/src/db/repositories/dataColumnSidecar.ts +4 -2
- package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
- package/src/metrics/metrics/lodestar.ts +57 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +18 -4
- package/src/network/libp2p/index.ts +24 -13
- package/src/network/network.ts +39 -8
- package/src/network/options.ts +7 -2
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +334 -94
- package/src/network/processor/index.ts +395 -92
- package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +26 -5
- package/src/node/nodejs.ts +6 -5
- package/src/node/notifier.ts +5 -6
- package/src/sync/backfill/backfill.ts +3 -3
- package/src/sync/unknownBlock.ts +13 -53
- package/src/sync/utils/downloadByRange.ts +9 -7
- package/src/sync/utils/downloadByRoot.ts +16 -12
- package/src/util/blobs.ts +35 -15
- package/src/util/dataColumns.ts +69 -25
- package/src/util/execution.ts +49 -30
- package/src/util/sszBytes.ts +245 -3
- package/src/util/types.ts +6 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {PublicKey} from "@chainsafe/blst";
|
|
2
2
|
import {
|
|
3
|
-
CachedBeaconStateGloas,
|
|
4
|
-
canBuilderCoverBid,
|
|
5
3
|
createSingleSignatureSetFromComponents,
|
|
6
4
|
getExecutionPayloadBidSigningRoot,
|
|
7
5
|
isActiveBuilder,
|
|
6
|
+
isStatePostGloas,
|
|
8
7
|
} from "@lodestar/state-transition";
|
|
9
8
|
import {gloas} from "@lodestar/types";
|
|
10
9
|
import {toRootHex} from "@lodestar/utils";
|
|
@@ -33,9 +32,10 @@ async function validateExecutionPayloadBid(
|
|
|
33
32
|
const bid = signedExecutionPayloadBid.message;
|
|
34
33
|
const parentBlockRootHex = toRootHex(bid.parentBlockRoot);
|
|
35
34
|
const parentBlockHashHex = toRootHex(bid.parentBlockHash);
|
|
36
|
-
const state =
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const state = await chain.getHeadStateAtCurrentEpoch(RegenCaller.validateGossipExecutionPayloadBid);
|
|
36
|
+
if (!isStatePostGloas(state)) {
|
|
37
|
+
throw new Error(`Expected gloas+ state for execution payload bid validation, got fork=${state.forkName}`);
|
|
38
|
+
}
|
|
39
39
|
|
|
40
40
|
// [IGNORE] `bid.slot` is the current slot or the next slot.
|
|
41
41
|
const currentSlot = chain.clock.currentSlot;
|
|
@@ -53,7 +53,7 @@ async function validateExecutionPayloadBid(
|
|
|
53
53
|
|
|
54
54
|
// [REJECT] `bid.builder_index` is a valid/active builder index -- i.e.
|
|
55
55
|
// `is_active_builder(state, bid.builder_index)` returns `True`.
|
|
56
|
-
const builder = state.
|
|
56
|
+
const builder = state.getBuilder(bid.builderIndex);
|
|
57
57
|
if (!isActiveBuilder(builder, state.finalizedCheckpoint.epoch)) {
|
|
58
58
|
throw new ExecutionPayloadBidError(GossipAction.REJECT, {
|
|
59
59
|
code: ExecutionPayloadBidErrorCode.BUILDER_NOT_ELIGIBLE,
|
|
@@ -87,9 +87,9 @@ async function validateExecutionPayloadBid(
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
// [IGNORE] this bid is the highest value bid seen for the
|
|
91
|
-
//
|
|
92
|
-
const bestBid = chain.executionPayloadBidPool.getBestBid(
|
|
90
|
+
// [IGNORE] this bid is the highest value bid seen for the tuple
|
|
91
|
+
// `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
|
|
92
|
+
const bestBid = chain.executionPayloadBidPool.getBestBid(bid.slot, parentBlockHashHex, parentBlockRootHex);
|
|
93
93
|
if (bestBid !== null && bestBid.value >= bid.value) {
|
|
94
94
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
95
95
|
code: ExecutionPayloadBidErrorCode.BID_TOO_LOW,
|
|
@@ -99,7 +99,7 @@ async function validateExecutionPayloadBid(
|
|
|
99
99
|
}
|
|
100
100
|
// [IGNORE] `bid.value` is less or equal than the builder's excess balance --
|
|
101
101
|
// i.e. `can_builder_cover_bid(state, builder_index, amount)` returns `True`.
|
|
102
|
-
if (!canBuilderCoverBid(
|
|
102
|
+
if (!state.canBuilderCoverBid(bid.builderIndex, bid.value)) {
|
|
103
103
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
104
104
|
code: ExecutionPayloadBidErrorCode.BID_TOO_HIGH,
|
|
105
105
|
bidValue: bid.value,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {PayloadStatus} from "@lodestar/fork-choice";
|
|
2
2
|
import {
|
|
3
|
-
BeaconStateView,
|
|
4
|
-
CachedBeaconStateGloas,
|
|
5
3
|
computeStartSlotAtEpoch,
|
|
6
4
|
getExecutionPayloadEnvelopeSignatureSet,
|
|
5
|
+
isStatePostGloas,
|
|
7
6
|
} from "@lodestar/state-transition";
|
|
8
7
|
import {gloas} from "@lodestar/types";
|
|
9
8
|
import {toRootHex} from "@lodestar/utils";
|
|
@@ -118,12 +117,14 @@ async function validateExecutionPayloadEnvelope(
|
|
|
118
117
|
slot: envelope.slot,
|
|
119
118
|
});
|
|
120
119
|
});
|
|
120
|
+
if (!isStatePostGloas(blockState)) {
|
|
121
|
+
throw new Error(`Expected gloas+ state for execution payload envelope validation, got fork=${blockState.forkName}`);
|
|
122
|
+
}
|
|
121
123
|
|
|
122
|
-
const state = blockState as CachedBeaconStateGloas;
|
|
123
124
|
const signatureSet = getExecutionPayloadEnvelopeSignatureSet(
|
|
124
125
|
chain.config,
|
|
125
126
|
chain.pubkeyCache,
|
|
126
|
-
|
|
127
|
+
blockState,
|
|
127
128
|
executionPayloadEnvelope,
|
|
128
129
|
payloadInput.proposerIndex
|
|
129
130
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CachedBeaconStateGloas,
|
|
3
2
|
computeEpochAtSlot,
|
|
4
3
|
createSingleSignatureSetFromComponents,
|
|
5
4
|
getPayloadAttestationDataSigningRoot,
|
|
5
|
+
isStatePostGloas,
|
|
6
6
|
} from "@lodestar/state-transition";
|
|
7
7
|
import {RootHex, gloas, ssz} from "@lodestar/types";
|
|
8
8
|
import {toRootHex} from "@lodestar/utils";
|
|
@@ -66,7 +66,10 @@ async function validatePayloadAttestationMessage(
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const state = chain.getHeadState()
|
|
69
|
+
const state = chain.getHeadState();
|
|
70
|
+
if (!isStatePostGloas(state)) {
|
|
71
|
+
throw new Error(`Expected gloas+ state for payload attestation validation, got fork=${state.forkName}`);
|
|
72
|
+
}
|
|
70
73
|
|
|
71
74
|
// [REJECT] The message's block `data.beacon_block_root` passes validation.
|
|
72
75
|
// TODO GLOAS: implement this. Technically if we cannot get proto block from fork choice,
|
|
@@ -75,8 +78,7 @@ async function validatePayloadAttestationMessage(
|
|
|
75
78
|
// [REJECT] The message's validator index is within the payload committee in
|
|
76
79
|
// `get_ptc(state, data.slot)`. The `state` is the head state corresponding to
|
|
77
80
|
// processing the block up to the current slot as determined by the fork choice.
|
|
78
|
-
const
|
|
79
|
-
const validatorCommitteeIndex = ptc.indexOf(validatorIndex);
|
|
81
|
+
const validatorCommitteeIndex = state.getIndexInPayloadTimelinessCommittee(validatorIndex, data.slot);
|
|
80
82
|
|
|
81
83
|
if (validatorCommitteeIndex === -1) {
|
|
82
84
|
throw new PayloadAttestationError(GossipAction.REJECT, {
|
|
@@ -35,7 +35,7 @@ async function validateProposerSlashing(
|
|
|
35
35
|
|
|
36
36
|
// [REJECT] All of the conditions within process_proposer_slashing pass validation.
|
|
37
37
|
try {
|
|
38
|
-
const proposer = state.
|
|
38
|
+
const proposer = state.getValidator(proposerSlashing.signedHeader1.message.proposerIndex);
|
|
39
39
|
// verifySignature = false, verified in batch below
|
|
40
40
|
assertValidProposerSlashing(chain.config, chain.pubkeyCache, state.slot, proposerSlashing, proposer, false);
|
|
41
41
|
} catch (e) {
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {DOMAIN_CONTRIBUTION_AND_PROOF} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
|
-
ISignatureSet,
|
|
6
|
-
SignatureSetType,
|
|
7
|
-
computeSigningRoot,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
3
|
+
import {IBeaconStateView, ISignatureSet, SignatureSetType, computeSigningRoot} from "@lodestar/state-transition";
|
|
9
4
|
import {altair, ssz} from "@lodestar/types";
|
|
10
5
|
|
|
11
6
|
export function getContributionAndProofSignatureSet(
|
|
12
7
|
config: BeaconConfig,
|
|
13
|
-
state:
|
|
8
|
+
state: IBeaconStateView,
|
|
14
9
|
signedContributionAndProof: altair.SignedContributionAndProof
|
|
15
10
|
): ISignatureSet {
|
|
16
11
|
const domain = config.getDomain(
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
|
-
ISignatureSet,
|
|
6
|
-
SignatureSetType,
|
|
7
|
-
computeSigningRoot,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
3
|
+
import {IBeaconStateView, ISignatureSet, SignatureSetType, computeSigningRoot} from "@lodestar/state-transition";
|
|
9
4
|
import {altair, ssz} from "@lodestar/types";
|
|
10
5
|
|
|
11
6
|
export function getSyncCommitteeSignatureSet(
|
|
12
7
|
config: BeaconConfig,
|
|
13
|
-
state:
|
|
8
|
+
state: IBeaconStateView,
|
|
14
9
|
syncCommittee: altair.SyncCommitteeMessage
|
|
15
10
|
): ISignatureSet {
|
|
16
11
|
const domain = config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE, syncCommittee.slot);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params";
|
|
3
|
-
import {
|
|
3
|
+
import {IBeaconStateView, ISignatureSet, SignatureSetType, computeSigningRoot} from "@lodestar/state-transition";
|
|
4
4
|
import {altair, ssz} from "@lodestar/types";
|
|
5
5
|
|
|
6
6
|
export function getSyncCommitteeContributionSignatureSet(
|
|
7
7
|
config: BeaconConfig,
|
|
8
|
-
state:
|
|
8
|
+
state: IBeaconStateView,
|
|
9
9
|
contribution: altair.SyncCommitteeContribution,
|
|
10
10
|
participantIndices: number[]
|
|
11
11
|
): ISignatureSet {
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
|
-
ISignatureSet,
|
|
6
|
-
SignatureSetType,
|
|
7
|
-
computeSigningRoot,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
3
|
+
import {IBeaconStateView, ISignatureSet, SignatureSetType, computeSigningRoot} from "@lodestar/state-transition";
|
|
9
4
|
import {altair, ssz} from "@lodestar/types";
|
|
10
5
|
|
|
11
6
|
export function getSyncCommitteeSelectionProofSignatureSet(
|
|
12
7
|
config: BeaconConfig,
|
|
13
|
-
state:
|
|
8
|
+
state: IBeaconStateView,
|
|
14
9
|
contributionAndProof: altair.ContributionAndProof
|
|
15
10
|
): ISignatureSet {
|
|
16
11
|
const slot = contributionAndProof.contribution.slot;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {SYNC_COMMITTEE_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, isStatePostAltair} from "@lodestar/state-transition";
|
|
3
3
|
import {SubnetID, altair} from "@lodestar/types";
|
|
4
4
|
import {toRootHex} from "@lodestar/utils";
|
|
5
5
|
import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js";
|
|
@@ -15,12 +15,12 @@ export async function validateGossipSyncCommittee(
|
|
|
15
15
|
chain: IBeaconChain,
|
|
16
16
|
syncCommittee: altair.SyncCommitteeMessage,
|
|
17
17
|
subnet: SubnetID
|
|
18
|
-
): Promise<{
|
|
18
|
+
): Promise<{indicesInSubcommittee: IndexInSubcommittee[]}> {
|
|
19
19
|
const {slot, validatorIndex, beaconBlockRoot} = syncCommittee;
|
|
20
20
|
const messageRoot = toRootHex(beaconBlockRoot);
|
|
21
21
|
|
|
22
22
|
const headState = chain.getHeadState();
|
|
23
|
-
const
|
|
23
|
+
const indicesInSubcommittee = validateGossipSyncCommitteeExceptSig(chain, headState, subnet, syncCommittee);
|
|
24
24
|
|
|
25
25
|
// [IGNORE] The signature's slot is for the current slot, i.e. sync_committee_signature.slot == current_slot.
|
|
26
26
|
// > Checked in validateGossipSyncCommitteeExceptSig()
|
|
@@ -68,12 +68,12 @@ export async function validateGossipSyncCommittee(
|
|
|
68
68
|
// Register this valid item as seen
|
|
69
69
|
chain.seenSyncCommitteeMessages.add(slot, subnet, validatorIndex, messageRoot);
|
|
70
70
|
|
|
71
|
-
return {
|
|
71
|
+
return {indicesInSubcommittee};
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export async function validateApiSyncCommittee(
|
|
75
75
|
chain: IBeaconChain,
|
|
76
|
-
headState:
|
|
76
|
+
headState: IBeaconStateView,
|
|
77
77
|
syncCommittee: altair.SyncCommitteeMessage
|
|
78
78
|
): Promise<void> {
|
|
79
79
|
const prioritizeBls = true;
|
|
@@ -85,7 +85,7 @@ export async function validateApiSyncCommittee(
|
|
|
85
85
|
*/
|
|
86
86
|
async function validateSyncCommitteeSigOnly(
|
|
87
87
|
chain: IBeaconChain,
|
|
88
|
-
headState:
|
|
88
|
+
headState: IBeaconStateView,
|
|
89
89
|
syncCommittee: altair.SyncCommitteeMessage,
|
|
90
90
|
prioritizeBls = false
|
|
91
91
|
): Promise<void> {
|
|
@@ -102,10 +102,10 @@ async function validateSyncCommitteeSigOnly(
|
|
|
102
102
|
*/
|
|
103
103
|
export function validateGossipSyncCommitteeExceptSig(
|
|
104
104
|
chain: IBeaconChain,
|
|
105
|
-
headState:
|
|
105
|
+
headState: IBeaconStateView,
|
|
106
106
|
subnet: SubnetID,
|
|
107
107
|
data: Pick<altair.SyncCommitteeMessage, "slot" | "validatorIndex">
|
|
108
|
-
): IndexInSubcommittee {
|
|
108
|
+
): IndexInSubcommittee[] {
|
|
109
109
|
const {slot, validatorIndex} = data;
|
|
110
110
|
// [IGNORE] The signature's slot is for the current slot, i.e. sync_committee_signature.slot == current_slot.
|
|
111
111
|
// (with a MAXIMUM_GOSSIP_CLOCK_DISPARITY allowance)
|
|
@@ -127,39 +127,44 @@ export function validateGossipSyncCommitteeExceptSig(
|
|
|
127
127
|
|
|
128
128
|
// [REJECT] The subnet_id is valid for the given validator, i.e. subnet_id in compute_subnets_for_sync_committee(state, sync_committee_signature.validator_index).
|
|
129
129
|
// Note this validation implies the validator is part of the broader current sync committee along with the correct subcommittee.
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
130
|
+
const indicesInSubcommittee = getIndicesInSubcommittee(headState, subnet, data);
|
|
131
|
+
if (indicesInSubcommittee === null) {
|
|
132
132
|
throw new SyncCommitteeError(GossipAction.REJECT, {
|
|
133
133
|
code: SyncCommitteeErrorCode.VALIDATOR_NOT_IN_SYNC_COMMITTEE,
|
|
134
134
|
validatorIndex,
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
return
|
|
138
|
+
return indicesInSubcommittee;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
* Returns
|
|
143
|
-
* Returns `null` if not part of the sync committee or not part of the given `subnet
|
|
142
|
+
* Returns all IndexInSubcommittee positions of the given `subnet`.
|
|
143
|
+
* Returns `null` if not part of the sync committee or not part of the given `subnet`.
|
|
144
|
+
* A validator may appear multiple times in the same subcommittee.
|
|
144
145
|
*/
|
|
145
|
-
function
|
|
146
|
-
headState:
|
|
146
|
+
function getIndicesInSubcommittee(
|
|
147
|
+
headState: IBeaconStateView,
|
|
147
148
|
subnet: SubnetID,
|
|
148
149
|
data: Pick<altair.SyncCommitteeMessage, "slot" | "validatorIndex">
|
|
149
|
-
): IndexInSubcommittee | null {
|
|
150
|
-
|
|
150
|
+
): IndexInSubcommittee[] | null {
|
|
151
|
+
if (!isStatePostAltair(headState)) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const syncCommittee = headState.getIndexedSyncCommittee(data.slot);
|
|
151
156
|
const indexesInCommittee = syncCommittee.validatorIndexMap.get(data.validatorIndex);
|
|
152
157
|
if (indexesInCommittee === undefined) {
|
|
153
158
|
// Not part of the sync committee
|
|
154
159
|
return null;
|
|
155
160
|
}
|
|
156
161
|
|
|
162
|
+
const indices: IndexInSubcommittee[] = [];
|
|
157
163
|
for (const indexInCommittee of indexesInCommittee) {
|
|
158
164
|
if (Math.floor(indexInCommittee / SYNC_COMMITTEE_SUBNET_SIZE) === subnet) {
|
|
159
|
-
|
|
165
|
+
indices.push(indexInCommittee % SYNC_COMMITTEE_SUBNET_SIZE);
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
|
|
163
|
-
|
|
164
|
-
return null;
|
|
169
|
+
return indices.length > 0 ? indices : null;
|
|
165
170
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, isStatePostAltair, 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,16 @@ 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[] {
|
|
110
|
+
if (!isStatePostAltair(state)) {
|
|
111
|
+
throw new Error("Expected Altair state for sync committee contribution");
|
|
112
|
+
}
|
|
113
|
+
|
|
115
114
|
const startIndex = contribution.subcommitteeIndex * SYNC_COMMITTEE_SUBNET_SIZE;
|
|
116
115
|
|
|
117
|
-
const syncCommittee = state.
|
|
116
|
+
const syncCommittee = state.getIndexedSyncCommittee(contribution.slot);
|
|
118
117
|
// The bits in contribution.aggregationBits select validatorIndexes in the subcommittee starting at startIndex
|
|
119
118
|
const subcommitteeValidatorIndices = syncCommittee.validatorIndices.slice(
|
|
120
119
|
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,14 +1,13 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {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,
|
|
10
|
+
isStatePostAltair,
|
|
12
11
|
parseAttesterFlags,
|
|
13
12
|
parseParticipationFlags,
|
|
14
13
|
} from "@lodestar/state-transition";
|
|
@@ -102,7 +101,7 @@ export type ValidatorMonitor = {
|
|
|
102
101
|
syncAggregate: altair.SyncAggregate,
|
|
103
102
|
syncCommitteeIndices: Uint32Array
|
|
104
103
|
): void;
|
|
105
|
-
onceEveryEndOfEpoch(state:
|
|
104
|
+
onceEveryEndOfEpoch(state: IBeaconStateView): void;
|
|
106
105
|
scrapeMetrics(slotClock: Slot): void;
|
|
107
106
|
/** Returns the list of validator indices currently being monitored */
|
|
108
107
|
getMonitoredValidatorIndices(): ValidatorIndex[];
|
|
@@ -736,16 +735,19 @@ export function createValidatorMonitor(
|
|
|
736
735
|
return;
|
|
737
736
|
}
|
|
738
737
|
|
|
738
|
+
if (validators.size === 0) {
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
|
|
739
742
|
const rootCache = new RootHexCache(headState);
|
|
740
743
|
|
|
741
|
-
if (
|
|
742
|
-
const {previousEpochParticipation} = headState as CachedBeaconStateAltair;
|
|
744
|
+
if (isStatePostAltair(headState)) {
|
|
743
745
|
const prevEpochStartSlot = computeStartSlotAtEpoch(prevEpoch);
|
|
744
|
-
const prevEpochTargetRoot = toRootHex(getBlockRootAtSlot(
|
|
746
|
+
const prevEpochTargetRoot = toRootHex(headState.getBlockRootAtSlot(prevEpochStartSlot));
|
|
745
747
|
|
|
746
748
|
// Check attestation performance
|
|
747
749
|
for (const [index, validator] of validators.entries()) {
|
|
748
|
-
const flags = parseParticipationFlags(
|
|
750
|
+
const flags = parseParticipationFlags(headState.getPreviousEpochParticipation(index));
|
|
749
751
|
const attestationSummary = validator.attestations.get(prevEpoch)?.get(prevEpochTargetRoot);
|
|
750
752
|
const summary = renderAttestationSummary(config, rootCache, attestationSummary, flags);
|
|
751
753
|
validatorMonitorMetrics?.prevEpochAttestationSummary.inc({summary});
|
|
@@ -757,9 +759,9 @@ export function createValidatorMonitor(
|
|
|
757
759
|
}
|
|
758
760
|
}
|
|
759
761
|
|
|
760
|
-
if (headState.
|
|
762
|
+
if (headState.previousProposers !== null) {
|
|
761
763
|
// proposersPrevEpoch is null on the first epoch of `headState` being generated
|
|
762
|
-
for (const [slotIndex, validatorIndex] of headState.
|
|
764
|
+
for (const [slotIndex, validatorIndex] of headState.previousProposers.entries()) {
|
|
763
765
|
const validator = validators.get(validatorIndex);
|
|
764
766
|
if (validator) {
|
|
765
767
|
// If expected proposer is a tracked validator
|
|
@@ -1139,12 +1141,12 @@ function renderBlockProposalSummary(
|
|
|
1139
1141
|
export class RootHexCache {
|
|
1140
1142
|
private readonly blockRootSlotCache = new Map<Slot, RootHex>();
|
|
1141
1143
|
|
|
1142
|
-
constructor(private readonly state:
|
|
1144
|
+
constructor(private readonly state: IBeaconStateView) {}
|
|
1143
1145
|
|
|
1144
1146
|
getBlockRootAtSlot(slot: Slot): RootHex {
|
|
1145
1147
|
let root = this.blockRootSlotCache.get(slot);
|
|
1146
1148
|
if (!root) {
|
|
1147
|
-
root = toRootHex(
|
|
1149
|
+
root = toRootHex(this.state.getBlockRootAtSlot(slot));
|
|
1148
1150
|
this.blockRootSlotCache.set(slot, root);
|
|
1149
1151
|
}
|
|
1150
1152
|
return root;
|
package/src/db/buckets.ts
CHANGED
|
@@ -67,8 +67,8 @@ export enum Bucket {
|
|
|
67
67
|
// lightClient_bestLightClientUpdate = 55, // SyncPeriod -> LightClientUpdate // DEPRECATED on v1.5.0
|
|
68
68
|
lightClient_bestLightClientUpdate = 56, // SyncPeriod -> [Slot, LightClientUpdate]
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
allForks_dataColumnSidecars = 57, // BeaconBlockRoot -> DataColumnSidecars
|
|
71
|
+
allForks_dataColumnSidecarsArchive = 58, // BeaconBlockSlot -> DataColumnSidecars
|
|
72
72
|
|
|
73
73
|
gloas_executionPayloadEnvelope = 59, // GLOAS BeaconBlockRoot -> SignedExecutionPayloadEnvelope
|
|
74
74
|
gloas_executionPayloadEnvelopeArchive = 60, // GLOAS Slot -> SignedExecutionPayloadEnvelope
|
|
@@ -18,8 +18,10 @@ type BlockRoot = Root;
|
|
|
18
18
|
*/
|
|
19
19
|
export class DataColumnSidecarRepository extends PrefixedRepository<BlockRoot, ColumnIndex, DataColumnSidecar> {
|
|
20
20
|
constructor(config: ChainForkConfig, db: Db) {
|
|
21
|
-
const bucket = Bucket.
|
|
22
|
-
|
|
21
|
+
const bucket = Bucket.allForks_dataColumnSidecars;
|
|
22
|
+
// Type won't be used since we select it dynamically based on fork
|
|
23
|
+
const type = ssz.fulu.DataColumnSidecar;
|
|
24
|
+
super(config, db, bucket, type, getBucketNameByValue(bucket));
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
/**
|
|
@@ -16,8 +16,10 @@ const SLOT_BYTE_SIZE = 8;
|
|
|
16
16
|
*/
|
|
17
17
|
export class DataColumnSidecarArchiveRepository extends PrefixedRepository<Slot, ColumnIndex, DataColumnSidecar> {
|
|
18
18
|
constructor(config: ChainForkConfig, db: Db) {
|
|
19
|
-
const bucket = Bucket.
|
|
20
|
-
|
|
19
|
+
const bucket = Bucket.allForks_dataColumnSidecarsArchive;
|
|
20
|
+
// Type won't be used since we select it dynamically based on fork
|
|
21
|
+
const type = ssz.fulu.DataColumnSidecar;
|
|
22
|
+
super(config, db, bucket, type, getBucketNameByValue(bucket));
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
@@ -1712,33 +1712,71 @@ 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"],
|
|
1746
|
+
}),
|
|
1747
|
+
},
|
|
1748
|
+
|
|
1749
|
+
// some gossip messages need to wait for payload to be processed before they can be processed
|
|
1750
|
+
awaitingPayloadGossipMessages: {
|
|
1751
|
+
queue: register.gauge<{topic: GossipType}>({
|
|
1752
|
+
name: "lodestar_awaiting_payload_gossip_messages_total",
|
|
1753
|
+
help: "Total number of gossip messages waiting for payload to be processed",
|
|
1754
|
+
labelNames: ["topic"],
|
|
1755
|
+
}),
|
|
1756
|
+
countPerSlot: register.gauge({
|
|
1757
|
+
name: "lodestar_awaiting_payload_gossip_messages_per_slot_total",
|
|
1758
|
+
help: "Total number of gossip messages waiting for payload to be processed per slot",
|
|
1759
|
+
}),
|
|
1760
|
+
resolve: register.gauge<{topic: GossipType}>({
|
|
1761
|
+
name: "lodestar_awaiting_payload_gossip_messages_resolve_total",
|
|
1762
|
+
help: "Total number of gossip messages are reprocessed",
|
|
1763
|
+
labelNames: ["topic"],
|
|
1764
|
+
}),
|
|
1765
|
+
waitSecBeforeResolve: register.gauge<{topic: GossipType}>({
|
|
1766
|
+
name: "lodestar_awaiting_payload_gossip_messages_wait_time_resolve_seconds",
|
|
1767
|
+
help: "Time to wait for unknown payload in seconds",
|
|
1768
|
+
labelNames: ["topic"],
|
|
1769
|
+
}),
|
|
1770
|
+
// having 2 labels here is not great for performance, however it's rarely happening and having the reason label is important for debugging
|
|
1771
|
+
reject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
|
|
1772
|
+
name: "lodestar_awaiting_payload_gossip_messages_reject_total",
|
|
1773
|
+
help: "Total number of gossip messages are rejected to reprocess",
|
|
1774
|
+
labelNames: ["reason", "topic"],
|
|
1775
|
+
}),
|
|
1776
|
+
waitSecBeforeReject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
|
|
1777
|
+
name: "lodestar_awaiting_payload_gossip_messages_wait_time_reject_seconds",
|
|
1778
|
+
help: "Time to wait for unknown payload before being rejected",
|
|
1779
|
+
labelNames: ["reason", "topic"],
|
|
1742
1780
|
}),
|
|
1743
1781
|
},
|
|
1744
1782
|
|
|
@@ -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";
|