@lodestar/beacon-node 1.42.0-dev.4411584fd8 → 1.42.0-dev.47afaa6bb7
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 +60 -29
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +5 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +38 -40
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +8 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +35 -29
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -3
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +5 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +54 -24
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +50 -0
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -0
- package/lib/chain/blocks/importExecutionPayload.js +195 -0
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -0
- 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/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 +88 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +279 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +30 -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 +28 -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/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 +22 -16
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +142 -69
- 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 +10 -5
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/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 +30 -34
- 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 +21 -17
- 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 +11 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +13 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +10 -4
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +14 -10
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +7 -7
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +32 -17
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +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.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +4 -4
- 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 +15 -6
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +185 -6
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +10 -7
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +34 -19
- 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 +5 -4
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +14 -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 +60 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +126 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/interface.d.ts +7 -4
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +22 -11
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +7 -4
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +12 -3
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +7 -2
- package/lib/network/options.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +34 -4
- 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 +287 -70
- 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 +29 -2
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +258 -14
- 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 +69 -33
- package/src/api/impl/beacon/pool/index.ts +5 -1
- package/src/api/impl/beacon/state/index.ts +43 -55
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +8 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +38 -43
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -4
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +5 -4
- package/src/chain/blocks/importBlock.ts +85 -32
- package/src/chain/blocks/importExecutionPayload.ts +277 -0
- package/src/chain/blocks/index.ts +3 -2
- package/src/chain/blocks/payloadEnvelopeInput/index.ts +2 -0
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +377 -0
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +34 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +61 -0
- package/src/chain/blocks/types.ts +34 -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/blocks/writePayloadEnvelopeInputToDb.ts +55 -0
- package/src/chain/chain.ts +188 -101
- package/src/chain/emitter.ts +27 -9
- package/src/chain/errors/blockError.ts +8 -5
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
- package/src/chain/forkChoice/index.ts +35 -51
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +22 -18
- package/src/chain/lightClient/index.ts +17 -18
- package/src/chain/opPools/aggregatedAttestationPool.ts +20 -21
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +14 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +18 -16
- package/src/chain/produceBlock/produceBlockBody.ts +51 -48
- 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 +4 -4
- 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 +16 -10
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +231 -8
- package/src/chain/validation/executionPayloadBid.ts +10 -10
- package/src/chain/validation/executionPayloadEnvelope.ts +42 -26
- 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 +25 -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 +134 -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 +43 -4
- package/src/network/processor/gossipHandlers.ts +356 -80
- 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 +335 -13
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {BitArray
|
|
1
|
+
import {BitArray} from "@chainsafe/ssz";
|
|
2
2
|
import {routes} from "@lodestar/api";
|
|
3
3
|
import {ChainForkConfig} from "@lodestar/config";
|
|
4
4
|
import {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isForkPostElectra,
|
|
22
22
|
} from "@lodestar/params";
|
|
23
23
|
import {
|
|
24
|
-
|
|
24
|
+
type IBeaconStateViewAltair,
|
|
25
25
|
computeStartSlotAtEpoch,
|
|
26
26
|
computeSyncPeriodAtEpoch,
|
|
27
27
|
computeSyncPeriodAtSlot,
|
|
@@ -54,13 +54,7 @@ import {Metrics} from "../../metrics/index.js";
|
|
|
54
54
|
import {IClock} from "../../util/clock.js";
|
|
55
55
|
import {ChainEventEmitter} from "../emitter.js";
|
|
56
56
|
import {LightClientServerError, LightClientServerErrorCode} from "../errors/lightClientError.js";
|
|
57
|
-
import {
|
|
58
|
-
getBlockBodyExecutionHeaderProof,
|
|
59
|
-
getCurrentSyncCommitteeBranch,
|
|
60
|
-
getFinalizedRootProof,
|
|
61
|
-
getNextSyncCommitteeBranch,
|
|
62
|
-
getSyncCommitteesWitness,
|
|
63
|
-
} from "./proofs.js";
|
|
57
|
+
import {getBlockBodyExecutionHeaderProof, getCurrentSyncCommitteeBranch, getNextSyncCommitteeBranch} from "./proofs.js";
|
|
64
58
|
|
|
65
59
|
export type LightClientServerOpts = {
|
|
66
60
|
disableLightClientServerOnImportBlockHead?: boolean;
|
|
@@ -268,7 +262,7 @@ export class LightClientServer {
|
|
|
268
262
|
*/
|
|
269
263
|
onImportBlockHead(
|
|
270
264
|
block: BeaconBlock<ForkPostAltair>,
|
|
271
|
-
postState:
|
|
265
|
+
postState: IBeaconStateViewAltair,
|
|
272
266
|
parentBlockSlot: Slot
|
|
273
267
|
): void {
|
|
274
268
|
// TEMP: To disable this functionality for fork_choice spec tests.
|
|
@@ -278,6 +272,14 @@ export class LightClientServer {
|
|
|
278
272
|
return;
|
|
279
273
|
}
|
|
280
274
|
|
|
275
|
+
// TODO GLOAS: Light client updates for gloas are not yet updated in the spec.
|
|
276
|
+
// The block body no longer contains execution payload, so `blockToLightClientHeader`
|
|
277
|
+
// cannot construct a header from a gloas block. Skip all light client processing
|
|
278
|
+
// for post-gloas blocks, revisit once there is a spec for it.
|
|
279
|
+
if (this.config.getForkSeq(block.slot) >= ForkSeq.gloas) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
281
283
|
// What is the syncAggregate signing?
|
|
282
284
|
// From the state-transition
|
|
283
285
|
// ```
|
|
@@ -406,7 +408,7 @@ export class LightClientServer {
|
|
|
406
408
|
|
|
407
409
|
private async persistPostBlockImportData(
|
|
408
410
|
block: BeaconBlock<ForkPostAltair>,
|
|
409
|
-
postState:
|
|
411
|
+
postState: IBeaconStateViewAltair,
|
|
410
412
|
parentBlockSlot: Slot
|
|
411
413
|
): Promise<void> {
|
|
412
414
|
const blockSlot = block.slot;
|
|
@@ -416,7 +418,7 @@ export class LightClientServer {
|
|
|
416
418
|
const blockRoot = ssz.phase0.BeaconBlockHeader.hashTreeRoot(header.beacon);
|
|
417
419
|
const blockRootHex = toRootHex(blockRoot);
|
|
418
420
|
|
|
419
|
-
const syncCommitteeWitness = getSyncCommitteesWitness(
|
|
421
|
+
const syncCommitteeWitness = postState.getSyncCommitteesWitness();
|
|
420
422
|
|
|
421
423
|
// Only store current sync committee once per run
|
|
422
424
|
if (!this.storedCurrentSyncCommittee) {
|
|
@@ -466,7 +468,7 @@ export class LightClientServer {
|
|
|
466
468
|
isFinalized: true,
|
|
467
469
|
attestedHeader: header,
|
|
468
470
|
blockRoot,
|
|
469
|
-
finalityBranch: getFinalizedRootProof(
|
|
471
|
+
finalityBranch: postState.getFinalizedRootProof(),
|
|
470
472
|
finalizedCheckpoint,
|
|
471
473
|
}
|
|
472
474
|
: {
|
|
@@ -724,13 +726,10 @@ export class LightClientServer {
|
|
|
724
726
|
);
|
|
725
727
|
}
|
|
726
728
|
|
|
727
|
-
private async storeSyncCommittee(
|
|
728
|
-
syncCommittee: CompositeViewDU<typeof ssz.altair.SyncCommittee>,
|
|
729
|
-
syncCommitteeRoot: Uint8Array
|
|
730
|
-
): Promise<void> {
|
|
729
|
+
private async storeSyncCommittee(syncCommittee: altair.SyncCommittee, syncCommitteeRoot: Uint8Array): Promise<void> {
|
|
731
730
|
const isKnown = await this.db.syncCommittee.has(syncCommitteeRoot);
|
|
732
731
|
if (!isKnown) {
|
|
733
|
-
await this.db.syncCommittee.putBinary(syncCommitteeRoot,
|
|
732
|
+
await this.db.syncCommittee.putBinary(syncCommitteeRoot, ssz.altair.SyncCommittee.serialize(syncCommittee));
|
|
734
733
|
}
|
|
735
734
|
}
|
|
736
735
|
|
|
@@ -19,16 +19,15 @@ import {
|
|
|
19
19
|
isForkPostElectra,
|
|
20
20
|
} from "@lodestar/params";
|
|
21
21
|
import {
|
|
22
|
-
CachedBeaconStateAllForks,
|
|
23
|
-
CachedBeaconStateAltair,
|
|
24
|
-
CachedBeaconStateGloas,
|
|
25
22
|
EffectiveBalanceIncrements,
|
|
23
|
+
IBeaconStateView,
|
|
26
24
|
RootCache,
|
|
27
25
|
computeEpochAtSlot,
|
|
28
26
|
computeSlotsSinceEpochStart,
|
|
29
27
|
computeStartSlotAtEpoch,
|
|
30
28
|
getAttestationParticipationStatus,
|
|
31
|
-
|
|
29
|
+
isStatePostAltair,
|
|
30
|
+
isStatePostGloas,
|
|
32
31
|
} from "@lodestar/state-transition";
|
|
33
32
|
import {Attestation, Epoch, RootHex, Slot, electra, isElectraAttestation, phase0, ssz} from "@lodestar/types";
|
|
34
33
|
import {MapDef, assert, toRootHex} from "@lodestar/utils";
|
|
@@ -212,7 +211,7 @@ export class AggregatedAttestationPool {
|
|
|
212
211
|
fork: ForkName,
|
|
213
212
|
forkChoice: IForkChoice,
|
|
214
213
|
shufflingCache: ShufflingCache,
|
|
215
|
-
state:
|
|
214
|
+
state: IBeaconStateView
|
|
216
215
|
): Attestation[] {
|
|
217
216
|
const forkSeq = ForkSeq[fork];
|
|
218
217
|
if (forkSeq < ForkSeq.electra) {
|
|
@@ -229,10 +228,10 @@ export class AggregatedAttestationPool {
|
|
|
229
228
|
fork: ForkName,
|
|
230
229
|
forkChoice: IForkChoice,
|
|
231
230
|
shufflingCache: ShufflingCache,
|
|
232
|
-
state:
|
|
231
|
+
state: IBeaconStateView
|
|
233
232
|
): electra.Attestation[] {
|
|
234
233
|
const stateSlot = state.slot;
|
|
235
|
-
const stateEpoch = state.
|
|
234
|
+
const stateEpoch = state.epoch;
|
|
236
235
|
const statePrevEpoch = stateEpoch - 1;
|
|
237
236
|
const rootCache = new RootCache(state);
|
|
238
237
|
|
|
@@ -312,7 +311,7 @@ export class AggregatedAttestationPool {
|
|
|
312
311
|
// The committeeCountPerSlot can be precomputed once per slot
|
|
313
312
|
const getAttestationGroupResult = attestationGroup.getAttestationsForBlock(
|
|
314
313
|
fork,
|
|
315
|
-
state.
|
|
314
|
+
state.effectiveBalanceIncrements,
|
|
316
315
|
notSeenCommitteeMembers,
|
|
317
316
|
MAX_ATTESTATIONS_PER_GROUP_ELECTRA
|
|
318
317
|
);
|
|
@@ -362,9 +361,7 @@ export class AggregatedAttestationPool {
|
|
|
362
361
|
inclusionDistance,
|
|
363
362
|
stateEpoch,
|
|
364
363
|
rootCache,
|
|
365
|
-
|
|
366
|
-
? (state as CachedBeaconStateGloas).executionPayloadAvailability.toBoolArray()
|
|
367
|
-
: null
|
|
364
|
+
isStatePostGloas(state) ? state.executionPayloadAvailability : null
|
|
368
365
|
);
|
|
369
366
|
|
|
370
367
|
const weight =
|
|
@@ -735,27 +732,29 @@ export function aggregateConsolidation({byCommittee, attData}: AttestationsConso
|
|
|
735
732
|
}
|
|
736
733
|
|
|
737
734
|
/**
|
|
738
|
-
* Pre-compute participation from a
|
|
735
|
+
* Pre-compute participation from a IBeaconStateView, for use to check if an attestation's committee
|
|
739
736
|
* has already attested or not.
|
|
740
737
|
*/
|
|
741
738
|
export function getNotSeenValidatorsFn(
|
|
742
739
|
config: BeaconConfig,
|
|
743
740
|
shufflingCache: ShufflingCache,
|
|
744
|
-
state:
|
|
741
|
+
state: IBeaconStateView
|
|
745
742
|
): GetNotSeenValidatorsFn {
|
|
746
743
|
const stateSlot = state.slot;
|
|
747
744
|
if (config.getForkName(stateSlot) === ForkName.phase0) {
|
|
748
745
|
throw new Error("getNotSeenValidatorsFn is not supported phase0 state");
|
|
749
746
|
}
|
|
747
|
+
if (!isStatePostAltair(state)) {
|
|
748
|
+
throw new Error("Expected Altair state for participation tracking");
|
|
749
|
+
}
|
|
750
750
|
|
|
751
751
|
// altair and future forks
|
|
752
752
|
// Get attestations to be included in an altair block.
|
|
753
753
|
// Attestations are sorted by inclusion distance then number of attesters.
|
|
754
754
|
// Attestations should pass the validation when processing attestations in state-transition.
|
|
755
755
|
// check for altair block already
|
|
756
|
-
const
|
|
757
|
-
const
|
|
758
|
-
const currentParticipation = altairState.currentEpochParticipation.getAll();
|
|
756
|
+
const previousParticipation = state.previousEpochParticipation;
|
|
757
|
+
const currentParticipation = state.currentEpochParticipation;
|
|
759
758
|
const stateEpoch = computeEpochAtSlot(stateSlot);
|
|
760
759
|
// this function could be called multiple times with same slot + committeeIndex
|
|
761
760
|
const cachedNotSeenValidators = new Map<string, Set<number>>();
|
|
@@ -774,7 +773,7 @@ export function getNotSeenValidatorsFn(
|
|
|
774
773
|
return notSeenCommitteeMembers.size === 0 ? null : notSeenCommitteeMembers;
|
|
775
774
|
}
|
|
776
775
|
|
|
777
|
-
const decisionRoot = state.
|
|
776
|
+
const decisionRoot = state.getShufflingDecisionRoot(computeEpochAtSlot(slot));
|
|
778
777
|
const committee = shufflingCache.getBeaconCommittee(epoch, decisionRoot, slot, committeeIndex);
|
|
779
778
|
notSeenCommitteeMembers = new Set<number>();
|
|
780
779
|
for (const [i, validatorIndex] of committee.entries()) {
|
|
@@ -804,11 +803,11 @@ export function getNotSeenValidatorsFn(
|
|
|
804
803
|
*/
|
|
805
804
|
export function getValidateAttestationDataFn(
|
|
806
805
|
forkChoice: IForkChoice,
|
|
807
|
-
state:
|
|
806
|
+
state: IBeaconStateView
|
|
808
807
|
): ValidateAttestationDataFn {
|
|
809
808
|
const cachedValidatedAttestationData = new Map<string, InvalidAttestationData | null>();
|
|
810
809
|
const {previousJustifiedCheckpoint, currentJustifiedCheckpoint} = state;
|
|
811
|
-
const stateEpoch = state.
|
|
810
|
+
const stateEpoch = state.epoch;
|
|
812
811
|
return (attData: phase0.AttestationData) => {
|
|
813
812
|
const targetEpoch = attData.target.epoch;
|
|
814
813
|
let justifiedCheckpoint: phase0.Checkpoint;
|
|
@@ -850,14 +849,14 @@ export function getValidateAttestationDataFn(
|
|
|
850
849
|
*/
|
|
851
850
|
function isValidShuffling(
|
|
852
851
|
forkChoice: IForkChoice,
|
|
853
|
-
state:
|
|
852
|
+
state: IBeaconStateView,
|
|
854
853
|
blockRootHex: RootHex,
|
|
855
854
|
targetEpoch: Epoch
|
|
856
855
|
): InvalidAttestationData | null {
|
|
857
856
|
// Otherwise the shuffling is determined by the block at the end of the target epoch
|
|
858
857
|
// minus the shuffling lookahead (usually 2). We call this the "pivot".
|
|
859
858
|
const pivotSlot = computeStartSlotAtEpoch(targetEpoch - 1) - 1;
|
|
860
|
-
const stateDependentRoot = toRootHex(getBlockRootAtSlot(
|
|
859
|
+
const stateDependentRoot = toRootHex(state.getBlockRootAtSlot(pivotSlot));
|
|
861
860
|
|
|
862
861
|
// Use fork choice's view of the block DAG to quickly evaluate whether the attestation's
|
|
863
862
|
// pivot block is the same as the current state's pivot block. If it is, then the
|
|
@@ -59,13 +59,13 @@ export class ExecutionPayloadBidPool {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* Return the highest-value bid matching slot, parent block
|
|
62
|
+
* Return the highest-value bid matching slot, parent block hash, and parent block root.
|
|
63
63
|
* Used for gossip validation and block production.
|
|
64
64
|
*/
|
|
65
65
|
getBestBid(
|
|
66
|
-
|
|
66
|
+
slot: Slot,
|
|
67
67
|
parentBlockHash: BlockHashHex,
|
|
68
|
-
|
|
68
|
+
parentBlockRoot: BlockRootHex
|
|
69
69
|
): gloas.ExecutionPayloadBid | null {
|
|
70
70
|
const bidByParentHash = this.bidByParentHashByParentRootBySlot.get(slot)?.get(parentBlockRoot);
|
|
71
71
|
return bidByParentHash?.get(parentBlockHash) ?? null;
|
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
MAX_VOLUNTARY_EXITS,
|
|
12
12
|
} from "@lodestar/params";
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
IBeaconStateView,
|
|
15
15
|
computeEpochAtSlot,
|
|
16
16
|
computeStartSlotAtEpoch,
|
|
17
17
|
getAttesterSlashableIndices,
|
|
18
|
-
isValidVoluntaryExit,
|
|
19
18
|
} from "@lodestar/state-transition";
|
|
20
19
|
import {
|
|
21
20
|
AttesterSlashing,
|
|
@@ -185,7 +184,7 @@ export class OpPool {
|
|
|
185
184
|
* slashings included earlier in the block.
|
|
186
185
|
*/
|
|
187
186
|
getSlashingsAndExits(
|
|
188
|
-
state:
|
|
187
|
+
state: IBeaconStateView,
|
|
189
188
|
blockType: BlockType,
|
|
190
189
|
metrics: Metrics | null
|
|
191
190
|
): [
|
|
@@ -207,7 +206,7 @@ export class OpPool {
|
|
|
207
206
|
const endProposerSlashing = stepsMetrics?.startTimer();
|
|
208
207
|
for (const proposerSlashing of this.proposerSlashings.values()) {
|
|
209
208
|
const index = proposerSlashing.signedHeader1.message.proposerIndex;
|
|
210
|
-
const validator = state.
|
|
209
|
+
const validator = state.getValidator(index);
|
|
211
210
|
if (!validator.slashed && validator.activationEpoch <= stateEpoch && stateEpoch < validator.withdrawableEpoch) {
|
|
212
211
|
proposerSlashings.push(proposerSlashing);
|
|
213
212
|
// Set of validators to be slashed, so we don't attempt to construct invalid attester slashings.
|
|
@@ -234,7 +233,7 @@ export class OpPool {
|
|
|
234
233
|
continue attesterSlashing;
|
|
235
234
|
}
|
|
236
235
|
|
|
237
|
-
const validator = state.
|
|
236
|
+
const validator = state.getValidator(index);
|
|
238
237
|
if (isSlashableAtEpoch(validator, stateEpoch)) {
|
|
239
238
|
slashableIndices.add(index);
|
|
240
239
|
}
|
|
@@ -261,7 +260,7 @@ export class OpPool {
|
|
|
261
260
|
for (const voluntaryExit of this.voluntaryExits.values()) {
|
|
262
261
|
if (
|
|
263
262
|
!toBeSlashedIndices.has(voluntaryExit.message.validatorIndex) &&
|
|
264
|
-
isValidVoluntaryExit(
|
|
263
|
+
state.isValidVoluntaryExit(voluntaryExit, false) &&
|
|
265
264
|
// Signature validation is skipped in `isValidVoluntaryExit(,,false)` since it was already validated in gossip
|
|
266
265
|
// However we must make sure that the signature fork is the same, or it will become invalid if included through
|
|
267
266
|
// a future fork.
|
|
@@ -320,7 +319,7 @@ export class OpPool {
|
|
|
320
319
|
/**
|
|
321
320
|
* Prune all types of transactions given the latest head state
|
|
322
321
|
*/
|
|
323
|
-
pruneAll(headBlock: SignedBeaconBlock, headState:
|
|
322
|
+
pruneAll(headBlock: SignedBeaconBlock, headState: IBeaconStateView): void {
|
|
324
323
|
this.pruneAttesterSlashings(headState);
|
|
325
324
|
this.pruneProposerSlashings(headState);
|
|
326
325
|
this.pruneVoluntaryExits(headState);
|
|
@@ -330,7 +329,7 @@ export class OpPool {
|
|
|
330
329
|
/**
|
|
331
330
|
* Prune attester slashings for all slashed or withdrawn validators.
|
|
332
331
|
*/
|
|
333
|
-
private pruneAttesterSlashings(headState:
|
|
332
|
+
private pruneAttesterSlashings(headState: IBeaconStateView): void {
|
|
334
333
|
const finalizedEpoch = headState.finalizedCheckpoint.epoch;
|
|
335
334
|
attesterSlashing: for (const [key, attesterSlashing] of this.attesterSlashings.entries()) {
|
|
336
335
|
// Slashings that don't slash any validators can be dropped
|
|
@@ -342,7 +341,7 @@ export class OpPool {
|
|
|
342
341
|
//
|
|
343
342
|
// We cannot check the `slashed` field since the `head` is not finalized and
|
|
344
343
|
// a fork could un-slash someone.
|
|
345
|
-
if (headState.
|
|
344
|
+
if (headState.getValidator(index).exitEpoch > finalizedEpoch) {
|
|
346
345
|
continue attesterSlashing;
|
|
347
346
|
}
|
|
348
347
|
}
|
|
@@ -355,11 +354,11 @@ export class OpPool {
|
|
|
355
354
|
/**
|
|
356
355
|
* Prune proposer slashings for validators which are exited in the finalized epoch.
|
|
357
356
|
*/
|
|
358
|
-
private pruneProposerSlashings(headState:
|
|
357
|
+
private pruneProposerSlashings(headState: IBeaconStateView): void {
|
|
359
358
|
const finalizedEpoch = headState.finalizedCheckpoint.epoch;
|
|
360
359
|
for (const [key, proposerSlashing] of this.proposerSlashings.entries()) {
|
|
361
360
|
const index = proposerSlashing.signedHeader1.message.proposerIndex;
|
|
362
|
-
if (headState.
|
|
361
|
+
if (headState.getValidator(index).exitEpoch <= finalizedEpoch) {
|
|
363
362
|
this.proposerSlashings.delete(key);
|
|
364
363
|
}
|
|
365
364
|
}
|
|
@@ -369,7 +368,7 @@ export class OpPool {
|
|
|
369
368
|
* Call after finalizing
|
|
370
369
|
* Prune if validator has already exited at or before the finalized checkpoint of the head.
|
|
371
370
|
*/
|
|
372
|
-
private pruneVoluntaryExits(headState:
|
|
371
|
+
private pruneVoluntaryExits(headState: IBeaconStateView): void {
|
|
373
372
|
const headStateFork = this.config.getForkSeq(headState.slot);
|
|
374
373
|
const finalizedEpoch = headState.finalizedCheckpoint.epoch;
|
|
375
374
|
|
|
@@ -392,7 +391,7 @@ export class OpPool {
|
|
|
392
391
|
* In the worse case where head block is reorged, the same BlsToExecutionChange message can be re-added
|
|
393
392
|
* to opPool once gossipsub seen cache TTL passes.
|
|
394
393
|
*/
|
|
395
|
-
private pruneBlsToExecutionChanges(headBlock: SignedBeaconBlock, headState:
|
|
394
|
+
private pruneBlsToExecutionChanges(headBlock: SignedBeaconBlock, headState: IBeaconStateView): void {
|
|
396
395
|
const recentBlsToExecutionChanges =
|
|
397
396
|
this.config.getForkSeq(headBlock.message.slot) >= ForkSeq.capella
|
|
398
397
|
? (headBlock as capella.SignedBeaconBlock).message.body.blsToExecutionChanges
|
|
@@ -405,7 +404,7 @@ export class OpPool {
|
|
|
405
404
|
for (const [key, blsToExecutionChange] of this.blsToExecutionChanges.entries()) {
|
|
406
405
|
const {validatorIndex} = blsToExecutionChange.data.message;
|
|
407
406
|
if (!recentBlsToExecutionChangeIndexes.has(validatorIndex)) {
|
|
408
|
-
const validator = headState.
|
|
407
|
+
const validator = headState.getValidator(validatorIndex);
|
|
409
408
|
if (validator.withdrawalCredentials[0] !== BLS_WITHDRAWAL_PREFIX) {
|
|
410
409
|
this.blsToExecutionChanges.delete(key);
|
|
411
410
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Signature} from "@chainsafe/blst";
|
|
2
2
|
import {BLS_WITHDRAWAL_PREFIX} from "@lodestar/params";
|
|
3
|
-
import {
|
|
3
|
+
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
4
4
|
import {Slot, capella} from "@lodestar/types";
|
|
5
5
|
import {AggregateFast, AggregateFastElectra} from "./attestationPool.js";
|
|
6
6
|
|
|
@@ -38,7 +38,7 @@ export function signatureFromBytesNoCheck(signature: Uint8Array): Signature {
|
|
|
38
38
|
* can become invalid for certain forks.
|
|
39
39
|
*/
|
|
40
40
|
export function isValidBlsToExecutionChangeForBlockInclusion(
|
|
41
|
-
state:
|
|
41
|
+
state: IBeaconStateView,
|
|
42
42
|
signedBLSToExecutionChange: capella.SignedBLSToExecutionChange
|
|
43
43
|
): boolean {
|
|
44
44
|
// For each condition from https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/capella/beacon-chain.md#new-process_bls_to_execution_change
|
|
@@ -48,7 +48,7 @@ export function isValidBlsToExecutionChangeForBlockInclusion(
|
|
|
48
48
|
//
|
|
49
49
|
// 2. assert validator.withdrawal_credentials[:1] == BLS_WITHDRAWAL_PREFIX:
|
|
50
50
|
// Must be checked again, since it can already be changed by now.
|
|
51
|
-
const validator = state.
|
|
51
|
+
const validator = state.getValidator(signedBLSToExecutionChange.message.validatorIndex);
|
|
52
52
|
const {withdrawalCredentials} = validator;
|
|
53
53
|
if (withdrawalCredentials[0] !== BLS_WITHDRAWAL_PREFIX) {
|
|
54
54
|
return false;
|
package/src/chain/options.ts
CHANGED
|
@@ -47,6 +47,7 @@ export type IChainOptions = BlockProcessOpts &
|
|
|
47
47
|
minSameMessageSignatureSetsToBatch: number;
|
|
48
48
|
archiveDateEpochs?: number;
|
|
49
49
|
nHistoricalStatesFileDataStore?: boolean;
|
|
50
|
+
nativeStateView?: boolean;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export type BlockProcessOpts = {
|
|
@@ -124,6 +125,7 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
124
125
|
// - users can prune the persisted checkpoint state files manually to save disc space
|
|
125
126
|
// - it helps debug easier when network is unfinalized
|
|
126
127
|
nHistoricalStatesFileDataStore: true,
|
|
128
|
+
nativeStateView: false,
|
|
127
129
|
maxBlockStates: DEFAULT_MAX_BLOCK_STATES,
|
|
128
130
|
maxCPStateEpochsInMemory: DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY,
|
|
129
131
|
maxCPStateEpochsOnDisk: DEFAULT_MAX_CP_STATE_ON_DISK,
|
|
@@ -3,12 +3,11 @@ import {ChainForkConfig} from "@lodestar/config";
|
|
|
3
3
|
import {PayloadStatus, getSafeExecutionBlockHash} from "@lodestar/fork-choice";
|
|
4
4
|
import {ForkPostBellatrix, ForkSeq, SLOTS_PER_EPOCH, isForkPostBellatrix} from "@lodestar/params";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
CachedBeaconStateExecutions,
|
|
8
|
-
CachedBeaconStateGloas,
|
|
6
|
+
IBeaconStateView,
|
|
9
7
|
StateHashTreeRootSource,
|
|
10
8
|
computeEpochAtSlot,
|
|
11
9
|
computeTimeAtSlot,
|
|
10
|
+
isStatePostBellatrix,
|
|
12
11
|
} from "@lodestar/state-transition";
|
|
13
12
|
import {Slot} from "@lodestar/types";
|
|
14
13
|
import {Logger, fromHex, isErrorAborted, sleep} from "@lodestar/utils";
|
|
@@ -121,9 +120,9 @@ export class PrepareNextSlotScheduler {
|
|
|
121
120
|
);
|
|
122
121
|
|
|
123
122
|
if (isForkPostBellatrix(fork)) {
|
|
124
|
-
const proposerIndex = prepareState.
|
|
123
|
+
const proposerIndex = prepareState.getBeaconProposer(prepareSlot);
|
|
125
124
|
const feeRecipient = this.chain.beaconProposerCache.get(proposerIndex);
|
|
126
|
-
let updatedPrepareState = prepareState
|
|
125
|
+
let updatedPrepareState = prepareState;
|
|
127
126
|
let updatedHeadRoot = headRoot;
|
|
128
127
|
|
|
129
128
|
if (feeRecipient) {
|
|
@@ -140,13 +139,13 @@ export class PrepareNextSlotScheduler {
|
|
|
140
139
|
headRoot,
|
|
141
140
|
});
|
|
142
141
|
this.metrics?.weakHeadDetected.inc();
|
|
143
|
-
updatedPrepareState =
|
|
142
|
+
updatedPrepareState = await this.chain.regen.getBlockSlotState(
|
|
144
143
|
proposerHead,
|
|
145
144
|
prepareSlot,
|
|
146
145
|
// only transfer cache if epoch transition because that's the state we will use to stateTransition() the 1st block of epoch
|
|
147
146
|
{dontTransferCache: !isEpochTransition},
|
|
148
147
|
RegenCaller.predictProposerHead
|
|
149
|
-
)
|
|
148
|
+
);
|
|
150
149
|
updatedHeadRoot = proposerHeadRoot;
|
|
151
150
|
}
|
|
152
151
|
|
|
@@ -161,6 +160,9 @@ export class PrepareNextSlotScheduler {
|
|
|
161
160
|
const preparationTime =
|
|
162
161
|
computeTimeAtSlot(this.config, prepareSlot, this.chain.genesisTime) - Date.now() / 1000;
|
|
163
162
|
this.metrics?.blockPayload.payloadAdvancePrepTime.observe(preparationTime);
|
|
163
|
+
if (!isStatePostBellatrix(updatedPrepareState)) {
|
|
164
|
+
throw new Error("Expected Bellatrix state for payload preparation");
|
|
165
|
+
}
|
|
164
166
|
|
|
165
167
|
const safeBlockHash = getSafeExecutionBlockHash(this.chain.forkChoice);
|
|
166
168
|
const finalizedBlockHash =
|
|
@@ -185,6 +187,10 @@ export class PrepareNextSlotScheduler {
|
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
189
|
|
|
190
|
+
if (!isStatePostBellatrix(updatedPrepareState)) {
|
|
191
|
+
throw new Error("Expected Bellatrix state for payload attributes");
|
|
192
|
+
}
|
|
193
|
+
|
|
188
194
|
this.computeStateHashTreeRoot(updatedPrepareState, isEpochTransition);
|
|
189
195
|
|
|
190
196
|
// If emitPayloadAttributes is true emit a SSE payloadAttributes event
|
|
@@ -239,7 +245,7 @@ export class PrepareNextSlotScheduler {
|
|
|
239
245
|
}
|
|
240
246
|
};
|
|
241
247
|
|
|
242
|
-
computeStateHashTreeRoot(state:
|
|
248
|
+
computeStateHashTreeRoot(state: IBeaconStateView, isEpochTransition: boolean): void {
|
|
243
249
|
// cache HashObjects for faster hashTreeRoot() later, especially for computeNewStateRoot() if we need to produce a block at slot 0 of epoch
|
|
244
250
|
// see https://github.com/ChainSafe/lodestar/issues/6194
|
|
245
251
|
const hashTreeRootTimer = this.metrics?.stateHashTreeRootTime.startTimer({
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CachedBeaconStateAllForks,
|
|
3
|
-
CachedBeaconStateGloas,
|
|
4
2
|
DataAvailabilityStatus,
|
|
5
3
|
ExecutionPayloadStatus,
|
|
6
4
|
G2_POINT_AT_INFINITY,
|
|
5
|
+
IBeaconStateView,
|
|
6
|
+
IBeaconStateViewGloas,
|
|
7
7
|
StateHashTreeRootSource,
|
|
8
|
-
stateTransition,
|
|
9
8
|
} from "@lodestar/state-transition";
|
|
10
|
-
import {processExecutionPayloadEnvelope} from "@lodestar/state-transition/block";
|
|
11
9
|
import {BeaconBlock, BlindedBeaconBlock, Gwei, Root, gloas} from "@lodestar/types";
|
|
12
10
|
import {ZERO_HASH} from "../../constants/index.js";
|
|
13
11
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -19,14 +17,13 @@ import {Metrics} from "../../metrics/index.js";
|
|
|
19
17
|
*/
|
|
20
18
|
export function computeNewStateRoot(
|
|
21
19
|
metrics: Metrics | null,
|
|
22
|
-
state:
|
|
20
|
+
state: IBeaconStateView,
|
|
23
21
|
block: BeaconBlock | BlindedBeaconBlock
|
|
24
|
-
): {newStateRoot: Root; proposerReward: Gwei;
|
|
22
|
+
): {newStateRoot: Root; proposerReward: Gwei; postBlockState: IBeaconStateView} {
|
|
25
23
|
// Set signature to zero to re-use stateTransition() function which requires the SignedBeaconBlock type
|
|
26
24
|
const blockEmptySig = {message: block, signature: ZERO_HASH};
|
|
27
25
|
|
|
28
|
-
const
|
|
29
|
-
state,
|
|
26
|
+
const postBlockState = state.stateTransition(
|
|
30
27
|
blockEmptySig,
|
|
31
28
|
{
|
|
32
29
|
// ExecutionPayloadStatus.valid: Assume payload valid, it has been produced by a trusted EL
|
|
@@ -45,16 +42,16 @@ export function computeNewStateRoot(
|
|
|
45
42
|
{metrics}
|
|
46
43
|
);
|
|
47
44
|
|
|
48
|
-
const {attestations, syncAggregate, slashing} =
|
|
45
|
+
const {attestations, syncAggregate, slashing} = postBlockState.proposerRewards;
|
|
49
46
|
const proposerReward = BigInt(attestations + syncAggregate + slashing);
|
|
50
47
|
|
|
51
48
|
const hashTreeRootTimer = metrics?.stateHashTreeRootTime.startTimer({
|
|
52
49
|
source: StateHashTreeRootSource.computeNewStateRoot,
|
|
53
50
|
});
|
|
54
|
-
const newStateRoot =
|
|
51
|
+
const newStateRoot = postBlockState.hashTreeRoot();
|
|
55
52
|
hashTreeRootTimer?.();
|
|
56
53
|
|
|
57
|
-
return {newStateRoot, proposerReward,
|
|
54
|
+
return {newStateRoot, proposerReward, postBlockState};
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
/**
|
|
@@ -62,9 +59,9 @@ export function computeNewStateRoot(
|
|
|
62
59
|
* Similar to `computeNewStateRoot` but for payload envelope processing.
|
|
63
60
|
*
|
|
64
61
|
*/
|
|
65
|
-
export function
|
|
62
|
+
export function computePayloadEnvelopeStateRoot(
|
|
66
63
|
metrics: Metrics | null,
|
|
67
|
-
postBlockState:
|
|
64
|
+
postBlockState: IBeaconStateViewGloas,
|
|
68
65
|
envelope: gloas.ExecutionPayloadEnvelope
|
|
69
66
|
): Root {
|
|
70
67
|
const signedEnvelope: gloas.SignedExecutionPayloadEnvelope = {
|
|
@@ -73,15 +70,20 @@ export function computeEnvelopeStateRoot(
|
|
|
73
70
|
};
|
|
74
71
|
|
|
75
72
|
const processEnvelopeTimer = metrics?.blockPayload.executionPayloadEnvelopeProcessingTime.startTimer();
|
|
76
|
-
const
|
|
73
|
+
const postPayloadState = postBlockState.processExecutionPayloadEnvelope(signedEnvelope, {
|
|
74
|
+
// Signature is zero-ed (G2_POINT_AT_INFINITY), skip verification
|
|
75
|
+
verifySignature: false,
|
|
76
|
+
// State root is being computed here, the envelope doesn't have it yet
|
|
77
|
+
verifyStateRoot: false,
|
|
78
|
+
// Preserve cache in source state, since the resulting state is not added to the state cache
|
|
77
79
|
dontTransferCache: true,
|
|
78
80
|
});
|
|
79
81
|
processEnvelopeTimer?.();
|
|
80
82
|
|
|
81
83
|
const hashTreeRootTimer = metrics?.stateHashTreeRootTime.startTimer({
|
|
82
|
-
source: StateHashTreeRootSource.
|
|
84
|
+
source: StateHashTreeRootSource.computePayloadEnvelopeStateRoot,
|
|
83
85
|
});
|
|
84
|
-
const stateRoot =
|
|
86
|
+
const stateRoot = postPayloadState.hashTreeRoot();
|
|
85
87
|
hashTreeRootTimer?.();
|
|
86
88
|
|
|
87
89
|
return stateRoot;
|