@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
|
@@ -3,7 +3,6 @@ export * from "./attestation.js";
|
|
|
3
3
|
export * from "./attesterSlashing.js";
|
|
4
4
|
export * from "./block.js";
|
|
5
5
|
export * from "./blsToExecutionChange.js";
|
|
6
|
-
export * from "./inclusionList.js";
|
|
7
6
|
export * from "./proposerSlashing.js";
|
|
8
7
|
export * from "./syncCommittee.js";
|
|
9
8
|
export * from "./syncCommitteeContributionAndProof.js";
|
|
@@ -36,7 +36,11 @@ async function validateProposerSlashing(
|
|
|
36
36
|
|
|
37
37
|
// [REJECT] All of the conditions within process_proposer_slashing pass validation.
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
39
|
+
const {proposerIndex} = proposerSlashing.signedHeader1.message;
|
|
40
|
+
if (proposerIndex >= state.validatorCount) {
|
|
41
|
+
throw Error(`Unknown proposer index ${proposerIndex}`);
|
|
42
|
+
}
|
|
43
|
+
const proposer = state.getValidator(proposerIndex);
|
|
40
44
|
// verifySignature = false, verified in batch below
|
|
41
45
|
assertValidProposerSlashing(chain.config, state.slot, proposerSlashing, proposer, false);
|
|
42
46
|
} catch (e) {
|
|
@@ -60,7 +60,7 @@ export async function validateApiVoluntaryExit(
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state, voluntaryExit);
|
|
63
|
+
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state.slot, voluntaryExit);
|
|
64
64
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
65
65
|
throw new VoluntaryExitError(GossipAction.REJECT, {
|
|
66
66
|
code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
|
|
@@ -150,7 +150,7 @@ async function validateVoluntaryExit(
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// [REJECT] The signature is valid
|
|
153
|
-
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state, voluntaryExit);
|
|
153
|
+
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state.slot, voluntaryExit);
|
|
154
154
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
155
155
|
throw new VoluntaryExitError(GossipAction.REJECT, {
|
|
156
156
|
code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ProtoBlock} from "@lodestar/fork-choice";
|
|
3
|
-
import {MAX_EXECUTION_PAYMENT, PAYLOAD_BUILDER_VERSION
|
|
3
|
+
import {MAX_EXECUTION_PAYMENT, PAYLOAD_BUILDER_VERSION} from "@lodestar/params";
|
|
4
4
|
import {
|
|
5
5
|
computeEpochAtSlot,
|
|
6
6
|
createSingleSignatureSetFromComponents,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isGasLimitTargetCompatible,
|
|
10
10
|
isStatePostGloas,
|
|
11
11
|
} from "@lodestar/state-transition";
|
|
12
|
-
import {RootHex, Slot, gloas
|
|
12
|
+
import {RootHex, Slot, gloas} from "@lodestar/types";
|
|
13
13
|
import {bigIntMin, byteArrayEquals, prettyGweiToEth, toHex, toRootHex} from "@lodestar/utils";
|
|
14
14
|
import {IBeaconChain} from "../../chain/index.js";
|
|
15
15
|
import {RegenCaller} from "../../chain/regen/index.js";
|
|
@@ -41,7 +41,6 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
41
41
|
}
|
|
42
42
|
): Promise<void> {
|
|
43
43
|
const bid = signedExecutionPayloadBid.message;
|
|
44
|
-
const fork = chain.config.getForkName(bid.slot);
|
|
45
44
|
const {slot, parentBlock, parentBlockHash, parentBlockRoot, entry, getParentExecutionRequests} = request;
|
|
46
45
|
|
|
47
46
|
if (bid.slot !== slot) {
|
|
@@ -77,26 +76,6 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
77
76
|
);
|
|
78
77
|
}
|
|
79
78
|
|
|
80
|
-
// Same check as bid gossip (only_timely=True), not the proposer's full view from validator.md: a list released
|
|
81
|
-
// after the deadline would void every bid, and a high bid that went stale after gossip could crowd out the rest unpaid
|
|
82
|
-
if (isForkPostHeze(fork)) {
|
|
83
|
-
const {inclusionListBits} = bid as heze.ExecutionPayloadBid;
|
|
84
|
-
const inclusionListSlot = bid.slot - 1;
|
|
85
|
-
const dependentRoot = getShufflingDependentRoot(
|
|
86
|
-
chain.forkChoice,
|
|
87
|
-
computeEpochAtSlot(inclusionListSlot),
|
|
88
|
-
computeEpochAtSlot(parentBlock.slot),
|
|
89
|
-
parentBlock
|
|
90
|
-
);
|
|
91
|
-
if (!chain.inclusionListStore.isInclusionListBitsInclusive(inclusionListSlot, dependentRoot, inclusionListBits)) {
|
|
92
|
-
const expectedBits = chain.inclusionListStore.getInclusionListBits(inclusionListSlot, dependentRoot);
|
|
93
|
-
throw Error(
|
|
94
|
-
`Bid inclusionListBits=${toHex(inclusionListBits.uint8Array)} is not inclusive of ` +
|
|
95
|
-
`timely inclusion lists expected=${toHex(expectedBits.uint8Array)}`
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
79
|
const state = await chain.regen
|
|
101
80
|
.getBlockSlotState(parentBlock, slot, {dontTransferCache: true}, RegenCaller.validateGossipExecutionPayloadBid)
|
|
102
81
|
.catch((e: Error) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Logger} from "@lodestar/logger";
|
|
2
2
|
import {ForkName, ForkPostFulu, ForkSeq, SLOTS_PER_EPOCH, isForkPostBellatrix} from "@lodestar/params";
|
|
3
|
-
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei
|
|
3
|
+
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei} from "@lodestar/types";
|
|
4
4
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
5
5
|
import {ErrorAborted, isErrorAborted} from "@lodestar/utils";
|
|
6
6
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -219,13 +219,9 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
219
219
|
executionPayload: ExecutionPayload,
|
|
220
220
|
versionedHashes?: VersionedHashes,
|
|
221
221
|
parentBlockRoot?: Root,
|
|
222
|
-
executionRequests?: ExecutionRequests
|
|
223
|
-
inclusionListTransactions?: bellatrix.Transactions
|
|
222
|
+
executionRequests?: ExecutionRequests
|
|
224
223
|
): Promise<ExecutePayloadResponse> {
|
|
225
224
|
// Validate before queueing, argument errors must not be reported as an unavailable execution client
|
|
226
|
-
if (ForkSeq[fork] >= ForkSeq.heze && inclusionListTransactions === undefined) {
|
|
227
|
-
throw Error(`inclusionListTransactions required in notifyNewPayload for fork=${fork}`);
|
|
228
|
-
}
|
|
229
225
|
if (ForkSeq[fork] >= ForkSeq.deneb) {
|
|
230
226
|
if (versionedHashes === undefined) {
|
|
231
227
|
throw Error(`versionedHashes required in notifyNewPayload for fork=${fork}`);
|
|
@@ -242,14 +238,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
242
238
|
try {
|
|
243
239
|
result = await this.enqueue(() =>
|
|
244
240
|
this.withTransport(fork, undefined, (transport) =>
|
|
245
|
-
transport.newPayload(
|
|
246
|
-
fork,
|
|
247
|
-
executionPayload,
|
|
248
|
-
versionedHashes,
|
|
249
|
-
parentBlockRoot,
|
|
250
|
-
executionRequests,
|
|
251
|
-
inclusionListTransactions
|
|
252
|
-
)
|
|
241
|
+
transport.newPayload(fork, executionPayload, versionedHashes, parentBlockRoot, executionRequests)
|
|
253
242
|
)
|
|
254
243
|
);
|
|
255
244
|
} catch (e) {
|
|
@@ -270,12 +259,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
270
259
|
|
|
271
260
|
switch (status) {
|
|
272
261
|
case ExecutionPayloadStatus.VALID:
|
|
273
|
-
return {
|
|
274
|
-
status,
|
|
275
|
-
latestValidHash: latestValidHash ?? "0x0",
|
|
276
|
-
validationError: null,
|
|
277
|
-
inclusionListSatisfied: result.inclusionListSatisfied ?? null,
|
|
278
|
-
};
|
|
262
|
+
return {status, latestValidHash: latestValidHash ?? "0x0", validationError: null};
|
|
279
263
|
|
|
280
264
|
case ExecutionPayloadStatus.INVALID:
|
|
281
265
|
// As per latest specs if latestValidHash can be null and it would mean only
|
|
@@ -365,14 +349,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
365
349
|
}
|
|
366
350
|
|
|
367
351
|
const payloadAttributesRpc = serializePayloadAttributes(payloadAttributes);
|
|
368
|
-
this.payloadIdCache.add(
|
|
369
|
-
{
|
|
370
|
-
headBlockHash,
|
|
371
|
-
...payloadAttributesRpc,
|
|
372
|
-
inclusionListTransactions: payloadAttributes.inclusionListTransactions,
|
|
373
|
-
},
|
|
374
|
-
payloadId
|
|
375
|
-
);
|
|
352
|
+
this.payloadIdCache.add({headBlockHash, ...payloadAttributesRpc}, payloadId);
|
|
376
353
|
void this.prunePayloadIdCache();
|
|
377
354
|
}
|
|
378
355
|
return result;
|
|
@@ -431,18 +408,6 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
431
408
|
return this.withTransport(undefined, "v2", (transport) => transport.getBlobsV2(versionedHashes, buffers));
|
|
432
409
|
}
|
|
433
410
|
|
|
434
|
-
/**
|
|
435
|
-
* `engine_getInclusionListV1`, JSON-RPC only as the REST engine API defines no inclusion list route.
|
|
436
|
-
* Queued so it runs after the forkchoiceUpdated of a payload imported just before, which prunes that
|
|
437
|
-
* payload's transactions from the mempool the list is built from.
|
|
438
|
-
*/
|
|
439
|
-
async getInclusionList(): Promise<bellatrix.Transactions> {
|
|
440
|
-
return this.enqueue(() => {
|
|
441
|
-
this.metrics?.engineApiRequests.inc({transport: "json-rpc"});
|
|
442
|
-
return this.jsonRpc.getInclusionList();
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
|
|
446
411
|
private enqueue<T>(job: () => Promise<T>): Promise<T> {
|
|
447
412
|
return this.queue.push(job) as Promise<T>;
|
|
448
413
|
}
|
|
@@ -8,16 +8,7 @@ import {
|
|
|
8
8
|
ForkPostFulu,
|
|
9
9
|
WITHDRAWAL_REQUEST_TYPE,
|
|
10
10
|
} from "@lodestar/params";
|
|
11
|
-
import {
|
|
12
|
-
BlobsBundle,
|
|
13
|
-
ExecutionPayload,
|
|
14
|
-
ExecutionRequests,
|
|
15
|
-
Root,
|
|
16
|
-
RootHex,
|
|
17
|
-
Wei,
|
|
18
|
-
bellatrix,
|
|
19
|
-
capella,
|
|
20
|
-
} from "@lodestar/types";
|
|
11
|
+
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei, capella} from "@lodestar/types";
|
|
21
12
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
22
13
|
import {LodestarError} from "@lodestar/utils";
|
|
23
14
|
import {PayloadId, PayloadIdCache, WithdrawalV1} from "./payloadIdCache.js";
|
|
@@ -85,8 +76,6 @@ export type ExecutePayloadResponse =
|
|
|
85
76
|
status: ExecutionPayloadStatus.VALID;
|
|
86
77
|
latestValidHash: RootHex;
|
|
87
78
|
validationError: null;
|
|
88
|
-
/** PayloadStatusV2: whether the payload satisfied the inclusion list constraints */
|
|
89
|
-
inclusionListSatisfied?: boolean | null;
|
|
90
79
|
}
|
|
91
80
|
| {status: ExecutionPayloadStatus.INVALID; latestValidHash: RootHex | null; validationError: string | null}
|
|
92
81
|
| {
|
|
@@ -102,8 +91,6 @@ export type PayloadStatusResult = {
|
|
|
102
91
|
status: ExecutionPayloadStatus;
|
|
103
92
|
latestValidHash: RootHex | null;
|
|
104
93
|
validationError: string | null;
|
|
105
|
-
/** PayloadStatusV2: whether a VALID payload satisfied the inclusion list constraints, null otherwise */
|
|
106
|
-
inclusionListSatisfied?: boolean | null;
|
|
107
94
|
};
|
|
108
95
|
|
|
109
96
|
export type ForkchoiceUpdatedResult = {
|
|
@@ -126,8 +113,6 @@ export type PayloadAttributes = {
|
|
|
126
113
|
parentBeaconBlockRoot?: Uint8Array;
|
|
127
114
|
slotNumber?: number; // EIP-7843
|
|
128
115
|
targetGasLimit?: bigint; // GLOAS (PayloadAttributesV4, execution-apis#796)
|
|
129
|
-
/** Transactions the built payload must include (PayloadAttributesV5, HEZE:EIP-7805) */
|
|
130
|
-
inclusionListTransactions?: bellatrix.Transactions;
|
|
131
116
|
};
|
|
132
117
|
|
|
133
118
|
export type VersionedHashes = Uint8Array[];
|
|
@@ -170,16 +155,9 @@ export interface IExecutionEngine {
|
|
|
170
155
|
executionPayload: ExecutionPayload,
|
|
171
156
|
versionedHashes?: VersionedHashes,
|
|
172
157
|
parentBeaconBlockRoot?: Root,
|
|
173
|
-
executionRequests?: ExecutionRequests
|
|
174
|
-
inclusionListTransactions?: bellatrix.Transactions
|
|
158
|
+
executionRequests?: ExecutionRequests
|
|
175
159
|
): Promise<ExecutePayloadResponse>;
|
|
176
160
|
|
|
177
|
-
/**
|
|
178
|
-
* Transactions the execution layer wants included in the next payload. Parameterless since
|
|
179
|
-
* execution-apis#609: the execution layer builds against its own view of the head.
|
|
180
|
-
*/
|
|
181
|
-
getInclusionList(): Promise<bellatrix.Transactions>;
|
|
182
|
-
|
|
183
161
|
/**
|
|
184
162
|
* Signal fork choice updates
|
|
185
163
|
* This function performs two actions atomically:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForkName, ForkSeq} from "@lodestar/params";
|
|
2
|
-
import {ExecutionPayload, ExecutionRequests, Root, RootHex
|
|
2
|
+
import {ExecutionPayload, ExecutionRequests, Root, RootHex} from "@lodestar/types";
|
|
3
3
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
4
4
|
import {strip0xPrefix} from "@lodestar/utils";
|
|
5
5
|
import {
|
|
@@ -22,12 +22,10 @@ import {
|
|
|
22
22
|
deserializeBlobAndProofsV2,
|
|
23
23
|
deserializeBlobAndProofsV2IntoBytes,
|
|
24
24
|
deserializeExecutionPayloadBodyV2,
|
|
25
|
-
deserializeInclusionList,
|
|
26
25
|
parseExecutionPayload,
|
|
27
26
|
serializeBeaconBlockRoot,
|
|
28
27
|
serializeExecutionPayload,
|
|
29
28
|
serializeExecutionRequests,
|
|
30
|
-
serializeInclusionList,
|
|
31
29
|
serializePayloadAttributes,
|
|
32
30
|
serializeVersionedHashes,
|
|
33
31
|
} from "./types.js";
|
|
@@ -47,7 +45,6 @@ const getPayloadOpts: ReqOpts = {routeId: "getPayload"};
|
|
|
47
45
|
const getPayloadBodiesByHashOpts: ReqOpts = {routeId: "getPayloadBodiesByHash"};
|
|
48
46
|
const getBlobsV2Opts: ReqOpts = {routeId: "getBlobsV2"};
|
|
49
47
|
const getClientVersionOpts: ReqOpts = {routeId: "getClientVersion"};
|
|
50
|
-
const getInclusionListOpts: ReqOpts = {routeId: "getInclusionList"};
|
|
51
48
|
|
|
52
49
|
/**
|
|
53
50
|
* Legacy `engine_*` JSON-RPC methods
|
|
@@ -65,8 +62,7 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
65
62
|
executionPayload: ExecutionPayload,
|
|
66
63
|
versionedHashes?: VersionedHashes,
|
|
67
64
|
parentBeaconBlockRoot?: Root,
|
|
68
|
-
executionRequests?: ExecutionRequests
|
|
69
|
-
inclusionListTransactions?: bellatrix.Transactions
|
|
65
|
+
executionRequests?: ExecutionRequests
|
|
70
66
|
): Promise<PayloadStatusResult> {
|
|
71
67
|
const serializedExecutionPayload = serializeExecutionPayload(fork, executionPayload);
|
|
72
68
|
|
|
@@ -85,28 +81,6 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
85
81
|
if (executionRequests === undefined) {
|
|
86
82
|
throw Error(`executionRequests required in notifyNewPayload for fork=${fork}`);
|
|
87
83
|
}
|
|
88
|
-
if (ForkSeq[fork] >= ForkSeq.heze) {
|
|
89
|
-
if (inclusionListTransactions === undefined) {
|
|
90
|
-
throw Error(`inclusionListTransactions required in notifyNewPayload for fork=${fork}`);
|
|
91
|
-
}
|
|
92
|
-
const method = "engine_newPayloadV6";
|
|
93
|
-
return this.rpc.fetchWithRetries<
|
|
94
|
-
EngineApiRpcReturnTypes[typeof method],
|
|
95
|
-
EngineApiRpcParamTypes[typeof method]
|
|
96
|
-
>(
|
|
97
|
-
{
|
|
98
|
-
method,
|
|
99
|
-
params: [
|
|
100
|
-
serializedExecutionPayload,
|
|
101
|
-
serializedVersionedHashes,
|
|
102
|
-
serializedParentBeaconBlockRoot,
|
|
103
|
-
serializeExecutionRequests(fork, executionRequests),
|
|
104
|
-
serializeInclusionList(inclusionListTransactions),
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
notifyNewPayloadOpts
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
84
|
const method = ForkSeq[fork] >= ForkSeq.gloas ? "engine_newPayloadV5" : "engine_newPayloadV4";
|
|
111
85
|
return this.rpc.fetchWithRetries<EngineApiRpcReturnTypes[typeof method], EngineApiRpcParamTypes[typeof method]>(
|
|
112
86
|
{
|
|
@@ -145,15 +119,13 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
145
119
|
signal?: AbortSignal
|
|
146
120
|
): Promise<ForkchoiceUpdatedResult> {
|
|
147
121
|
const method =
|
|
148
|
-
ForkSeq[fork] >= ForkSeq.
|
|
149
|
-
? "
|
|
150
|
-
: ForkSeq[fork] >= ForkSeq.
|
|
151
|
-
? "
|
|
152
|
-
: ForkSeq[fork] >= ForkSeq.
|
|
153
|
-
? "
|
|
154
|
-
:
|
|
155
|
-
? "engine_forkchoiceUpdatedV2"
|
|
156
|
-
: "engine_forkchoiceUpdatedV1";
|
|
122
|
+
ForkSeq[fork] >= ForkSeq.gloas
|
|
123
|
+
? "engine_forkchoiceUpdatedV4"
|
|
124
|
+
: ForkSeq[fork] >= ForkSeq.deneb
|
|
125
|
+
? "engine_forkchoiceUpdatedV3"
|
|
126
|
+
: ForkSeq[fork] >= ForkSeq.capella
|
|
127
|
+
? "engine_forkchoiceUpdatedV2"
|
|
128
|
+
: "engine_forkchoiceUpdatedV1";
|
|
157
129
|
const payloadAttributesRpc = payloadAttributes ? serializePayloadAttributes(payloadAttributes) : undefined;
|
|
158
130
|
// If we are just fcUing and not asking execution for payload, retry is not required
|
|
159
131
|
// and we can move on, as the next fcU will be issued soon on the new slot
|
|
@@ -264,13 +236,4 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
264
236
|
return {code, name: cv.name, version: cv.version, commit: strip0xPrefix(cv.commit)};
|
|
265
237
|
});
|
|
266
238
|
}
|
|
267
|
-
|
|
268
|
-
async getInclusionList(): Promise<bellatrix.Transactions> {
|
|
269
|
-
const method = "engine_getInclusionListV1";
|
|
270
|
-
const response = await this.rpc.fetchWithRetries<
|
|
271
|
-
EngineApiRpcReturnTypes[typeof method],
|
|
272
|
-
EngineApiRpcParamTypes[typeof method]
|
|
273
|
-
>({method, params: []}, getInclusionListOpts);
|
|
274
|
-
return deserializeInclusionList(response);
|
|
275
|
-
}
|
|
276
239
|
}
|
|
@@ -140,12 +140,10 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
140
140
|
engine_newPayloadV3: this.notifyNewPayload.bind(this),
|
|
141
141
|
engine_newPayloadV4: this.notifyNewPayload.bind(this),
|
|
142
142
|
engine_newPayloadV5: this.notifyNewPayload.bind(this),
|
|
143
|
-
engine_newPayloadV6: this.notifyNewPayload.bind(this),
|
|
144
143
|
engine_forkchoiceUpdatedV1: this.notifyForkchoiceUpdate.bind(this),
|
|
145
144
|
engine_forkchoiceUpdatedV2: this.notifyForkchoiceUpdate.bind(this),
|
|
146
145
|
engine_forkchoiceUpdatedV3: this.notifyForkchoiceUpdate.bind(this),
|
|
147
146
|
engine_forkchoiceUpdatedV4: this.notifyForkchoiceUpdate.bind(this),
|
|
148
|
-
engine_forkchoiceUpdatedV5: this.notifyForkchoiceUpdate.bind(this),
|
|
149
147
|
engine_getPayloadV1: this.getPayloadV1.bind(this),
|
|
150
148
|
engine_getPayloadV2: this.getPayloadV5.bind(this),
|
|
151
149
|
engine_getPayloadV3: this.getPayloadV5.bind(this),
|
|
@@ -155,7 +153,6 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
155
153
|
engine_getPayloadBodiesByHashV2: this.getPayloadBodiesByHashV2.bind(this),
|
|
156
154
|
engine_getClientVersionV1: this.getClientVersionV1.bind(this),
|
|
157
155
|
engine_getBlobsV2: this.getBlobsV2.bind(this),
|
|
158
|
-
engine_getInclusionListV1: this.getInclusionList.bind(this),
|
|
159
156
|
};
|
|
160
157
|
}
|
|
161
158
|
|
|
@@ -239,13 +236,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
239
236
|
// IF the payload has been fully validated while processing the call
|
|
240
237
|
// RETURN payload status from the Payload validation process
|
|
241
238
|
// If validation succeeds, the response MUST contain {status: VALID, latestValidHash: payload.blockHash}
|
|
242
|
-
|
|
243
|
-
return {
|
|
244
|
-
status: ExecutionPayloadStatus.VALID,
|
|
245
|
-
latestValidHash: blockHash,
|
|
246
|
-
validationError: null,
|
|
247
|
-
inclusionListSatisfied: true,
|
|
248
|
-
};
|
|
239
|
+
return {status: ExecutionPayloadStatus.VALID, latestValidHash: blockHash, validationError: null};
|
|
249
240
|
}
|
|
250
241
|
|
|
251
242
|
/**
|
|
@@ -424,12 +415,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
424
415
|
// IF the payload is deemed VALID and the build process has begun
|
|
425
416
|
// {payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: buildProcessId}
|
|
426
417
|
return {
|
|
427
|
-
payloadStatus: {
|
|
428
|
-
status: ExecutionPayloadStatus.VALID,
|
|
429
|
-
latestValidHash: null,
|
|
430
|
-
validationError: null,
|
|
431
|
-
inclusionListSatisfied: true,
|
|
432
|
-
},
|
|
418
|
+
payloadStatus: {status: ExecutionPayloadStatus.VALID, latestValidHash: null, validationError: null},
|
|
433
419
|
payloadId: String(payloadId as number),
|
|
434
420
|
};
|
|
435
421
|
}
|
|
@@ -438,12 +424,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
438
424
|
// IF the payload is deemed VALID and a build process hasn't been started
|
|
439
425
|
// {payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: null}
|
|
440
426
|
return {
|
|
441
|
-
payloadStatus: {
|
|
442
|
-
status: ExecutionPayloadStatus.VALID,
|
|
443
|
-
latestValidHash: null,
|
|
444
|
-
validationError: null,
|
|
445
|
-
inclusionListSatisfied: true,
|
|
446
|
-
},
|
|
427
|
+
payloadStatus: {status: ExecutionPayloadStatus.VALID, latestValidHash: null, validationError: null},
|
|
447
428
|
payloadId: null,
|
|
448
429
|
};
|
|
449
430
|
}
|
|
@@ -506,10 +487,6 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
506
487
|
return null;
|
|
507
488
|
}
|
|
508
489
|
|
|
509
|
-
private getInclusionList(): EngineApiRpcReturnTypes["engine_getInclusionListV1"] {
|
|
510
|
-
return [];
|
|
511
|
-
}
|
|
512
|
-
|
|
513
490
|
private timestampToFork(timestamp: number): ForkPostBellatrix {
|
|
514
491
|
if (timestamp >= this.gloasForkTimestamp) return ForkName.gloas;
|
|
515
492
|
if (timestamp >= this.fuluForkTimestamp) return ForkName.fulu;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {byteArrayEquals} from "@chainsafe/ssz";
|
|
2
1
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
|
-
import {bellatrix} from "@lodestar/types";
|
|
4
2
|
import {pruneSetToMax} from "@lodestar/utils";
|
|
5
3
|
import {PayloadAttributesRpc} from "./types.js";
|
|
6
4
|
import {DATA, QUANTITY} from "./utils.js";
|
|
@@ -22,15 +20,10 @@ export type WithdrawalV1 = {
|
|
|
22
20
|
amount: QUANTITY;
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
type FcuAttributes = {headBlockHash: DATA} & Omit<PayloadAttributesRpc, "withdrawals"
|
|
26
|
-
inclusionListTransactions?: bellatrix.Transactions;
|
|
27
|
-
};
|
|
23
|
+
type FcuAttributes = {headBlockHash: DATA} & Omit<PayloadAttributesRpc, "withdrawals">;
|
|
28
24
|
|
|
29
25
|
export class PayloadIdCache {
|
|
30
|
-
private readonly payloadIdByFcuAttributes = new Map<
|
|
31
|
-
string,
|
|
32
|
-
PreparedPayloadId & {fullKey: string; inclusionListTransactions?: bellatrix.Transactions}
|
|
33
|
-
>();
|
|
26
|
+
private readonly payloadIdByFcuAttributes = new Map<string, PreparedPayloadId & {fullKey: string}>();
|
|
34
27
|
|
|
35
28
|
getFullKey({headBlockHash, timestamp, prevRandao, suggestedFeeRecipient}: FcuAttributes): string {
|
|
36
29
|
return `${headBlockHash}-${timestamp}-${prevRandao}-${suggestedFeeRecipient}`;
|
|
@@ -47,13 +40,7 @@ export class PayloadIdCache {
|
|
|
47
40
|
add(fcuAttributes: FcuAttributes, payloadId: PayloadId): void {
|
|
48
41
|
const key = this.getKey(fcuAttributes);
|
|
49
42
|
const fullKey = this.getFullKey(fcuAttributes);
|
|
50
|
-
|
|
51
|
-
this.payloadIdByFcuAttributes.set(key, {
|
|
52
|
-
payloadId,
|
|
53
|
-
preparedAtMs: performance.now(),
|
|
54
|
-
fullKey,
|
|
55
|
-
inclusionListTransactions,
|
|
56
|
-
});
|
|
43
|
+
this.payloadIdByFcuAttributes.set(key, {payloadId, preparedAtMs: performance.now(), fullKey});
|
|
57
44
|
}
|
|
58
45
|
|
|
59
46
|
prune(): void {
|
|
@@ -65,16 +52,8 @@ export class PayloadIdCache {
|
|
|
65
52
|
const key = this.getKey(fcuAttributes);
|
|
66
53
|
const fullKey = this.getFullKey(fcuAttributes);
|
|
67
54
|
const payloadInfo = this.payloadIdByFcuAttributes.get(key);
|
|
68
|
-
return payloadInfo?.fullKey === fullKey
|
|
69
|
-
isSameInclusionList(payloadInfo.inclusionListTransactions, fcuAttributes.inclusionListTransactions)
|
|
55
|
+
return payloadInfo?.fullKey === fullKey
|
|
70
56
|
? {payloadId: payloadInfo.payloadId, preparedAtMs: payloadInfo.preparedAtMs}
|
|
71
57
|
: undefined;
|
|
72
58
|
}
|
|
73
59
|
}
|
|
74
|
-
|
|
75
|
-
function isSameInclusionList(a?: bellatrix.Transactions, b?: bellatrix.Transactions): boolean {
|
|
76
|
-
if (a === undefined || b === undefined) {
|
|
77
|
-
return a === b;
|
|
78
|
-
}
|
|
79
|
-
return byteArrayEquals(a.bytes, b.bytes);
|
|
80
|
-
}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import {Type} from "@chainsafe/ssz";
|
|
2
2
|
import {CELLS_PER_EXT_BLOB, ForkName, ForkSeq, isForkPostBellatrix} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
ExecutionPayload,
|
|
5
|
-
ExecutionRequests,
|
|
6
|
-
Root,
|
|
7
|
-
RootHex,
|
|
8
|
-
bellatrix,
|
|
9
|
-
capella,
|
|
10
|
-
deneb,
|
|
11
|
-
electra,
|
|
12
|
-
gloas,
|
|
13
|
-
} from "@lodestar/types";
|
|
3
|
+
import {ExecutionPayload, ExecutionRequests, Root, RootHex, capella, deneb, electra, gloas} from "@lodestar/types";
|
|
14
4
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
15
5
|
import {EndTimer, LodestarError, fromHex, strip0xPrefix, toHex, toRootHex} from "@lodestar/utils";
|
|
16
6
|
import {isValidBlobVersionedHashes} from "./blobVersionedHashes.js";
|
|
@@ -446,10 +436,6 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
446
436
|
};
|
|
447
437
|
});
|
|
448
438
|
}
|
|
449
|
-
|
|
450
|
-
getInclusionList(): Promise<bellatrix.Transactions> {
|
|
451
|
-
throw Error("engine_getInclusionListV1 is not available over the REST engine API");
|
|
452
|
-
}
|
|
453
439
|
}
|
|
454
440
|
|
|
455
441
|
function toPayloadAttributesBellatrix(attributes: PayloadAttributes) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForkName} from "@lodestar/params";
|
|
2
|
-
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei
|
|
2
|
+
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei} from "@lodestar/types";
|
|
3
3
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
4
4
|
import {
|
|
5
5
|
ClientVersion,
|
|
@@ -33,8 +33,7 @@ export interface IEngineTransport {
|
|
|
33
33
|
executionPayload: ExecutionPayload,
|
|
34
34
|
versionedHashes?: VersionedHashes,
|
|
35
35
|
parentBeaconBlockRoot?: Root,
|
|
36
|
-
executionRequests?: ExecutionRequests
|
|
37
|
-
inclusionListTransactions?: bellatrix.Transactions
|
|
36
|
+
executionRequests?: ExecutionRequests
|
|
38
37
|
): Promise<PayloadStatusResult>;
|
|
39
38
|
|
|
40
39
|
forkchoiceUpdated(
|
|
@@ -53,6 +52,4 @@ export interface IEngineTransport {
|
|
|
53
52
|
getBlobsV2(versionedHashes: VersionedHashes, buffers?: Uint8Array[]): Promise<BlobAndProofV2[] | null>;
|
|
54
53
|
|
|
55
54
|
getClientVersion(clientVersion: ClientVersion): Promise<ClientVersion[]>;
|
|
56
|
-
|
|
57
|
-
getInclusionList(): Promise<bellatrix.Transactions>;
|
|
58
55
|
}
|
|
@@ -55,7 +55,6 @@ export type EngineApiRpcParamTypes = {
|
|
|
55
55
|
engine_newPayloadV3: [ExecutionPayloadRpc, VersionedHashesRpc, DATA];
|
|
56
56
|
engine_newPayloadV4: [ExecutionPayloadRpc, VersionedHashesRpc, DATA, ExecutionRequestsRpc];
|
|
57
57
|
engine_newPayloadV5: [ExecutionPayloadRpc, VersionedHashesRpc, DATA, ExecutionRequestsRpc];
|
|
58
|
-
engine_newPayloadV6: [ExecutionPayloadRpc, VersionedHashesRpc, DATA, ExecutionRequestsRpc, InclusionListRpc];
|
|
59
58
|
/**
|
|
60
59
|
* 1. Object - Payload validity status with respect to the consensus rules:
|
|
61
60
|
* - blockHash: DATA, 32 Bytes - block hash value of the payload
|
|
@@ -77,10 +76,6 @@ export type EngineApiRpcParamTypes = {
|
|
|
77
76
|
forkChoiceData: {headBlockHash: DATA; safeBlockHash: DATA; finalizedBlockHash: DATA},
|
|
78
77
|
payloadAttributes?: PayloadAttributesRpc,
|
|
79
78
|
];
|
|
80
|
-
engine_forkchoiceUpdatedV5: [
|
|
81
|
-
forkChoiceData: {headBlockHash: DATA; safeBlockHash: DATA; finalizedBlockHash: DATA},
|
|
82
|
-
payloadAttributes?: PayloadAttributesRpc,
|
|
83
|
-
];
|
|
84
79
|
/**
|
|
85
80
|
* 1. payloadId: QUANTITY, 64 Bits - Identifier of the payload building process
|
|
86
81
|
*/
|
|
@@ -102,16 +97,12 @@ export type EngineApiRpcParamTypes = {
|
|
|
102
97
|
engine_getClientVersionV1: [ClientVersionRpc];
|
|
103
98
|
|
|
104
99
|
engine_getBlobsV2: [DATA[]];
|
|
105
|
-
|
|
106
|
-
engine_getInclusionListV1: [];
|
|
107
100
|
};
|
|
108
101
|
|
|
109
102
|
export type PayloadStatus = {
|
|
110
103
|
status: ExecutionPayloadStatus;
|
|
111
104
|
latestValidHash: DATA | null;
|
|
112
105
|
validationError: string | null;
|
|
113
|
-
/** PayloadStatusV2: whether a VALID payload satisfied the inclusion list constraints, null otherwise */
|
|
114
|
-
inclusionListSatisfied?: boolean | null;
|
|
115
106
|
};
|
|
116
107
|
|
|
117
108
|
export type EngineApiRpcReturnTypes = {
|
|
@@ -124,7 +115,6 @@ export type EngineApiRpcReturnTypes = {
|
|
|
124
115
|
engine_newPayloadV3: PayloadStatus;
|
|
125
116
|
engine_newPayloadV4: PayloadStatus;
|
|
126
117
|
engine_newPayloadV5: PayloadStatus;
|
|
127
|
-
engine_newPayloadV6: PayloadStatus;
|
|
128
118
|
engine_forkchoiceUpdatedV1: {
|
|
129
119
|
payloadStatus: PayloadStatus;
|
|
130
120
|
payloadId: QUANTITY | null;
|
|
@@ -141,10 +131,6 @@ export type EngineApiRpcReturnTypes = {
|
|
|
141
131
|
payloadStatus: PayloadStatus;
|
|
142
132
|
payloadId: QUANTITY | null;
|
|
143
133
|
};
|
|
144
|
-
engine_forkchoiceUpdatedV5: {
|
|
145
|
-
payloadStatus: PayloadStatus;
|
|
146
|
-
payloadId: QUANTITY | null;
|
|
147
|
-
};
|
|
148
134
|
/**
|
|
149
135
|
* payloadId | Error: QUANTITY, 64 Bits - Identifier of the payload building process
|
|
150
136
|
*/
|
|
@@ -160,8 +146,6 @@ export type EngineApiRpcReturnTypes = {
|
|
|
160
146
|
engine_getClientVersionV1: ClientVersionRpc[];
|
|
161
147
|
|
|
162
148
|
engine_getBlobsV2: BlobAndProofV2Rpc[] | null;
|
|
163
|
-
|
|
164
|
-
engine_getInclusionListV1: InclusionListRpc;
|
|
165
149
|
};
|
|
166
150
|
|
|
167
151
|
type ExecutionPayloadRpcWithValue = {
|
|
@@ -271,13 +255,8 @@ export type PayloadAttributesRpc = {
|
|
|
271
255
|
slotNumber?: QUANTITY;
|
|
272
256
|
/** QUANTITY, 64 Bits - target value for the gasLimit field of the new payload (GLOAS, execution-apis#796) */
|
|
273
257
|
targetGasLimit?: QUANTITY;
|
|
274
|
-
/** Array of DATA - transactions that the built payload must include (PayloadAttributesV5, HEZE) */
|
|
275
|
-
inclusionListTransactions?: InclusionListRpc;
|
|
276
258
|
};
|
|
277
259
|
|
|
278
|
-
/** Array of DATA - array of transaction objects */
|
|
279
|
-
export type InclusionListRpc = DATA[];
|
|
280
|
-
|
|
281
260
|
export type ClientVersionRpc = {
|
|
282
261
|
/** ClientCode */
|
|
283
262
|
code: string;
|
|
@@ -457,9 +436,6 @@ export function serializePayloadAttributes(data: PayloadAttributes): PayloadAttr
|
|
|
457
436
|
parentBeaconBlockRoot: data.parentBeaconBlockRoot ? bytesToData(data.parentBeaconBlockRoot) : undefined,
|
|
458
437
|
slotNumber: data.slotNumber !== undefined ? numToQuantity(data.slotNumber) : undefined,
|
|
459
438
|
targetGasLimit: data.targetGasLimit !== undefined ? numToQuantity(data.targetGasLimit) : undefined,
|
|
460
|
-
inclusionListTransactions: data.inclusionListTransactions
|
|
461
|
-
? serializeInclusionList(data.inclusionListTransactions)
|
|
462
|
-
: undefined,
|
|
463
439
|
};
|
|
464
440
|
}
|
|
465
441
|
|
|
@@ -467,14 +443,6 @@ export function serializeBeaconBlockRoot(data: Root): DATA {
|
|
|
467
443
|
return bytesToData(data);
|
|
468
444
|
}
|
|
469
445
|
|
|
470
|
-
export function serializeInclusionList(data: bellatrix.Transactions): InclusionListRpc {
|
|
471
|
-
return Array.from(data, (transaction) => bytesToData(transaction));
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
export function deserializeInclusionList(data: InclusionListRpc): bellatrix.Transactions {
|
|
475
|
-
return SerializedList.fromArray(data.map((transaction) => dataToBytes(transaction, null)));
|
|
476
|
-
}
|
|
477
|
-
|
|
478
446
|
export function deserializePayloadAttributes(data: PayloadAttributesRpc): PayloadAttributes {
|
|
479
447
|
return {
|
|
480
448
|
timestamp: quantityToNum(data.timestamp),
|
|
@@ -486,9 +454,6 @@ export function deserializePayloadAttributes(data: PayloadAttributesRpc): Payloa
|
|
|
486
454
|
parentBeaconBlockRoot: data.parentBeaconBlockRoot ? dataToBytes(data.parentBeaconBlockRoot, 32) : undefined,
|
|
487
455
|
slotNumber: data.slotNumber !== undefined ? quantityToNum(data.slotNumber) : undefined,
|
|
488
456
|
targetGasLimit: data.targetGasLimit !== undefined ? quantityToBigint(data.targetGasLimit) : undefined,
|
|
489
|
-
inclusionListTransactions: data.inclusionListTransactions
|
|
490
|
-
? deserializeInclusionList(data.inclusionListTransactions)
|
|
491
|
-
: undefined,
|
|
492
457
|
};
|
|
493
458
|
}
|
|
494
459
|
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Export generic RestApi server for CLI
|
|
2
2
|
|
|
3
|
+
export {ServiceNotReady} from "./api/impl/errors.js";
|
|
3
4
|
export type {RestApiServerMetrics, RestApiServerModules, RestApiServerOpts} from "./api/rest/base.js";
|
|
4
5
|
export {RestApiServer} from "./api/rest/base.js";
|
|
5
6
|
export {persistAnchorState} from "./chain/index.js";
|