@lodestar/beacon-node 1.42.0-dev.5f2fffc2ce → 1.42.0-dev.6fa48cb5f2
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 +36 -17
- 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 +4 -3
- 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 +27 -11
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +48 -0
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -0
- package/lib/chain/blocks/importExecutionPayload.js +158 -0
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -0
- package/lib/chain/blocks/index.js +1 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.js +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/index.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +80 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +248 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +29 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.js +11 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +15 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +46 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -0
- package/lib/chain/blocks/types.d.ts +9 -2
- 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 +3 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +3 -3
- 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/blocks/writePayloadEnvelopeInputToDb.d.ts +12 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +40 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -0
- package/lib/chain/chain.d.ts +19 -14
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +75 -42
- 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/errors/executionPayloadEnvelope.d.ts +12 -2
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +3 -1
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +27 -33
- 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 +17 -15
- 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 +2 -2
- 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 +8 -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 +13 -17
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +15 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +2 -0
- package/lib/chain/regen/interface.js.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/index.d.ts +1 -1
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +1 -1
- package/lib/chain/seenCache/index.js.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 +38 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +76 -0
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -0
- 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 +29 -19
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.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 +5 -4
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +13 -8
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +2 -2
- package/lib/metrics/metrics/lodestar.d.ts +40 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +93 -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 +727 -0
- 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 +11 -5
- package/lib/network/network.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 +15 -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 +39 -9
- 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 +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +10 -1
- 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 +3 -3
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +3 -3
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/constants.d.ts +1 -1
- package/lib/sync/constants.js +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/sszBytes.d.ts +4 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +69 -12
- 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 +37 -18
- 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 +4 -3
- package/src/chain/blocks/importBlock.ts +47 -16
- package/src/chain/blocks/importExecutionPayload.ts +236 -0
- package/src/chain/blocks/index.ts +1 -1
- package/src/chain/blocks/payloadEnvelopeInput/index.ts +2 -0
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +336 -0
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +33 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +61 -0
- package/src/chain/blocks/types.ts +10 -2
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +5 -10
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +55 -0
- package/src/chain/chain.ts +112 -70
- package/src/chain/emitter.ts +2 -2
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
- package/src/chain/forkChoice/index.ts +33 -52
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +18 -16
- 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 +4 -4
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +6 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +11 -10
- package/src/chain/produceBlock/produceBlockBody.ts +23 -50
- package/src/chain/regen/interface.ts +15 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/seenCache/index.ts +1 -1
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +106 -0
- 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 +36 -29
- package/src/chain/validation/lightClientFinalityUpdate.ts +1 -1
- package/src/chain/validation/lightClientOptimisticUpdate.ts +1 -1
- 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 +23 -12
- package/src/execution/engine/interface.ts +2 -2
- package/src/metrics/metrics/lodestar.ts +100 -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 +34 -6
- package/src/network/processor/extractSlotRootFns.ts +19 -6
- package/src/network/processor/gossipHandlers.ts +45 -8
- package/src/network/processor/index.ts +110 -89
- package/src/network/reqresp/ReqRespBeaconNode.ts +14 -1
- 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 +4 -4
- package/src/sync/constants.ts +1 -1
- package/src/sync/unknownBlock.ts +10 -50
- package/src/util/sszBytes.ts +90 -10
- package/src/util/types.ts +6 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts +0 -15
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +0 -1
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js +0 -28
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +0 -1
- package/src/chain/seenCache/seenExecutionPayloadEnvelope.ts +0 -34
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import {NUMBER_OF_COLUMNS} from "@lodestar/params";
|
|
2
|
+
import {ColumnIndex, DataColumnSidecars, RootHex, Slot, ValidatorIndex, deneb, gloas} from "@lodestar/types";
|
|
3
|
+
import {toRootHex, withTimeout} from "@lodestar/utils";
|
|
4
|
+
import {VersionedHashes} from "../../../execution/index.js";
|
|
5
|
+
import {kzgCommitmentToVersionedHash} from "../../../util/blobs.js";
|
|
6
|
+
import {AddPayloadEnvelopeProps, ColumnWithSource, CreateFromBlockProps, SourceMeta} from "./types.js";
|
|
7
|
+
|
|
8
|
+
export type PayloadEnvelopeInputState =
|
|
9
|
+
| {
|
|
10
|
+
hasPayload: false;
|
|
11
|
+
hasAllData: false;
|
|
12
|
+
hasComputedAllData: false;
|
|
13
|
+
}
|
|
14
|
+
| {
|
|
15
|
+
hasPayload: false;
|
|
16
|
+
hasAllData: true;
|
|
17
|
+
hasComputedAllData: boolean;
|
|
18
|
+
}
|
|
19
|
+
| {
|
|
20
|
+
hasPayload: true;
|
|
21
|
+
hasAllData: false;
|
|
22
|
+
hasComputedAllData: false;
|
|
23
|
+
payloadEnvelope: gloas.SignedExecutionPayloadEnvelope;
|
|
24
|
+
payloadEnvelopeSource: SourceMeta;
|
|
25
|
+
}
|
|
26
|
+
| {
|
|
27
|
+
hasPayload: true;
|
|
28
|
+
hasAllData: true;
|
|
29
|
+
hasComputedAllData: boolean;
|
|
30
|
+
payloadEnvelope: gloas.SignedExecutionPayloadEnvelope;
|
|
31
|
+
payloadEnvelopeSource: SourceMeta;
|
|
32
|
+
timeCompleteSec: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type PromiseParts<T> = {
|
|
36
|
+
promise: Promise<T>;
|
|
37
|
+
resolve: (value: T) => void;
|
|
38
|
+
reject: (e: Error) => void;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function createPromise<T>(): PromiseParts<T> {
|
|
42
|
+
let resolve!: (value: T) => void;
|
|
43
|
+
let reject!: (e: Error) => void;
|
|
44
|
+
const promise = new Promise<T>((_resolve, _reject) => {
|
|
45
|
+
resolve = _resolve;
|
|
46
|
+
reject = _reject;
|
|
47
|
+
});
|
|
48
|
+
return {promise, resolve, reject};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Tracks bid + payload envelope + data columns for a Gloas block.
|
|
53
|
+
*
|
|
54
|
+
* Created during block import from signedExecutionPayloadBid in block body.
|
|
55
|
+
* Always has bid (required for creation).
|
|
56
|
+
*
|
|
57
|
+
* Completion requires: payload envelope + all sampled columns
|
|
58
|
+
*/
|
|
59
|
+
export class PayloadEnvelopeInput {
|
|
60
|
+
readonly blockRootHex: RootHex;
|
|
61
|
+
readonly slot: Slot;
|
|
62
|
+
readonly proposerIndex: ValidatorIndex;
|
|
63
|
+
readonly bid: gloas.ExecutionPayloadBid;
|
|
64
|
+
readonly versionedHashes: VersionedHashes;
|
|
65
|
+
|
|
66
|
+
private columnsCache = new Map<ColumnIndex, ColumnWithSource>();
|
|
67
|
+
|
|
68
|
+
private readonly sampledColumns: ColumnIndex[];
|
|
69
|
+
private readonly custodyColumns: ColumnIndex[];
|
|
70
|
+
|
|
71
|
+
private timeCreatedSec: number;
|
|
72
|
+
|
|
73
|
+
private readonly payloadEnvelopeDataPromise: PromiseParts<gloas.SignedExecutionPayloadEnvelope>;
|
|
74
|
+
private readonly columnsDataPromise: PromiseParts<DataColumnSidecars>;
|
|
75
|
+
|
|
76
|
+
state: PayloadEnvelopeInputState;
|
|
77
|
+
|
|
78
|
+
private constructor(props: {
|
|
79
|
+
blockRootHex: RootHex;
|
|
80
|
+
slot: Slot;
|
|
81
|
+
proposerIndex: ValidatorIndex;
|
|
82
|
+
bid: gloas.ExecutionPayloadBid;
|
|
83
|
+
sampledColumns: ColumnIndex[];
|
|
84
|
+
custodyColumns: ColumnIndex[];
|
|
85
|
+
timeCreatedSec: number;
|
|
86
|
+
}) {
|
|
87
|
+
this.blockRootHex = props.blockRootHex;
|
|
88
|
+
this.slot = props.slot;
|
|
89
|
+
this.proposerIndex = props.proposerIndex;
|
|
90
|
+
this.bid = props.bid;
|
|
91
|
+
this.versionedHashes = props.bid.blobKzgCommitments.map(kzgCommitmentToVersionedHash);
|
|
92
|
+
this.sampledColumns = props.sampledColumns;
|
|
93
|
+
this.custodyColumns = props.custodyColumns;
|
|
94
|
+
this.timeCreatedSec = props.timeCreatedSec;
|
|
95
|
+
this.payloadEnvelopeDataPromise = createPromise();
|
|
96
|
+
this.columnsDataPromise = createPromise();
|
|
97
|
+
|
|
98
|
+
const noBlobs = props.bid.blobKzgCommitments.length === 0;
|
|
99
|
+
const noSampledColumns = props.sampledColumns.length === 0;
|
|
100
|
+
const hasAllData = noBlobs || noSampledColumns;
|
|
101
|
+
|
|
102
|
+
if (hasAllData) {
|
|
103
|
+
this.state = {hasPayload: false, hasAllData: true, hasComputedAllData: true};
|
|
104
|
+
this.columnsDataPromise.resolve(this.getSampledColumns());
|
|
105
|
+
} else {
|
|
106
|
+
this.state = {hasPayload: false, hasAllData: false, hasComputedAllData: false};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static createFromBlock(props: CreateFromBlockProps): PayloadEnvelopeInput {
|
|
111
|
+
const bid = (props.block.message.body as gloas.BeaconBlockBody).signedExecutionPayloadBid.message;
|
|
112
|
+
return new PayloadEnvelopeInput({
|
|
113
|
+
blockRootHex: props.blockRootHex,
|
|
114
|
+
slot: props.block.message.slot,
|
|
115
|
+
proposerIndex: props.block.message.proposerIndex,
|
|
116
|
+
bid,
|
|
117
|
+
sampledColumns: props.sampledColumns,
|
|
118
|
+
custodyColumns: props.custodyColumns,
|
|
119
|
+
timeCreatedSec: props.timeCreatedSec,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
getBid(): gloas.ExecutionPayloadBid {
|
|
124
|
+
return this.bid;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
getBuilderIndex(): ValidatorIndex {
|
|
128
|
+
return this.bid.builderIndex;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
getBlockHashHex(): RootHex {
|
|
132
|
+
return toRootHex(this.bid.blockHash);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
getBlobKzgCommitments(): deneb.BlobKzgCommitments {
|
|
136
|
+
return this.bid.blobKzgCommitments;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
addPayloadEnvelope(props: AddPayloadEnvelopeProps): void {
|
|
140
|
+
if (this.state.hasPayload) {
|
|
141
|
+
throw new Error(`Payload envelope already set for block ${this.blockRootHex}`);
|
|
142
|
+
}
|
|
143
|
+
if (toRootHex(props.envelope.message.beaconBlockRoot) !== this.blockRootHex) {
|
|
144
|
+
throw new Error("Payload envelope beacon_block_root mismatch");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const source: SourceMeta = {
|
|
148
|
+
source: props.source,
|
|
149
|
+
seenTimestampSec: props.seenTimestampSec,
|
|
150
|
+
peerIdStr: props.peerIdStr,
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
if (this.state.hasAllData) {
|
|
154
|
+
// Complete state
|
|
155
|
+
this.state = {
|
|
156
|
+
hasPayload: true,
|
|
157
|
+
hasAllData: true,
|
|
158
|
+
hasComputedAllData: this.state.hasComputedAllData,
|
|
159
|
+
payloadEnvelope: props.envelope,
|
|
160
|
+
payloadEnvelopeSource: source,
|
|
161
|
+
timeCompleteSec: props.seenTimestampSec,
|
|
162
|
+
};
|
|
163
|
+
this.payloadEnvelopeDataPromise.resolve(props.envelope);
|
|
164
|
+
} else {
|
|
165
|
+
// Has payload, waiting for columns
|
|
166
|
+
this.state = {
|
|
167
|
+
hasPayload: true,
|
|
168
|
+
hasAllData: false,
|
|
169
|
+
hasComputedAllData: false,
|
|
170
|
+
payloadEnvelope: props.envelope,
|
|
171
|
+
payloadEnvelopeSource: source,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
addColumn(columnWithSource: ColumnWithSource): void {
|
|
177
|
+
const {columnSidecar, seenTimestampSec} = columnWithSource;
|
|
178
|
+
this.columnsCache.set(columnSidecar.index, columnWithSource);
|
|
179
|
+
|
|
180
|
+
const sampledColumns = this.getSampledColumns();
|
|
181
|
+
const hasAllData =
|
|
182
|
+
// already hasAllData
|
|
183
|
+
this.state.hasAllData ||
|
|
184
|
+
// has all sampled columns
|
|
185
|
+
sampledColumns.length === this.sampledColumns.length ||
|
|
186
|
+
// has enough columns to reconstruct the rest
|
|
187
|
+
this.columnsCache.size >= NUMBER_OF_COLUMNS / 2;
|
|
188
|
+
|
|
189
|
+
const hasComputedAllData =
|
|
190
|
+
// has all sampled columns
|
|
191
|
+
sampledColumns.length === this.sampledColumns.length;
|
|
192
|
+
|
|
193
|
+
if (!hasAllData) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (hasComputedAllData) {
|
|
198
|
+
this.columnsDataPromise.resolve(sampledColumns);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (this.state.hasPayload) {
|
|
202
|
+
// Complete state
|
|
203
|
+
this.state = {
|
|
204
|
+
hasPayload: true,
|
|
205
|
+
hasAllData: true,
|
|
206
|
+
hasComputedAllData: hasComputedAllData || this.state.hasComputedAllData,
|
|
207
|
+
payloadEnvelope: this.state.payloadEnvelope,
|
|
208
|
+
payloadEnvelopeSource: this.state.payloadEnvelopeSource,
|
|
209
|
+
timeCompleteSec: seenTimestampSec,
|
|
210
|
+
};
|
|
211
|
+
this.payloadEnvelopeDataPromise.resolve(this.state.payloadEnvelope);
|
|
212
|
+
} else {
|
|
213
|
+
// No payload yet, all data ready
|
|
214
|
+
this.state = {
|
|
215
|
+
hasPayload: false,
|
|
216
|
+
hasAllData: true,
|
|
217
|
+
hasComputedAllData: hasComputedAllData || this.state.hasComputedAllData,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
getVersionedHashes(): VersionedHashes {
|
|
223
|
+
return this.versionedHashes;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
hasPayloadEnvelope(): boolean {
|
|
227
|
+
return this.state.hasPayload;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
getPayloadEnvelope(): gloas.SignedExecutionPayloadEnvelope {
|
|
231
|
+
if (!this.state.hasPayload) throw new Error("Payload envelope not set");
|
|
232
|
+
return this.state.payloadEnvelope;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
getPayloadEnvelopeSource(): SourceMeta {
|
|
236
|
+
if (!this.state.hasPayload) throw new Error("Payload envelope source not set");
|
|
237
|
+
return this.state.payloadEnvelopeSource;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
getSampledColumns(): gloas.DataColumnSidecars {
|
|
241
|
+
const columns: gloas.DataColumnSidecars = [];
|
|
242
|
+
for (const index of this.sampledColumns) {
|
|
243
|
+
const column = this.columnsCache.get(index);
|
|
244
|
+
if (column) {
|
|
245
|
+
columns.push(column.columnSidecar);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return columns;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
getSampledColumnsWithSource(): ColumnWithSource[] {
|
|
252
|
+
const columns: ColumnWithSource[] = [];
|
|
253
|
+
for (const index of this.sampledColumns) {
|
|
254
|
+
const column = this.columnsCache.get(index);
|
|
255
|
+
if (column) {
|
|
256
|
+
columns.push(column);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return columns;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
getCustodyColumns(): gloas.DataColumnSidecars {
|
|
263
|
+
const columns: gloas.DataColumnSidecars = [];
|
|
264
|
+
for (const index of this.custodyColumns) {
|
|
265
|
+
const column = this.columnsCache.get(index);
|
|
266
|
+
if (column) {
|
|
267
|
+
columns.push(column.columnSidecar);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return columns;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
hasComputedAllData(): boolean {
|
|
274
|
+
return this.state.hasComputedAllData;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<DataColumnSidecars> {
|
|
278
|
+
if (this.state.hasComputedAllData) {
|
|
279
|
+
return Promise.resolve(this.getSampledColumns());
|
|
280
|
+
}
|
|
281
|
+
return withTimeout(() => this.columnsDataPromise.promise, timeout, signal);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
getTimeCreated(): number {
|
|
285
|
+
return this.timeCreatedSec;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
getTimeComplete(): number {
|
|
289
|
+
if (!this.state.hasPayload || !this.state.hasAllData) throw new Error("Not yet complete");
|
|
290
|
+
return this.state.timeCompleteSec;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
isComplete(): boolean {
|
|
294
|
+
return this.state.hasPayload && this.state.hasAllData;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async waitForData(): Promise<gloas.SignedExecutionPayloadEnvelope> {
|
|
298
|
+
return this.payloadEnvelopeDataPromise.promise;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
getSerializedCacheKeys(): object[] {
|
|
302
|
+
const objects: object[] = [];
|
|
303
|
+
|
|
304
|
+
if (this.state.hasPayload) {
|
|
305
|
+
objects.push(this.state.payloadEnvelope);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
for (const {columnSidecar} of this.columnsCache.values()) {
|
|
309
|
+
objects.push(columnSidecar);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return objects;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
getLogMeta(): {
|
|
316
|
+
slot: number;
|
|
317
|
+
blockRoot: string;
|
|
318
|
+
hasPayload: boolean;
|
|
319
|
+
hasAllData: boolean;
|
|
320
|
+
hasComputedAllData: boolean;
|
|
321
|
+
isComplete: boolean;
|
|
322
|
+
columnsCount: number;
|
|
323
|
+
sampledColumnsCount: number;
|
|
324
|
+
} {
|
|
325
|
+
return {
|
|
326
|
+
slot: this.slot,
|
|
327
|
+
blockRoot: this.blockRootHex,
|
|
328
|
+
hasPayload: this.state.hasPayload,
|
|
329
|
+
hasAllData: this.state.hasAllData,
|
|
330
|
+
hasComputedAllData: this.state.hasComputedAllData,
|
|
331
|
+
isComplete: this.isComplete(),
|
|
332
|
+
columnsCount: this.columnsCache.size,
|
|
333
|
+
sampledColumnsCount: this.sampledColumns.length,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {ForkPostGloas} from "@lodestar/params";
|
|
2
|
+
import {ColumnIndex, RootHex, SignedBeaconBlock, gloas} from "@lodestar/types";
|
|
3
|
+
|
|
4
|
+
export enum PayloadEnvelopeInputSource {
|
|
5
|
+
gossip = "gossip",
|
|
6
|
+
api = "api",
|
|
7
|
+
engine = "engine",
|
|
8
|
+
byRange = "req_resp_by_range",
|
|
9
|
+
byRoot = "req_resp_by_root",
|
|
10
|
+
recovery = "recovery",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type SourceMeta = {
|
|
14
|
+
source: PayloadEnvelopeInputSource;
|
|
15
|
+
seenTimestampSec: number;
|
|
16
|
+
peerIdStr?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type ColumnWithSource = SourceMeta & {
|
|
20
|
+
columnSidecar: gloas.DataColumnSidecar;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type CreateFromBlockProps = {
|
|
24
|
+
blockRootHex: RootHex;
|
|
25
|
+
block: SignedBeaconBlock<ForkPostGloas>;
|
|
26
|
+
sampledColumns: ColumnIndex[];
|
|
27
|
+
custodyColumns: ColumnIndex[];
|
|
28
|
+
timeCreatedSec: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type AddPayloadEnvelopeProps = SourceMeta & {
|
|
32
|
+
envelope: gloas.SignedExecutionPayloadEnvelope;
|
|
33
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {Metrics} from "../../metrics/metrics.js";
|
|
2
|
+
import {JobItemQueue} from "../../util/queue/index.js";
|
|
3
|
+
import type {BeaconChain} from "../chain.js";
|
|
4
|
+
import {PayloadEnvelopeInput} from "../seenCache/seenPayloadEnvelopeInput.js";
|
|
5
|
+
import {importExecutionPayload} from "./importExecutionPayload.js";
|
|
6
|
+
import {ImportPayloadOpts} from "./types.js";
|
|
7
|
+
|
|
8
|
+
// TODO GLOAS: Set to be equal to DEFAULT_MAX_PENDING_UNFINALIZED_PAYLOAD_ENVELOPE_WRITES for now
|
|
9
|
+
const QUEUE_MAX_LENGTH = 16;
|
|
10
|
+
|
|
11
|
+
enum PayloadEnvelopeImportStatus {
|
|
12
|
+
queued = "queued",
|
|
13
|
+
importing = "importing",
|
|
14
|
+
imported = "imported",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* PayloadEnvelopeProcessor processes payload envelope jobs in a queued fashion, one after the other.
|
|
19
|
+
*/
|
|
20
|
+
export class PayloadEnvelopeProcessor {
|
|
21
|
+
readonly jobQueue: JobItemQueue<[PayloadEnvelopeInput, ImportPayloadOpts], void>;
|
|
22
|
+
private readonly importStatus = new WeakMap<PayloadEnvelopeInput, PayloadEnvelopeImportStatus>();
|
|
23
|
+
|
|
24
|
+
constructor(chain: BeaconChain, metrics: Metrics | null, signal: AbortSignal) {
|
|
25
|
+
this.jobQueue = new JobItemQueue<[PayloadEnvelopeInput, ImportPayloadOpts], void>(
|
|
26
|
+
(payloadInput, opts) => {
|
|
27
|
+
this.importStatus.set(payloadInput, PayloadEnvelopeImportStatus.importing);
|
|
28
|
+
return importExecutionPayload.call(chain, payloadInput, opts);
|
|
29
|
+
},
|
|
30
|
+
{maxLength: QUEUE_MAX_LENGTH, noYieldIfOneItem: true, signal},
|
|
31
|
+
metrics?.payloadEnvelopeProcessorQueue ?? undefined
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async processPayloadEnvelopeJob(payloadInput: PayloadEnvelopeInput, opts: ImportPayloadOpts = {}): Promise<void> {
|
|
36
|
+
if (!payloadInput.isComplete()) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (this.importStatus.get(payloadInput) !== undefined) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
await this.jobQueue.waitForSpace();
|
|
45
|
+
|
|
46
|
+
// Re-check after await, as another call may have queued this payload.
|
|
47
|
+
if (this.importStatus.get(payloadInput) !== undefined) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.importStatus.set(payloadInput, PayloadEnvelopeImportStatus.queued);
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
await this.jobQueue.push(payloadInput, opts);
|
|
55
|
+
this.importStatus.set(payloadInput, PayloadEnvelopeImportStatus.imported);
|
|
56
|
+
} catch (e) {
|
|
57
|
+
this.importStatus.delete(payloadInput);
|
|
58
|
+
throw e;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {MaybeValidExecutionStatus} from "@lodestar/fork-choice";
|
|
3
3
|
import {ForkSeq} from "@lodestar/params";
|
|
4
|
-
import {
|
|
4
|
+
import {DataAvailabilityStatus, IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
5
5
|
import type {IndexedAttestation, Slot, fulu} from "@lodestar/types";
|
|
6
6
|
import {IBlockInput} from "./blockInput/types.js";
|
|
7
7
|
|
|
@@ -41,6 +41,14 @@ export enum BlobSidecarValidation {
|
|
|
41
41
|
Full,
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
export type ImportPayloadOpts = {
|
|
45
|
+
/**
|
|
46
|
+
* Set to true if envelope signature was already verified (e.g., during gossip/API validation).
|
|
47
|
+
* When false/undefined, signature will be verified during import.
|
|
48
|
+
*/
|
|
49
|
+
validSignature?: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
44
52
|
export type ImportBlockOpts = {
|
|
45
53
|
/**
|
|
46
54
|
* TEMP: Review if this is safe, Lighthouse always imports attestations even in finalized sync.
|
|
@@ -85,7 +93,7 @@ export type ImportBlockOpts = {
|
|
|
85
93
|
*/
|
|
86
94
|
export type FullyVerifiedBlock = {
|
|
87
95
|
blockInput: IBlockInput;
|
|
88
|
-
postState:
|
|
96
|
+
postState: IBeaconStateView;
|
|
89
97
|
parentBlockSlot: Slot;
|
|
90
98
|
proposerBalanceDelta: number;
|
|
91
99
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
3
3
|
import {phase0, ssz} from "@lodestar/types";
|
|
4
4
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Compute a Checkpoint type from `state.latestBlockHeader`
|
|
8
8
|
*/
|
|
9
|
-
export function getCheckpointFromState(checkpointState:
|
|
9
|
+
export function getCheckpointFromState(checkpointState: IBeaconStateView): phase0.Checkpoint {
|
|
10
10
|
const slot = checkpointState.slot;
|
|
11
11
|
|
|
12
12
|
if (slot % SLOTS_PER_EPOCH !== 0) {
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
2
|
import {ForkName, isForkPostFulu} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
|
-
DataAvailabilityStatus,
|
|
6
|
-
computeEpochAtSlot,
|
|
7
|
-
isStateValidatorsNodesPopulated,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
3
|
+
import {DataAvailabilityStatus, IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
9
4
|
import {IndexedAttestation, deneb} from "@lodestar/types";
|
|
10
5
|
import type {BeaconChain} from "../chain.js";
|
|
11
6
|
import {BlockError, BlockErrorCode} from "../errors/index.js";
|
|
@@ -39,7 +34,7 @@ export async function verifyBlocksInEpoch(
|
|
|
39
34
|
blockInputs: IBlockInput[],
|
|
40
35
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
41
36
|
): Promise<{
|
|
42
|
-
postStates:
|
|
37
|
+
postStates: IBeaconStateView[];
|
|
43
38
|
proposerBalanceDeltas: number[];
|
|
44
39
|
segmentExecStatus: SegmentExecStatus;
|
|
45
40
|
dataAvailabilityStatuses: DataAvailabilityStatus[];
|
|
@@ -78,10 +73,10 @@ export async function verifyBlocksInEpoch(
|
|
|
78
73
|
// otherwise it may fail to get indexed attestations from shuffling cache later
|
|
79
74
|
this.shufflingCache.processState(preState0);
|
|
80
75
|
|
|
81
|
-
if (!isStateValidatorsNodesPopulated(
|
|
76
|
+
if (!preState0.isStateValidatorsNodesPopulated()) {
|
|
82
77
|
this.logger.verbose("verifyBlocksInEpoch preState0 SSZ cache stats", {
|
|
83
78
|
slot: preState0.slot,
|
|
84
|
-
cache: isStateValidatorsNodesPopulated(
|
|
79
|
+
cache: preState0.isStateValidatorsNodesPopulated(),
|
|
85
80
|
clonedCount: preState0.clonedCount,
|
|
86
81
|
clonedCountWithTransferCache: preState0.clonedCountWithTransferCache,
|
|
87
82
|
createdWithTransferCache: preState0.createdWithTransferCache,
|
|
@@ -110,7 +105,7 @@ export async function verifyBlocksInEpoch(
|
|
|
110
105
|
for (const [i, block] of blocks.entries()) {
|
|
111
106
|
indexedAttestationsByBlock[i] = block.message.body.attestations.map((attestation) => {
|
|
112
107
|
const attEpoch = computeEpochAtSlot(attestation.data.slot);
|
|
113
|
-
const decisionRoot = preState0.
|
|
108
|
+
const decisionRoot = preState0.getShufflingDecisionRoot(attEpoch);
|
|
114
109
|
return this.shufflingCache.getIndexedAttestation(attEpoch, decisionRoot, fork, attestation);
|
|
115
110
|
});
|
|
116
111
|
}
|
|
@@ -8,12 +8,7 @@ import {
|
|
|
8
8
|
ProtoBlock,
|
|
9
9
|
} from "@lodestar/fork-choice";
|
|
10
10
|
import {ForkSeq} from "@lodestar/params";
|
|
11
|
-
import {
|
|
12
|
-
CachedBeaconStateAllForks,
|
|
13
|
-
isExecutionBlockBodyType,
|
|
14
|
-
isExecutionEnabled,
|
|
15
|
-
isExecutionStateType,
|
|
16
|
-
} from "@lodestar/state-transition";
|
|
11
|
+
import {IBeaconStateView, isExecutionBlockBodyType} from "@lodestar/state-transition";
|
|
17
12
|
import {bellatrix, electra} from "@lodestar/types";
|
|
18
13
|
import {ErrorAborted, Logger, toRootHex} from "@lodestar/utils";
|
|
19
14
|
import {ExecutionPayloadStatus, IExecutionEngine} from "../../execution/engine/interface.js";
|
|
@@ -63,7 +58,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
63
58
|
chain: VerifyBlockExecutionPayloadModules,
|
|
64
59
|
parentBlock: ProtoBlock,
|
|
65
60
|
blockInputs: IBlockInput[],
|
|
66
|
-
preState0:
|
|
61
|
+
preState0: IBeaconStateView,
|
|
67
62
|
signal: AbortSignal,
|
|
68
63
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
69
64
|
): Promise<SegmentExecStatus> {
|
|
@@ -146,7 +141,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
146
141
|
export async function verifyBlockExecutionPayload(
|
|
147
142
|
chain: VerifyBlockExecutionPayloadModules,
|
|
148
143
|
blockInput: IBlockInput,
|
|
149
|
-
preState0:
|
|
144
|
+
preState0: IBeaconStateView
|
|
150
145
|
): Promise<VerifyBlockExecutionResponse> {
|
|
151
146
|
const block = blockInput.getBlock();
|
|
152
147
|
|
|
@@ -157,9 +152,9 @@ export async function verifyBlockExecutionPayload(
|
|
|
157
152
|
|
|
158
153
|
/** Not null if execution is enabled */
|
|
159
154
|
const executionPayloadEnabled =
|
|
160
|
-
isExecutionStateType
|
|
155
|
+
preState0.isExecutionStateType &&
|
|
161
156
|
isExecutionBlockBodyType(block.message.body) &&
|
|
162
|
-
isExecutionEnabled(
|
|
157
|
+
preState0.isExecutionEnabled(block.message)
|
|
163
158
|
? block.message.body.executionPayload
|
|
164
159
|
: null;
|
|
165
160
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, getBlockSignatureSets} from "@lodestar/state-transition";
|
|
3
3
|
import {IndexedAttestation, SignedBeaconBlock} from "@lodestar/types";
|
|
4
4
|
import {Logger} from "@lodestar/utils";
|
|
5
5
|
import {Metrics} from "../../metrics/metrics.js";
|
|
@@ -20,14 +20,14 @@ export async function verifyBlocksSignatures(
|
|
|
20
20
|
bls: IBlsVerifier,
|
|
21
21
|
logger: Logger,
|
|
22
22
|
metrics: Metrics | null,
|
|
23
|
-
preState0:
|
|
23
|
+
preState0: IBeaconStateView,
|
|
24
24
|
blocks: SignedBeaconBlock[],
|
|
25
25
|
indexedAttestationsByBlock: IndexedAttestation[][],
|
|
26
26
|
opts: ImportBlockOpts
|
|
27
27
|
): Promise<{verifySignaturesTime: number}> {
|
|
28
28
|
const isValidPromises: Promise<boolean>[] = [];
|
|
29
29
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
30
|
-
const currentSyncCommitteeIndexed = preState0.
|
|
30
|
+
const currentSyncCommitteeIndexed = preState0.currentSyncCommitteeIndexed;
|
|
31
31
|
|
|
32
32
|
// Verifies signatures after running state transition, so all SyncCommittee signed roots are known at this point.
|
|
33
33
|
// We must ensure block.slot <= state.slot before running getAllBlockSignatureSets().
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CachedBeaconStateAllForks,
|
|
3
2
|
DataAvailabilityStatus,
|
|
4
3
|
ExecutionPayloadStatus,
|
|
4
|
+
IBeaconStateView,
|
|
5
5
|
StateHashTreeRootSource,
|
|
6
|
-
stateTransition,
|
|
7
6
|
} from "@lodestar/state-transition";
|
|
8
7
|
import {ErrorAborted, Logger, byteArrayEquals} from "@lodestar/utils";
|
|
9
8
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -23,7 +22,7 @@ import {ImportBlockOpts} from "./types.js";
|
|
|
23
22
|
* - Check state root matches
|
|
24
23
|
*/
|
|
25
24
|
export async function verifyBlocksStateTransitionOnly(
|
|
26
|
-
preState0:
|
|
25
|
+
preState0: IBeaconStateView,
|
|
27
26
|
blocks: IBlockInput[],
|
|
28
27
|
dataAvailabilityStatuses: DataAvailabilityStatus[],
|
|
29
28
|
logger: Logger,
|
|
@@ -31,8 +30,8 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
31
30
|
validatorMonitor: ValidatorMonitor | null,
|
|
32
31
|
signal: AbortSignal,
|
|
33
32
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
34
|
-
): Promise<{postStates:
|
|
35
|
-
const postStates:
|
|
33
|
+
): Promise<{postStates: IBeaconStateView[]; proposerBalanceDeltas: number[]; verifyStateTime: number}> {
|
|
34
|
+
const postStates: IBeaconStateView[] = [];
|
|
36
35
|
const proposerBalanceDeltas: number[] = [];
|
|
37
36
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
38
37
|
|
|
@@ -45,8 +44,7 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
45
44
|
// STFN - per_slot_processing() + per_block_processing()
|
|
46
45
|
// NOTE: `regen.getPreState()` should have dialed forward the state already caching checkpoint states
|
|
47
46
|
const useBlsBatchVerify = !opts?.disableBlsBatchVerify;
|
|
48
|
-
const postState = stateTransition(
|
|
49
|
-
preState,
|
|
47
|
+
const postState = preState.stateTransition(
|
|
50
48
|
block,
|
|
51
49
|
{
|
|
52
50
|
// NOTE: Assume valid for now while sending payload to execution engine in parallel
|
|
@@ -84,7 +82,7 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
84
82
|
|
|
85
83
|
// For metric block profitability
|
|
86
84
|
const proposerIndex = block.message.proposerIndex;
|
|
87
|
-
proposerBalanceDeltas[i] = postState.
|
|
85
|
+
proposerBalanceDeltas[i] = postState.getBalance(proposerIndex) - preState.getBalance(proposerIndex);
|
|
88
86
|
|
|
89
87
|
// If blocks are invalid in execution the main promise could resolve before this loop ends.
|
|
90
88
|
// In that case stop processing blocks and return early.
|