@lodestar/beacon-node 2.1.0-dev.475f7d67bc → 2.1.0-dev.4b0199a2eb
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 +1 -3
- 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 +8 -0
- 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 +3 -2
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +1 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/config/constants.d.ts +0 -1
- package/lib/api/impl/config/constants.d.ts.map +1 -1
- package/lib/api/impl/config/constants.js +1 -3
- package/lib/api/impl/config/constants.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +0 -3
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/errors.d.ts +7 -0
- package/lib/api/impl/errors.d.ts.map +1 -1
- package/lib/api/impl/errors.js +9 -0
- package/lib/api/impl/errors.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +4 -94
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/rest/base.d.ts.map +1 -1
- package/lib/api/rest/base.js +6 -3
- package/lib/api/rest/base.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +3 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +3 -1
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +3 -0
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +3 -1
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +14 -5
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +7 -56
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.d.ts +0 -4
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +0 -5
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/chain.d.ts +3 -3
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +30 -10
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +7 -0
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +1 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +0 -15
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +0 -3
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/index.d.ts +0 -1
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +0 -1
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +11 -2
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +180 -13
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.d.ts +1 -2
- package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.js +0 -3
- package/lib/chain/forkChoiceExecutionEngine.js.map +1 -1
- package/lib/chain/interface.d.ts +3 -3
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/index.d.ts +0 -1
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +0 -1
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +9 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +22 -16
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -3
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -3
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +3 -33
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +0 -1
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +0 -1
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/seenCache/index.d.ts +1 -0
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +1 -0
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.d.ts +3 -0
- package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.js +6 -2
- package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
- package/lib/chain/seenCache/seenDataColumnSidecars.d.ts +17 -0
- package/lib/chain/seenCache/seenDataColumnSidecars.d.ts.map +1 -0
- package/lib/chain/seenCache/seenDataColumnSidecars.js +61 -0
- package/lib/chain/seenCache/seenDataColumnSidecars.js.map +1 -0
- package/lib/chain/seenCache/seenGossipBlockInput.js +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +11 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +28 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +4 -2
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +20 -7
- package/lib/chain/validation/block.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 +1 -34
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/index.d.ts +0 -1
- package/lib/chain/validation/index.d.ts.map +1 -1
- package/lib/chain/validation/index.js +0 -1
- package/lib/chain/validation/index.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +5 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +2 -2
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/execution/builder/validateBid.d.ts.map +1 -1
- package/lib/execution/builder/validateBid.js +1 -14
- package/lib/execution/builder/validateBid.js.map +1 -1
- package/lib/execution/engine/disabled.d.ts +0 -1
- package/lib/execution/engine/disabled.d.ts.map +1 -1
- package/lib/execution/engine/disabled.js +0 -3
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +2 -8
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +4 -27
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +2 -13
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -3
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +9 -33
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +0 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +3 -25
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +1 -4
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js +2 -16
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +1 -2
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +0 -3
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/transport.d.ts +2 -3
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +0 -24
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +0 -12
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +0 -16
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +0 -35
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +0 -9
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +0 -20
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +1 -3
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +1 -3
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/forks.d.ts +2 -2
- package/lib/network/forks.d.ts.map +1 -1
- package/lib/network/forks.js +3 -3
- package/lib/network/forks.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +2 -8
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +0 -1
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/scoringParameters.js +19 -14
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +17 -29
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +1 -13
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +1 -2
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +2 -8
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +16 -45
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts +0 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +0 -1
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/discover.d.ts +1 -0
- package/lib/network/peers/discover.d.ts.map +1 -1
- package/lib/network/peers/discover.js +44 -48
- package/lib/network/peers/discover.js.map +1 -1
- package/lib/network/peers/score/store.d.ts.map +1 -1
- package/lib/network/peers/score/store.js +1 -2
- package/lib/network/peers/score/store.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +85 -57
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +0 -6
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +1 -5
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +0 -1
- 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 +0 -6
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +3 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +0 -5
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +0 -1
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +0 -5
- 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 +0 -4
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +2 -5
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +0 -3
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +1 -0
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +5 -1
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +14 -1
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +6 -0
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +17 -8
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +1 -1
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.d.ts.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.js +6 -1
- package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
- package/lib/util/dataColumns.d.ts +2 -1
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +7 -2
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +2 -1
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +7 -2
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +6 -4
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +18 -21
- package/src/api/impl/beacon/blocks/index.ts +1 -5
- package/src/api/impl/beacon/pool/index.ts +11 -0
- package/src/api/impl/beacon/state/index.ts +3 -7
- package/src/api/impl/beacon/state/utils.ts +1 -1
- package/src/api/impl/config/constants.ts +0 -4
- package/src/api/impl/debug/index.ts +0 -4
- package/src/api/impl/errors.ts +10 -0
- package/src/api/impl/validator/index.ts +2 -123
- package/src/api/rest/base.ts +9 -3
- package/src/chain/ColumnReconstructionTracker.ts +5 -1
- package/src/chain/GetBlobsTracker.ts +5 -0
- package/src/chain/blocks/importBlock.ts +14 -7
- package/src/chain/blocks/importExecutionPayload.ts +7 -74
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +8 -1
- package/src/chain/blocks/types.ts +0 -5
- package/src/chain/chain.ts +34 -9
- package/src/chain/errors/dataColumnSidecarError.ts +8 -0
- package/src/chain/errors/executionPayloadBid.ts +0 -18
- package/src/chain/errors/index.ts +0 -1
- package/src/chain/forkChoice/index.ts +233 -13
- package/src/chain/forkChoiceExecutionEngine.ts +1 -5
- package/src/chain/interface.ts +2 -2
- package/src/chain/opPools/index.ts +0 -1
- package/src/chain/opPools/opPool.ts +27 -16
- package/src/chain/options.ts +1 -3
- package/src/chain/produceBlock/produceBlockBody.ts +12 -66
- package/src/chain/regen/interface.ts +0 -1
- package/src/chain/seenCache/index.ts +1 -0
- package/src/chain/seenCache/seenBlockProposers.ts +12 -2
- package/src/chain/seenCache/seenDataColumnSidecars.ts +69 -0
- package/src/chain/seenCache/seenGossipBlockInput.ts +1 -1
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +28 -2
- package/src/chain/validation/attestation.ts +4 -2
- package/src/chain/validation/block.ts +19 -7
- package/src/chain/validation/dataColumnSidecar.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +2 -49
- package/src/chain/validation/index.ts +0 -1
- package/src/chain/validation/proposerSlashing.ts +5 -1
- package/src/chain/validation/voluntaryExit.ts +2 -2
- package/src/execution/builder/validateBid.ts +2 -23
- package/src/execution/engine/disabled.ts +0 -4
- package/src/execution/engine/http.ts +5 -40
- package/src/execution/engine/interface.ts +2 -24
- package/src/execution/engine/jsonRpcTransport.ts +9 -46
- package/src/execution/engine/mock.ts +3 -26
- package/src/execution/engine/payloadIdCache.ts +4 -25
- package/src/execution/engine/restTransport.ts +1 -15
- package/src/execution/engine/transport.ts +2 -5
- package/src/execution/engine/types.ts +0 -35
- package/src/index.ts +1 -0
- package/src/metrics/metrics/beacon.ts +0 -37
- package/src/metrics/metrics/lodestar.ts +0 -21
- package/src/network/core/networkCore.ts +1 -3
- package/src/network/forks.ts +7 -3
- package/src/network/gossip/interface.ts +0 -5
- package/src/network/gossip/scoringParameters.ts +23 -14
- package/src/network/gossip/topic.ts +0 -14
- package/src/network/interface.ts +0 -2
- package/src/network/network.ts +20 -55
- package/src/network/options.ts +0 -2
- package/src/network/peers/discover.ts +42 -52
- package/src/network/peers/score/store.ts +1 -2
- package/src/network/processor/gossipHandlers.ts +147 -76
- package/src/network/processor/gossipQueues/index.ts +0 -6
- package/src/network/processor/gossipValidatorFn.ts +0 -5
- package/src/network/processor/index.ts +0 -1
- package/src/network/reqresp/ReqRespBeaconNode.ts +0 -7
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -1
- package/src/network/reqresp/handlers/index.ts +0 -5
- package/src/network/reqresp/protocols.ts +0 -6
- package/src/network/reqresp/rateLimit.ts +0 -4
- package/src/network/reqresp/types.ts +0 -6
- package/src/sync/range/chain.ts +1 -0
- package/src/sync/range/range.ts +7 -1
- package/src/sync/unknownBlock.ts +20 -1
- package/src/sync/utils/downloadByRange.ts +30 -7
- package/src/sync/utils/downloadByRoot.ts +12 -9
- package/src/sync/utils/pendingBlocksTree.ts +6 -1
- package/src/util/dataColumns.ts +13 -1
- package/src/util/execution.ts +16 -1
- package/src/util/sszBytes.ts +7 -8
- package/lib/chain/errors/inclusionList.d.ts +0 -60
- package/lib/chain/errors/inclusionList.d.ts.map +0 -1
- package/lib/chain/errors/inclusionList.js +0 -19
- package/lib/chain/errors/inclusionList.js.map +0 -1
- package/lib/chain/opPools/inclusionListStore.d.ts +0 -66
- package/lib/chain/opPools/inclusionListStore.d.ts.map +0 -1
- package/lib/chain/opPools/inclusionListStore.js +0 -174
- package/lib/chain/opPools/inclusionListStore.js.map +0 -1
- package/lib/chain/validation/inclusionList.d.ts +0 -14
- package/lib/chain/validation/inclusionList.d.ts.map +0 -1
- package/lib/chain/validation/inclusionList.js +0 -150
- package/lib/chain/validation/inclusionList.js.map +0 -1
- package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts +0 -10
- package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/inclusionListsByIndices.js +0 -30
- package/lib/network/reqresp/handlers/inclusionListsByIndices.js.map +0 -1
- package/src/chain/errors/inclusionList.ts +0 -38
- package/src/chain/opPools/inclusionListStore.ts +0 -211
- package/src/chain/validation/inclusionList.ts +0 -192
- package/src/network/reqresp/handlers/inclusionListsByIndices.ts +0 -44
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
LVHVerdictResult,
|
|
8
8
|
} from "@lodestar/fork-choice";
|
|
9
9
|
import {ForkName, ForkPostFulu} from "@lodestar/params";
|
|
10
|
-
import {RootHex
|
|
10
|
+
import {RootHex} from "@lodestar/types";
|
|
11
11
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
12
12
|
import {LogDataBasic, Logger} from "@lodestar/utils";
|
|
13
13
|
import {ExecutionPayloadBodyV2} from "../execution/engine/types.js";
|
|
@@ -109,10 +109,6 @@ export class ForkChoiceExecutionEngine {
|
|
|
109
109
|
return this.engine.getPayload(...args);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
getInclusionList(): Promise<bellatrix.Transactions> {
|
|
113
|
-
return this.engine.getInclusionList();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
112
|
getPayloadBodiesByHashV2(blockHashes: DATA[]): Promise<(ExecutionPayloadBodyV2 | null)[]> {
|
|
117
113
|
return this.engine.getPayloadBodiesByHashV2(blockHashes);
|
|
118
114
|
}
|
package/src/chain/interface.ts
CHANGED
|
@@ -50,7 +50,6 @@ import {
|
|
|
50
50
|
AttestationPool,
|
|
51
51
|
DeferredVoluntaryExitPool,
|
|
52
52
|
ExecutionPayloadBidPool,
|
|
53
|
-
InclusionListStore,
|
|
54
53
|
OpPool,
|
|
55
54
|
PayloadAttestationPool,
|
|
56
55
|
ProposerPreferencesPool,
|
|
@@ -68,6 +67,7 @@ import {
|
|
|
68
67
|
SeenAttesters,
|
|
69
68
|
SeenBlockProposers,
|
|
70
69
|
SeenContributionAndProof,
|
|
70
|
+
SeenDataColumnSidecars,
|
|
71
71
|
SeenExecutionPayloadBids,
|
|
72
72
|
SeenPayloadAttesters,
|
|
73
73
|
SeenSyncCommitteeMessages,
|
|
@@ -136,7 +136,6 @@ export interface IBeaconChain {
|
|
|
136
136
|
readonly executionPayloadBidPool: ExecutionPayloadBidPool;
|
|
137
137
|
readonly payloadAttestationPool: PayloadAttestationPool;
|
|
138
138
|
readonly proposerPreferencesPool: ProposerPreferencesPool;
|
|
139
|
-
readonly inclusionListStore: InclusionListStore;
|
|
140
139
|
readonly opPool: OpPool;
|
|
141
140
|
readonly deferredVoluntaryExitPool: DeferredVoluntaryExitPool;
|
|
142
141
|
|
|
@@ -147,6 +146,7 @@ export interface IBeaconChain {
|
|
|
147
146
|
readonly seenAggregatedAttestations: SeenAggregatedAttestations;
|
|
148
147
|
readonly seenExecutionPayloadBids: SeenExecutionPayloadBids;
|
|
149
148
|
readonly seenBlockProposers: SeenBlockProposers;
|
|
149
|
+
readonly seenDataColumnSidecars: SeenDataColumnSidecars;
|
|
150
150
|
readonly seenSyncCommitteeMessages: SeenSyncCommitteeMessages;
|
|
151
151
|
readonly seenContributionAndProof: SeenContributionAndProof;
|
|
152
152
|
readonly seenAttestationDatas: SeenAttestationDatas;
|
|
@@ -2,7 +2,6 @@ export {AggregatedAttestationPool} from "./aggregatedAttestationPool.js";
|
|
|
2
2
|
export {AttestationPool} from "./attestationPool.js";
|
|
3
3
|
export {DeferredVoluntaryExitPool} from "./deferredVoluntaryExitPool.js";
|
|
4
4
|
export {ExecutionPayloadBidPool, type PooledExecutionPayloadBid} from "./executionPayloadBidPool.js";
|
|
5
|
-
export {InclusionListInsertOutcome, InclusionListStore} from "./inclusionListStore.js";
|
|
6
5
|
export {OpPool} from "./opPool.js";
|
|
7
6
|
export {PayloadAttestationPool} from "./payloadAttestationPool.js";
|
|
8
7
|
export {ProposerPreferencesPool} from "./proposerPreferencesPool.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {
|
|
3
3
|
BLS_WITHDRAWAL_PREFIX,
|
|
4
|
+
FAR_FUTURE_EPOCH,
|
|
4
5
|
ForkName,
|
|
5
6
|
ForkSeq,
|
|
6
7
|
MAX_ATTESTER_SLASHINGS,
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
getAttesterSlashableIndices,
|
|
18
19
|
getAttesterSlashingSignatureSets,
|
|
19
20
|
getProposerSlashingSignatureSets,
|
|
21
|
+
getValidatorFromStateBytes,
|
|
20
22
|
} from "@lodestar/state-transition";
|
|
21
23
|
import {
|
|
22
24
|
AttesterSlashing,
|
|
@@ -389,12 +391,19 @@ export class OpPool {
|
|
|
389
391
|
}
|
|
390
392
|
|
|
391
393
|
/**
|
|
392
|
-
* Prune all types of transactions given the latest head state
|
|
394
|
+
* Prune all types of transactions given the latest head state and the finalized checkpoint state.
|
|
395
|
+
* `finalizedState` is only needed to prune voluntary exits, and may be null when there are none.
|
|
393
396
|
*/
|
|
394
|
-
pruneAll(
|
|
397
|
+
pruneAll(
|
|
398
|
+
headBlock: SignedBeaconBlock,
|
|
399
|
+
headState: IBeaconStateView,
|
|
400
|
+
finalizedState: IBeaconStateView | Uint8Array | null
|
|
401
|
+
): void {
|
|
395
402
|
this.pruneAttesterSlashings(headState);
|
|
396
403
|
this.pruneProposerSlashings(headState);
|
|
397
|
-
|
|
404
|
+
if (finalizedState !== null) {
|
|
405
|
+
this.pruneVoluntaryExits(finalizedState);
|
|
406
|
+
}
|
|
398
407
|
this.pruneBlsToExecutionChanges(headBlock, headState);
|
|
399
408
|
}
|
|
400
409
|
|
|
@@ -438,21 +447,23 @@ export class OpPool {
|
|
|
438
447
|
|
|
439
448
|
/**
|
|
440
449
|
* Call after finalizing
|
|
441
|
-
* Prune if validator has already exited
|
|
450
|
+
* Prune if validator has already exited in the finalized state, so an exit included only in a block that is later
|
|
451
|
+
* orphaned stays in the pool. The finalized state may be serialized bytes if it is not in memory.
|
|
452
|
+
*
|
|
453
|
+
* Exits are not pruned by fork: from Deneb the signature domain is fixed to Capella (EIP-7044), so a fork transition
|
|
454
|
+
* cannot invalidate an exit verified at a Deneb+ state. Exits verified with a pre-Capella domain before crossing into
|
|
455
|
+
* Deneb are not handled, as only chains that cross the Deneb fork are affected.
|
|
442
456
|
*/
|
|
443
|
-
private pruneVoluntaryExits(
|
|
444
|
-
const headStateFork = this.config.getForkSeq(headState.slot);
|
|
445
|
-
const finalizedEpoch = headState.finalizedCheckpoint.epoch;
|
|
446
|
-
|
|
457
|
+
private pruneVoluntaryExits(finalizedState: IBeaconStateView | Uint8Array): void {
|
|
447
458
|
for (const [key, voluntaryExit] of this.voluntaryExits.entries()) {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (
|
|
459
|
+
const {validatorIndex} = voluntaryExit.message;
|
|
460
|
+
const finalizedValidator =
|
|
461
|
+
finalizedState instanceof Uint8Array
|
|
462
|
+
? getValidatorFromStateBytes(this.config, finalizedState, validatorIndex)
|
|
463
|
+
: validatorIndex < finalizedState.validatorCount
|
|
464
|
+
? finalizedState.getValidator(validatorIndex)
|
|
465
|
+
: null;
|
|
466
|
+
if (finalizedValidator !== null && finalizedValidator.exitEpoch !== FAR_FUTURE_EPOCH) {
|
|
456
467
|
this.voluntaryExits.delete(key);
|
|
457
468
|
}
|
|
458
469
|
}
|
package/src/chain/options.ts
CHANGED
|
@@ -110,7 +110,6 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
110
110
|
proposerBoost: true,
|
|
111
111
|
proposerBoostReorg: true,
|
|
112
112
|
dedupePayloads: true,
|
|
113
|
-
computeUnrealized: true,
|
|
114
113
|
fastConfirmation: false,
|
|
115
114
|
suggestedFeeRecipient: defaultValidatorOptions.suggestedFeeRecipient,
|
|
116
115
|
graffitiAppend: true,
|
|
@@ -124,8 +123,6 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
124
123
|
maxSkipSlots: 32,
|
|
125
124
|
disableProposerSlashings: false,
|
|
126
125
|
// should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
|
|
127
|
-
// batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
|
|
128
|
-
// since this batch attestation work is designed to work with useWorker=true, make this the lowest value
|
|
129
126
|
minSameMessageSignatureSetsToBatch: 2,
|
|
130
127
|
// as of Feb 2025, this option turned out to be very useful:
|
|
131
128
|
// - it allows to share a persisted checkpoint state to other nodes
|
|
@@ -133,6 +130,7 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
133
130
|
// - it helps debug easier when network is unfinalized
|
|
134
131
|
nHistoricalStatesFileDataStore: true,
|
|
135
132
|
nativeStateTransition: true,
|
|
133
|
+
nativeForkChoice: false,
|
|
136
134
|
maxBlockStates: DEFAULT_MAX_BLOCK_STATES,
|
|
137
135
|
maxCPStateEpochsInMemory: DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY,
|
|
138
136
|
maxCPStateEpochsOnDisk: DEFAULT_MAX_CP_STATE_ON_DISK,
|
|
@@ -56,7 +56,6 @@ import {
|
|
|
56
56
|
electra,
|
|
57
57
|
fulu,
|
|
58
58
|
gloas,
|
|
59
|
-
heze,
|
|
60
59
|
ssz,
|
|
61
60
|
} from "@lodestar/types";
|
|
62
61
|
import {
|
|
@@ -81,7 +80,7 @@ import {BeaconProposerCache} from "../beaconProposerCache.js";
|
|
|
81
80
|
import type {BeaconChain} from "../chain.js";
|
|
82
81
|
import {ForkChoiceExecutionEngine} from "../forkChoiceExecutionEngine.js";
|
|
83
82
|
import {CommonBlockBody} from "../interface.js";
|
|
84
|
-
import {
|
|
83
|
+
import {ProposerPreferencesPool} from "../opPools/index.js";
|
|
85
84
|
import {validateBlobsAndKzgCommitments, validateCellsAndKzgCommitments} from "./validateBlobsAndKzgCommitments.js";
|
|
86
85
|
|
|
87
86
|
// Time to provide the EL to generate a payload from new payload id
|
|
@@ -372,21 +371,6 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
372
371
|
blobKzgCommitments: blobsBundle.commitments,
|
|
373
372
|
executionRequestsRoot: ssz.gloas.ExecutionRequests.hashTreeRoot(executionRequests as gloas.ExecutionRequests),
|
|
374
373
|
};
|
|
375
|
-
if (ForkSeq[fork] >= ForkSeq.heze) {
|
|
376
|
-
// Built from the full view (only_timely=False), a superset of the receiver's timely-only
|
|
377
|
-
// is_inclusion_list_bits_inclusive check
|
|
378
|
-
const inclusionListSlot = blockSlot - 1;
|
|
379
|
-
(bid as heze.ExecutionPayloadBid).inclusionListBits = this.inclusionListStore.getInclusionListBits(
|
|
380
|
-
inclusionListSlot,
|
|
381
|
-
getShufflingDependentRoot(
|
|
382
|
-
this.forkChoice,
|
|
383
|
-
computeEpochAtSlot(inclusionListSlot),
|
|
384
|
-
computeEpochAtSlot(parentBlock.slot),
|
|
385
|
-
parentBlock
|
|
386
|
-
),
|
|
387
|
-
false
|
|
388
|
-
);
|
|
389
|
-
}
|
|
390
374
|
const signedBid: gloas.SignedExecutionPayloadBid = {
|
|
391
375
|
message: bid,
|
|
392
376
|
signature: G2_POINT_AT_INFINITY,
|
|
@@ -719,7 +703,6 @@ export async function prepareExecutionPayload(
|
|
|
719
703
|
config: ChainForkConfig;
|
|
720
704
|
forkChoice: IForkChoice;
|
|
721
705
|
proposerPreferencesPool: ProposerPreferencesPool;
|
|
722
|
-
inclusionListStore: InclusionListStore;
|
|
723
706
|
},
|
|
724
707
|
logger: Logger,
|
|
725
708
|
fork: ForkPostBellatrix,
|
|
@@ -739,25 +722,11 @@ export async function prepareExecutionPayload(
|
|
|
739
722
|
const timestamp = computeTimeAtSlot(chain.config, state.slot, state.genesisTime);
|
|
740
723
|
const prevRandao = state.getRandaoMix(state.epoch);
|
|
741
724
|
|
|
742
|
-
// Post-heze the inclusion lists are part of the cache key, so a list set that changed since the
|
|
743
|
-
// payload was prepared triggers a new forkchoiceUpdated instead of reusing a payload built without them
|
|
744
|
-
let attributes = payloadAttributes;
|
|
745
|
-
if (attributes === undefined && ForkSeq[fork] >= ForkSeq.heze) {
|
|
746
|
-
attributes = preparePayloadAttributes(fork, chain, {
|
|
747
|
-
prepareState: state,
|
|
748
|
-
prepareSlot: state.slot,
|
|
749
|
-
parentBlockRoot,
|
|
750
|
-
parentBlockHash,
|
|
751
|
-
feeRecipient: suggestedFeeRecipient,
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
|
|
755
725
|
const payloadIdCached = chain.executionEngine.payloadIdCache.get({
|
|
756
726
|
headBlockHash: toRootHex(parentBlockHash),
|
|
757
727
|
timestamp: numToQuantity(timestamp),
|
|
758
728
|
prevRandao: toHex(prevRandao),
|
|
759
729
|
suggestedFeeRecipient,
|
|
760
|
-
inclusionListTransactions: attributes?.inclusionListTransactions,
|
|
761
730
|
});
|
|
762
731
|
|
|
763
732
|
// prepareExecutionPayload will throw error via notifyForkchoiceUpdate if
|
|
@@ -779,20 +748,23 @@ export async function prepareExecutionPayload(
|
|
|
779
748
|
prepType = PayloadPreparationType.Fresh;
|
|
780
749
|
}
|
|
781
750
|
|
|
751
|
+
const attributes: PayloadAttributes =
|
|
752
|
+
payloadAttributes ??
|
|
753
|
+
preparePayloadAttributes(fork, chain, {
|
|
754
|
+
prepareState: state,
|
|
755
|
+
prepareSlot: state.slot,
|
|
756
|
+
parentBlockRoot,
|
|
757
|
+
parentBlockHash,
|
|
758
|
+
feeRecipient: suggestedFeeRecipient,
|
|
759
|
+
});
|
|
760
|
+
|
|
782
761
|
payloadId = await chain.executionEngine.notifyForkchoiceUpdate(
|
|
783
762
|
fork,
|
|
784
763
|
toRootHex(parentBlockRoot),
|
|
785
764
|
toRootHex(parentBlockHash),
|
|
786
765
|
safeBlockHash,
|
|
787
766
|
finalizedBlockHash,
|
|
788
|
-
attributes
|
|
789
|
-
preparePayloadAttributes(fork, chain, {
|
|
790
|
-
prepareState: state,
|
|
791
|
-
prepareSlot: state.slot,
|
|
792
|
-
parentBlockRoot,
|
|
793
|
-
parentBlockHash,
|
|
794
|
-
feeRecipient: suggestedFeeRecipient,
|
|
795
|
-
})
|
|
767
|
+
attributes
|
|
796
768
|
);
|
|
797
769
|
preparedAtMs = performance.now();
|
|
798
770
|
logger.verbose("Prepared payload id from execution engine", {payloadId});
|
|
@@ -854,7 +826,6 @@ export function getPayloadAttributesForSSE(
|
|
|
854
826
|
config: ChainForkConfig;
|
|
855
827
|
forkChoice: IForkChoice;
|
|
856
828
|
proposerPreferencesPool: ProposerPreferencesPool;
|
|
857
|
-
inclusionListStore: InclusionListStore;
|
|
858
829
|
},
|
|
859
830
|
{
|
|
860
831
|
prepareState,
|
|
@@ -911,7 +882,6 @@ function preparePayloadAttributes(
|
|
|
911
882
|
config: ChainForkConfig;
|
|
912
883
|
forkChoice: IForkChoice;
|
|
913
884
|
proposerPreferencesPool: ProposerPreferencesPool;
|
|
914
|
-
inclusionListStore: InclusionListStore;
|
|
915
885
|
},
|
|
916
886
|
{
|
|
917
887
|
prepareState,
|
|
@@ -979,30 +949,6 @@ function preparePayloadAttributes(
|
|
|
979
949
|
);
|
|
980
950
|
}
|
|
981
951
|
|
|
982
|
-
if (ForkSeq[fork] >= ForkSeq.heze) {
|
|
983
|
-
// Built from the full view including untimely lists (only_timely=False in prepare_execution_payload),
|
|
984
|
-
// a superset of the timely-only set every validator enforces
|
|
985
|
-
const parentBlockRootHex = toRootHex(parentBlockRoot);
|
|
986
|
-
const parentBlock = chain.forkChoice.getBlockHexAndBlockHash(parentBlockRootHex, toRootHex(parentBlockHash));
|
|
987
|
-
if (parentBlock === null) {
|
|
988
|
-
throw new Error(
|
|
989
|
-
`Parent block not in fork choice for Heze payload attributes parentBlockRoot=${parentBlockRootHex} parentBlockHash=${toRootHex(parentBlockHash)}`
|
|
990
|
-
);
|
|
991
|
-
}
|
|
992
|
-
const inclusionListSlot = prepareSlot - 1;
|
|
993
|
-
(payloadAttributes as heze.SSEPayloadAttributes["payloadAttributes"]).inclusionListTransactions =
|
|
994
|
-
chain.inclusionListStore.getInclusionListTransactions(
|
|
995
|
-
inclusionListSlot,
|
|
996
|
-
getShufflingDependentRoot(
|
|
997
|
-
chain.forkChoice,
|
|
998
|
-
computeEpochAtSlot(inclusionListSlot),
|
|
999
|
-
computeEpochAtSlot(parentBlock.slot),
|
|
1000
|
-
parentBlock
|
|
1001
|
-
),
|
|
1002
|
-
false
|
|
1003
|
-
);
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
952
|
return payloadAttributes;
|
|
1007
953
|
}
|
|
1008
954
|
|
|
@@ -24,7 +24,6 @@ export enum RegenCaller {
|
|
|
24
24
|
validateApiVoluntaryExit = "validateApiVoluntaryExit",
|
|
25
25
|
publishDeferredVoluntaryExits = "publishDeferredVoluntaryExits",
|
|
26
26
|
validateGossipExecutionPayloadBid = "validateGossipExecutionPayloadBid",
|
|
27
|
-
validateGossipInclusionList = "validateGossipInclusionList",
|
|
28
27
|
validateGossipPayloadAttestationMessage = "validateGossipPayloadAttestationMessage",
|
|
29
28
|
validateGossipProposerPreferences = "validateGossipProposerPreferences",
|
|
30
29
|
onForkChoiceFinalized = "onForkChoiceFinalized",
|
|
@@ -2,6 +2,7 @@ export {SeenAggregators, SeenAttesters, SeenPayloadAttesters} from "./seenAttest
|
|
|
2
2
|
export {SeenBlockProposers} from "./seenBlockProposers.js";
|
|
3
3
|
export {SeenSyncCommitteeMessages} from "./seenCommittee.js";
|
|
4
4
|
export {SeenContributionAndProof} from "./seenCommitteeContribution.js";
|
|
5
|
+
export {SeenDataColumnSidecars} from "./seenDataColumnSidecars.js";
|
|
5
6
|
export {SeenExecutionPayloadBids} from "./seenExecutionPayloadBids.js";
|
|
6
7
|
export {SeenBlockInput} from "./seenGossipBlockInput.js";
|
|
7
8
|
export {PayloadEnvelopeInput, SeenPayloadEnvelopeInput} from "./seenPayloadEnvelopeInput.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
2
2
|
import {Epoch, RootHex, Slot, ValidatorIndex, phase0} from "@lodestar/types";
|
|
3
|
-
import {MapDef} from "@lodestar/utils";
|
|
3
|
+
import {MapDef, byteArrayEquals} from "@lodestar/utils";
|
|
4
4
|
|
|
5
5
|
/** Two distinct block roots signed by the same proposer for the same slot are sufficient to establish an equivocation */
|
|
6
|
-
const MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL = 2;
|
|
6
|
+
export const MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL = 2;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Keeps a cache to filter block proposals from the same validator in the same slot.
|
|
@@ -44,6 +44,16 @@ export class SeenBlockProposers {
|
|
|
44
44
|
return this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.has(blockRoot) === true;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
hasBlockSignature(
|
|
48
|
+
blockSlot: Slot,
|
|
49
|
+
proposerIndex: ValidatorIndex,
|
|
50
|
+
blockRoot: RootHex,
|
|
51
|
+
signature: Uint8Array
|
|
52
|
+
): boolean {
|
|
53
|
+
const signedBlockHeader = this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.get(blockRoot);
|
|
54
|
+
return signedBlockHeader !== undefined && byteArrayEquals(signedBlockHeader.signature, signature);
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
isEquivocating(blockSlot: Slot, proposerIndex: ValidatorIndex): boolean {
|
|
48
58
|
return (
|
|
49
59
|
(this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.size ?? 0) >=
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {ColumnIndex, RootHex, Slot, ValidatorIndex} from "@lodestar/types";
|
|
2
|
+
import {MapDef} from "@lodestar/utils";
|
|
3
|
+
import {MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL} from "./seenBlockProposers.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Tracks the column indices of valid gossip data column sidecars per slot, proposer and block root,
|
|
7
|
+
* to ignore sidecars of a repeated proposal. Sidecars are accepted for at most two block roots per slot and
|
|
8
|
+
* proposer, same as blocks. Pruned on finalization.
|
|
9
|
+
*/
|
|
10
|
+
export class SeenDataColumnSidecars {
|
|
11
|
+
private readonly columnIndicesBySlot = new MapDef<Slot, MapDef<ValidatorIndex, MapDef<RootHex, Set<ColumnIndex>>>>(
|
|
12
|
+
() => new MapDef(() => new MapDef(() => new Set()))
|
|
13
|
+
);
|
|
14
|
+
private readonly evidenceChecksBySlot = new MapDef<Slot, Set<ValidatorIndex>>(() => new Set());
|
|
15
|
+
private finalizedSlot: Slot = 0;
|
|
16
|
+
|
|
17
|
+
isRepeatProposal(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): boolean {
|
|
18
|
+
const columnIndicesByRoot = this.columnIndicesBySlot.get(slot)?.get(proposerIndex);
|
|
19
|
+
if (columnIndicesByRoot === undefined) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (!columnIndicesByRoot.has(blockRoot) && columnIndicesByRoot.size >= MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
for (const [root, columnIndices] of columnIndicesByRoot) {
|
|
26
|
+
if (root !== blockRoot && columnIndices.has(columnIndex)) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
isKnown(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): boolean {
|
|
34
|
+
return this.columnIndicesBySlot.get(slot)?.get(proposerIndex)?.get(blockRoot)?.has(columnIndex) === true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
add(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): void {
|
|
38
|
+
if (slot < this.finalizedSlot || this.isRepeatProposal(slot, proposerIndex, columnIndex, blockRoot)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.columnIndicesBySlot.getOrDefault(slot).getOrDefault(proposerIndex).getOrDefault(blockRoot).add(columnIndex);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
markEvidenceCheck(slot: Slot, proposerIndex: ValidatorIndex): boolean {
|
|
45
|
+
if (slot < this.finalizedSlot) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const proposers = this.evidenceChecksBySlot.getOrDefault(slot);
|
|
49
|
+
if (proposers.has(proposerIndex)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
proposers.add(proposerIndex);
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
prune(finalizedSlot: Slot): void {
|
|
57
|
+
this.finalizedSlot = finalizedSlot;
|
|
58
|
+
for (const slot of this.columnIndicesBySlot.keys()) {
|
|
59
|
+
if (slot < finalizedSlot) {
|
|
60
|
+
this.columnIndicesBySlot.delete(slot);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
for (const slot of this.evidenceChecksBySlot.keys()) {
|
|
64
|
+
if (slot < finalizedSlot) {
|
|
65
|
+
this.evidenceChecksBySlot.delete(slot);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -378,7 +378,7 @@ export class SeenBlockInput {
|
|
|
378
378
|
for (const [, blockInput] of sorted) {
|
|
379
379
|
this.evictBlockInput(blockInput);
|
|
380
380
|
itemsToDelete--;
|
|
381
|
-
if (itemsToDelete <= 0)
|
|
381
|
+
if (itemsToDelete <= 0) break;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
pruneSetToMax(this.verifiedProposerSignatures, MAX_BLOCK_INPUT_CACHE_SIZE);
|
|
@@ -64,6 +64,7 @@ export class SeenPayloadEnvelopeInput {
|
|
|
64
64
|
private readonly metrics: Metrics | null;
|
|
65
65
|
private readonly logger?: Logger;
|
|
66
66
|
private payloadInputs = new Map<RootHex, PayloadEnvelopeInput>();
|
|
67
|
+
private readonly unvalidatedRoots = new Set<RootHex>();
|
|
67
68
|
// Dedup concurrent DB reloads of the same root so callers share one reconstructed object.
|
|
68
69
|
private readonly reloading = new Map<RootHex, Promise<PayloadEnvelopeInput | undefined>>();
|
|
69
70
|
|
|
@@ -127,9 +128,17 @@ export class SeenPayloadEnvelopeInput {
|
|
|
127
128
|
});
|
|
128
129
|
};
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Set `unvalidated` for a block of which only the proposer signature is verified, e.g. one retained for unknown
|
|
133
|
+
* parent sync. Such entries are evicted first when the cache is over its max size, until the block passes gossip
|
|
134
|
+
* validation or is imported. Adding an existing entry without `unvalidated` promotes it without replacing it.
|
|
135
|
+
*/
|
|
136
|
+
add(props: Omit<CreateFromBlockProps, "daOutOfRange">, opts?: {unvalidated?: boolean}): PayloadEnvelopeInput {
|
|
131
137
|
const existing = this.payloadInputs.get(props.blockRootHex);
|
|
132
138
|
if (existing !== undefined) {
|
|
139
|
+
if (!opts?.unvalidated) {
|
|
140
|
+
this.unvalidatedRoots.delete(props.blockRootHex);
|
|
141
|
+
}
|
|
133
142
|
this.logger?.verbose("SeenPayloadEnvelopeInput.add reused existing entry", {
|
|
134
143
|
slot: existing.slot,
|
|
135
144
|
root: props.blockRootHex,
|
|
@@ -139,6 +148,9 @@ export class SeenPayloadEnvelopeInput {
|
|
|
139
148
|
const daOutOfRange = isDaOutOfRange(this.config, props.forkName, props.block.message.slot, this.clock.currentEpoch);
|
|
140
149
|
const input = PayloadEnvelopeInput.createFromBlock({...props, daOutOfRange});
|
|
141
150
|
this.payloadInputs.set(props.blockRootHex, input);
|
|
151
|
+
if (opts?.unvalidated) {
|
|
152
|
+
this.unvalidatedRoots.add(props.blockRootHex);
|
|
153
|
+
}
|
|
142
154
|
this.metrics?.seenCache.payloadEnvelopeInput.created.inc({source: props.source});
|
|
143
155
|
this.logger?.verbose("SeenPayloadEnvelopeInput.add created new entry", {
|
|
144
156
|
slot: input.slot,
|
|
@@ -300,12 +312,25 @@ export class SeenPayloadEnvelopeInput {
|
|
|
300
312
|
|
|
301
313
|
/**
|
|
302
314
|
* Bound this cache to have at most MAX_PAYLOAD_ENVELOPE_INPUT_CACHE_SIZE items.
|
|
303
|
-
* Evicts
|
|
315
|
+
* Evicts entries of unvalidated blocks that are not imported yet first, then the rest by insertion order so a
|
|
316
|
+
* just-reloaded old-slot entry is not evicted right after.
|
|
304
317
|
* On unstable network, we may need to query an evicted item, UnknownBlockInput will recover
|
|
305
318
|
* it from db via getOrReload() api. Runs after every single insert, so it evicts ~1 per call.
|
|
306
319
|
*/
|
|
307
320
|
private pruneToMaxSize(): void {
|
|
308
321
|
let evicted = 0;
|
|
322
|
+
for (const blockRootHex of this.unvalidatedRoots) {
|
|
323
|
+
if (this.payloadInputs.size <= MAX_PAYLOAD_ENVELOPE_INPUT_CACHE_SIZE) {
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
const input = this.payloadInputs.get(blockRootHex);
|
|
327
|
+
if (input === undefined || this.forkChoice.hasBlockHex(blockRootHex)) {
|
|
328
|
+
this.unvalidatedRoots.delete(blockRootHex);
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
this.evictPayloadInput(input, "capUnvalidated");
|
|
332
|
+
evicted++;
|
|
333
|
+
}
|
|
309
334
|
for (const input of this.payloadInputs.values()) {
|
|
310
335
|
if (this.payloadInputs.size <= MAX_PAYLOAD_ENVELOPE_INPUT_CACHE_SIZE) {
|
|
311
336
|
break;
|
|
@@ -331,5 +356,6 @@ export class SeenPayloadEnvelopeInput {
|
|
|
331
356
|
});
|
|
332
357
|
this.serializedCache.delete(payloadInput.getSerializedCacheKeys());
|
|
333
358
|
this.payloadInputs.delete(payloadInput.blockRootHex);
|
|
359
|
+
this.unvalidatedRoots.delete(payloadInput.blockRootHex);
|
|
334
360
|
}
|
|
335
361
|
}
|
|
@@ -261,10 +261,12 @@ async function validateAttestationNoSignatureCheck(
|
|
|
261
261
|
const attSlot = attestationOrBytes.attSlot;
|
|
262
262
|
attDataKey = getSeenAttDataKeyFromGossipAttestation(attestationOrBytes);
|
|
263
263
|
const committeeIndexForLookup = isForkPostElectra(fork)
|
|
264
|
-
?
|
|
264
|
+
? getCommitteeIndexFromAttestationOrBytes(fork, attestationOrBytes)
|
|
265
265
|
: PRE_ELECTRA_SINGLE_ATTESTATION_COMMITTEE_INDEX;
|
|
266
266
|
const cachedAttData =
|
|
267
|
-
attDataKey !== null
|
|
267
|
+
attDataKey !== null && committeeIndexForLookup !== null
|
|
268
|
+
? chain.seenAttestationDatas.get(attSlot, committeeIndexForLookup, attDataKey)
|
|
269
|
+
: null;
|
|
268
270
|
if (cachedAttData === null) {
|
|
269
271
|
const attestation = sszDeserializeSingleAttestation(fork, attestationOrBytes.serializedData);
|
|
270
272
|
// only deserialize on the first AttestationData that's not cached
|
|
@@ -76,8 +76,17 @@ export async function validateGossipBlock(
|
|
|
76
76
|
const proposerIndex = block.proposerIndex;
|
|
77
77
|
if (chain.seenBlockProposers.isKnown(blockSlot, proposerIndex)) {
|
|
78
78
|
if (chain.seenBlockProposers.isRepeatProposal(blockSlot, proposerIndex, blockRoot)) {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
if (chain.seenBlockProposers.hasBlockRoot(blockSlot, proposerIndex, blockRoot)) {
|
|
80
|
+
// The root is known with a verified signature, e.g. from the header of a data column sidecar, and a valid
|
|
81
|
+
// BLS signature of the same message by the same proposer is unique
|
|
82
|
+
if (!chain.seenBlockProposers.hasBlockSignature(blockSlot, proposerIndex, blockRoot, signedBlock.signature)) {
|
|
83
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
84
|
+
code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID,
|
|
85
|
+
slot: blockSlot,
|
|
86
|
+
root: blockRoot,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
} else if (!chain.seenBlockProposers.isEquivocating(blockSlot, proposerIndex)) {
|
|
81
90
|
await verifyBlockProposerSignature(chain, signedBlock, blockRoot, {verifyOnMainThread: false});
|
|
82
91
|
chain.seenBlockProposers.observeBlockRoot(blockSlot, proposerIndex, blockRoot, signedBlockHeader);
|
|
83
92
|
}
|
|
@@ -98,13 +107,16 @@ export async function validateGossipBlock(
|
|
|
98
107
|
// If fork choice does *not* consider the parent to be a descendant of the finalized block,
|
|
99
108
|
// then there are two more cases:
|
|
100
109
|
//
|
|
101
|
-
// 1.
|
|
102
|
-
// parent is
|
|
103
|
-
//
|
|
110
|
+
// 1. Fork choice still holds the parent. Because it is *not* in our post-finalization DAG,
|
|
111
|
+
// the parent is either pre-finalization or conflicting with finalization, so the
|
|
112
|
+
// finalized checkpoint is not an ancestor of the block: REJECT.
|
|
104
113
|
// 2. The parent is unknown to us, we probably want to download it since it might actually
|
|
105
114
|
// descend from the finalized root.
|
|
106
|
-
//
|
|
107
|
-
//
|
|
115
|
+
// Blocks that fork choice has already pruned fall into case (2), as the `db.block` database
|
|
116
|
+
// does not keep non-descendants of the finalized block either.
|
|
117
|
+
if (chain.forkChoice.hasBlockHexUnsafe(parentRoot)) {
|
|
118
|
+
throw new BlockGossipError(GossipAction.REJECT, {code: BlockErrorCode.NOT_FINALIZED_DESCENDANT, parentRoot});
|
|
119
|
+
}
|
|
108
120
|
throw new BlockGossipError(GossipAction.IGNORE, {code: BlockErrorCode.PARENT_BLOCK_UNKNOWN, parentRoot});
|
|
109
121
|
}
|
|
110
122
|
|
|
@@ -225,7 +225,7 @@ export async function validateGossipFuluDataColumnSidecar(
|
|
|
225
225
|
|
|
226
226
|
// 12) [IGNORE] The sidecar is the first sidecar for the tuple (block_header.slot, block_header.proposer_index,
|
|
227
227
|
// sidecar.index) with valid header signature, sidecar inclusion proof, and kzg proof
|
|
228
|
-
// -- Handled in
|
|
228
|
+
// -- Handled in gossip handler with seenDataColumnSidecars
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// SPEC FUNCTION
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ProtoBlock} from "@lodestar/fork-choice";
|
|
2
|
-
import {PAYLOAD_BUILDER_VERSION
|
|
2
|
+
import {PAYLOAD_BUILDER_VERSION} from "@lodestar/params";
|
|
3
3
|
import {
|
|
4
4
|
computeEpochAtSlot,
|
|
5
5
|
createSingleSignatureSetFromComponents,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isStartSlotOfEpoch,
|
|
10
10
|
isStatePostGloas,
|
|
11
11
|
} from "@lodestar/state-transition";
|
|
12
|
-
import {RootHex, Slot, ValidatorIndex, gloas
|
|
12
|
+
import {RootHex, Slot, ValidatorIndex, gloas} from "@lodestar/types";
|
|
13
13
|
import {byteArrayEquals, toHex, toRootHex} from "@lodestar/utils";
|
|
14
14
|
import {getShufflingDependentRoot} from "../../util/dependentRoot.js";
|
|
15
15
|
import {ExecutionPayloadBidError, ExecutionPayloadBidErrorCode, GossipAction} from "../errors/index.js";
|
|
@@ -132,18 +132,6 @@ async function validateExecutionPayloadBid(
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
// [IGNORE] The bid is received after the inclusion list deadline of `bid.slot - 1`
|
|
136
|
-
if (
|
|
137
|
-
isForkPostHeze(chain.config.getForkName(bid.slot)) &&
|
|
138
|
-
chain.clock.msFromSlot(bid.slot - 1) < chain.config.getInclusionListDueMs(chain.config.getForkName(bid.slot - 1))
|
|
139
|
-
) {
|
|
140
|
-
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
141
|
-
code: ExecutionPayloadBidErrorCode.BEFORE_INCLUSION_LIST_DEADLINE,
|
|
142
|
-
builderIndex: bid.builderIndex,
|
|
143
|
-
slot: bid.slot,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
135
|
// [IGNORE] The bid is compatible with the current head branch.
|
|
148
136
|
const head = chain.forkChoice.getHead();
|
|
149
137
|
if (!isBidCompatibleWithHead(chain, head, bid.slot, bidParentBlockRoot, bidParentBlockHash)) {
|
|
@@ -209,41 +197,6 @@ async function validateExecutionPayloadBid(
|
|
|
209
197
|
});
|
|
210
198
|
}
|
|
211
199
|
|
|
212
|
-
// [IGNORE] bid.inclusionListBits is inclusive of our timely inclusion lists for
|
|
213
|
-
// (bid.slot - 1, get_shuffling_dependent_root(store, bid.parent_block_root, epoch)).
|
|
214
|
-
if (isForkPostHeze(chain.config.getForkName(bid.slot))) {
|
|
215
|
-
const {inclusionListBits} = bid as heze.ExecutionPayloadBid;
|
|
216
|
-
const inclusionListSlot = bid.slot - 1;
|
|
217
|
-
let inclusionListDependentRoot: RootHex;
|
|
218
|
-
try {
|
|
219
|
-
inclusionListDependentRoot = getShufflingDependentRoot(
|
|
220
|
-
chain.forkChoice,
|
|
221
|
-
computeEpochAtSlot(inclusionListSlot),
|
|
222
|
-
computeEpochAtSlot(parentBlock.slot),
|
|
223
|
-
parentBlock
|
|
224
|
-
);
|
|
225
|
-
} catch {
|
|
226
|
-
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
227
|
-
code: ExecutionPayloadBidErrorCode.UNKNOWN_INCLUSION_LIST_DEPENDENT_ROOT,
|
|
228
|
-
slot: bid.slot,
|
|
229
|
-
parentBlockRoot: bidParentBlockRoot,
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
if (
|
|
233
|
-
!chain.inclusionListStore.isInclusionListBitsInclusive(
|
|
234
|
-
inclusionListSlot,
|
|
235
|
-
inclusionListDependentRoot,
|
|
236
|
-
inclusionListBits
|
|
237
|
-
)
|
|
238
|
-
) {
|
|
239
|
-
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
240
|
-
code: ExecutionPayloadBidErrorCode.INCLUSION_LIST_BITS_NOT_INCLUSIVE,
|
|
241
|
-
builderIndex: bid.builderIndex,
|
|
242
|
-
slot: bid.slot,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
200
|
// [IGNORE] A `SignedProposerPreferences` matching `bid.slot` and the bid's branch has been
|
|
248
201
|
// seen — i.e. `proposal_slot == bid.slot` AND `dependent_root ==
|
|
249
202
|
// get_proposer_dependent_root(parent_state, compute_epoch_at_slot(bid.slot))`.
|