@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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {ProducedBlockSource} from "@lodestar/types";
|
|
2
2
|
import {BlockSelectionResult} from "../../api/impl/validator/index.js";
|
|
3
|
-
import {InclusionListSource} from "../../chain/blocks/types.js";
|
|
4
3
|
import {PreparePayloadReason} from "../../chain/prepareNextSlot.js";
|
|
5
4
|
import {BlockProductionStep, PayloadPreparationType} from "../../chain/produceBlock/index.js";
|
|
6
5
|
import {RegistryMetricCreator} from "../utils/registryMetricCreator.js";
|
|
@@ -421,41 +420,5 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
|
|
|
421
420
|
name: "beacon_weak_head_detected_total",
|
|
422
421
|
help: "Detected current head block is weak. May reorg it out when proposing next slot. See proposer boost reorg for more",
|
|
423
422
|
}),
|
|
424
|
-
|
|
425
|
-
// HEZE:EIP-7805
|
|
426
|
-
inclusionListsReceived: register.counter<{source: InclusionListSource}>({
|
|
427
|
-
name: "beacon_inclusion_lists_received_total",
|
|
428
|
-
help: "Total number of received inclusion lists",
|
|
429
|
-
labelNames: ["source"],
|
|
430
|
-
}),
|
|
431
|
-
inclusionListsValid: register.counter<{source: InclusionListSource}>({
|
|
432
|
-
name: "beacon_inclusion_lists_valid_total",
|
|
433
|
-
help: "Total number of valid inclusion lists",
|
|
434
|
-
labelNames: ["source"],
|
|
435
|
-
}),
|
|
436
|
-
inclusionListsValidSize: register.counter({
|
|
437
|
-
name: "beacon_inclusion_lists_valid_size_bytes_total",
|
|
438
|
-
help: "Total size of valid inclusion lists in bytes",
|
|
439
|
-
}),
|
|
440
|
-
inclusionListTransactionsReceived: register.counter<{source: InclusionListSource}>({
|
|
441
|
-
name: "beacon_inclusion_list_transactions_received_total",
|
|
442
|
-
help: "Total number of transactions in received inclusion lists",
|
|
443
|
-
labelNames: ["source"],
|
|
444
|
-
}),
|
|
445
|
-
inclusionListsPublished: register.counter({
|
|
446
|
-
name: "beacon_inclusion_lists_published_total",
|
|
447
|
-
help: "Total number of published inclusion lists",
|
|
448
|
-
}),
|
|
449
|
-
inclusionListsValidationTime: register.histogram<{source: InclusionListSource}>({
|
|
450
|
-
name: "beacon_inclusion_lists_validation_time_seconds",
|
|
451
|
-
help: "Time taken to validate inclusion lists",
|
|
452
|
-
buckets: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5],
|
|
453
|
-
labelNames: ["source"],
|
|
454
|
-
}),
|
|
455
|
-
inclusionListArrivalTime: register.histogram({
|
|
456
|
-
name: "beacon_inclusion_lists_arrival_time_seconds",
|
|
457
|
-
help: "Inclusion list arrival time since the beginning of slot",
|
|
458
|
-
buckets: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
|
|
459
|
-
}),
|
|
460
423
|
};
|
|
461
424
|
}
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
type InvalidAttestationData,
|
|
17
17
|
ScannedSlotsTerminationReason,
|
|
18
18
|
} from "../../chain/opPools/aggregatedAttestationPool.js";
|
|
19
|
-
import {InclusionListInsertOutcome} from "../../chain/opPools/inclusionListStore.js";
|
|
20
19
|
import {InsertOutcome} from "../../chain/opPools/types.js";
|
|
21
20
|
import {RegenCaller, RegenFnName} from "../../chain/regen/interface.js";
|
|
22
21
|
import {ReprocessStatus} from "../../chain/reprocess.js";
|
|
@@ -1209,31 +1208,11 @@ export function createLodestarMetrics(
|
|
|
1209
1208
|
help: "The total result of calling notifyForkchoiceUpdate execution engine api",
|
|
1210
1209
|
labelNames: ["result"],
|
|
1211
1210
|
}),
|
|
1212
|
-
getInclusionListV1Requests: register.counter({
|
|
1213
|
-
name: "lodestar_execution_engine_get_inclusion_list_v1_requests_total",
|
|
1214
|
-
help: "Total number of engine_getInclusionListV1 requests",
|
|
1215
|
-
}),
|
|
1216
|
-
getInclusionListV1RequestsDuration: register.histogram({
|
|
1217
|
-
name: "lodestar_execution_engine_get_inclusion_list_v1_duration_seconds",
|
|
1218
|
-
help: "Duration of engine_getInclusionListV1 requests",
|
|
1219
|
-
buckets: [0.05, 0.1, 0.25, 0.5, 1],
|
|
1220
|
-
}),
|
|
1221
1211
|
engineApiRequests: register.counter<{transport: string}>({
|
|
1222
1212
|
name: "lodestar_execution_engine_api_requests_total",
|
|
1223
1213
|
help: "Total engine API requests by transport",
|
|
1224
1214
|
labelNames: ["transport"],
|
|
1225
1215
|
}),
|
|
1226
|
-
inclusionListStore: {
|
|
1227
|
-
size: register.gauge({
|
|
1228
|
-
name: "lodestar_inclusion_list_store_size",
|
|
1229
|
-
help: "Current number of inclusion lists retained in the InclusionListStore",
|
|
1230
|
-
}),
|
|
1231
|
-
insertOutcome: register.counter<{insertOutcome: InclusionListInsertOutcome}>({
|
|
1232
|
-
name: "lodestar_inclusion_list_store_insert_outcome_total",
|
|
1233
|
-
help: "Total number of InclusionListStore insertions by outcome",
|
|
1234
|
-
labelNames: ["insertOutcome"],
|
|
1235
|
-
}),
|
|
1236
|
-
},
|
|
1237
1216
|
opPool: {
|
|
1238
1217
|
aggregatedAttestationPool: {
|
|
1239
1218
|
size: register.gauge({
|
|
@@ -81,9 +81,7 @@ function formatActiveResources(): string {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
* This class
|
|
85
|
-
* - In a libp2p worker
|
|
86
|
-
* - In the main thread
|
|
84
|
+
* This class runs in the libp2p worker.
|
|
87
85
|
*
|
|
88
86
|
* libp2p holds the reference to the TCP transport socket. libp2p is in a worker, what components
|
|
89
87
|
* must be in a worker too?
|
package/src/network/forks.ts
CHANGED
|
@@ -29,10 +29,14 @@ import {Epoch} from "@lodestar/types";
|
|
|
29
29
|
export const FORK_EPOCH_LOOKAHEAD = 2;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Return the
|
|
32
|
+
* Return the fork boundaries active at any epoch in the inclusive range.
|
|
33
33
|
* @see FORK_EPOCH_LOOKAHEAD for details on when fork boundaries are considered 'active'
|
|
34
34
|
*/
|
|
35
|
-
export function getActiveForkBoundaries(
|
|
35
|
+
export function getActiveForkBoundaries(
|
|
36
|
+
config: ChainForkConfig,
|
|
37
|
+
fromEpoch: Epoch,
|
|
38
|
+
toEpoch = fromEpoch
|
|
39
|
+
): ForkBoundary[] {
|
|
36
40
|
const activeBoundaries: ForkBoundary[] = [];
|
|
37
41
|
const {forkBoundariesAscendingEpochOrder} = config;
|
|
38
42
|
|
|
@@ -48,7 +52,7 @@ export function getActiveForkBoundaries(config: ChainForkConfig, epoch: Epoch):
|
|
|
48
52
|
continue;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
if (
|
|
55
|
+
if (toEpoch >= currentEpoch - FORK_EPOCH_LOOKAHEAD && fromEpoch <= nextEpoch + FORK_EPOCH_LOOKAHEAD) {
|
|
52
56
|
activeBoundaries.push(currentForkBoundary);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
altair,
|
|
16
16
|
capella,
|
|
17
17
|
gloas,
|
|
18
|
-
heze,
|
|
19
18
|
phase0,
|
|
20
19
|
} from "@lodestar/types";
|
|
21
20
|
import {Logger} from "@lodestar/utils";
|
|
@@ -41,7 +40,6 @@ export enum GossipType {
|
|
|
41
40
|
payload_attestation_message = "payload_attestation_message",
|
|
42
41
|
execution_payload_bid = "execution_payload_bid",
|
|
43
42
|
proposer_preferences = "proposer_preferences",
|
|
44
|
-
inclusion_list = "inclusion_list",
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
export type SequentialGossipType = Exclude<GossipType, GossipType.beacon_attestation>;
|
|
@@ -79,7 +77,6 @@ export type GossipTopicTypeMap = {
|
|
|
79
77
|
[GossipType.payload_attestation_message]: {type: GossipType.payload_attestation_message};
|
|
80
78
|
[GossipType.execution_payload_bid]: {type: GossipType.execution_payload_bid};
|
|
81
79
|
[GossipType.proposer_preferences]: {type: GossipType.proposer_preferences};
|
|
82
|
-
[GossipType.inclusion_list]: {type: GossipType.inclusion_list};
|
|
83
80
|
};
|
|
84
81
|
|
|
85
82
|
export type GossipTopicMap = {
|
|
@@ -112,7 +109,6 @@ export type GossipTypeMap = {
|
|
|
112
109
|
[GossipType.payload_attestation_message]: gloas.PayloadAttestationMessage;
|
|
113
110
|
[GossipType.execution_payload_bid]: gloas.SignedExecutionPayloadBid;
|
|
114
111
|
[GossipType.proposer_preferences]: gloas.SignedProposerPreferences;
|
|
115
|
-
[GossipType.inclusion_list]: heze.SignedInclusionList;
|
|
116
112
|
};
|
|
117
113
|
|
|
118
114
|
export type GossipFnByType = {
|
|
@@ -146,7 +142,6 @@ export type GossipFnByType = {
|
|
|
146
142
|
[GossipType.proposer_preferences]: (
|
|
147
143
|
signedProposerPreferences: gloas.SignedProposerPreferences
|
|
148
144
|
) => Promise<void> | void;
|
|
149
|
-
[GossipType.inclusion_list]: (signedInclusionList: heze.SignedInclusionList) => Promise<void> | void;
|
|
150
145
|
};
|
|
151
146
|
|
|
152
147
|
export type GossipFn = GossipFnByType[keyof GossipFnByType];
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "@libp2p/gossipsub/score";
|
|
7
7
|
import {BeaconConfig} from "@lodestar/config";
|
|
8
8
|
import {ATTESTATION_SUBNET_COUNT, PTC_SIZE, SLOTS_PER_EPOCH, TARGET_AGGREGATORS_PER_COMMITTEE} from "@lodestar/params";
|
|
9
|
-
import {computeCommitteeCount} from "@lodestar/state-transition";
|
|
10
|
-
import {getActiveForkBoundaries} from "../forks.js";
|
|
9
|
+
import {computeCommitteeCount, computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
10
|
+
import {FORK_EPOCH_LOOKAHEAD, getActiveForkBoundaries} from "../forks.js";
|
|
11
11
|
import {Eth2Context} from "./gossipsub.js";
|
|
12
12
|
import {GossipType} from "./interface.js";
|
|
13
13
|
import {stringifyGossipTopic} from "./topic.js";
|
|
@@ -132,11 +132,20 @@ function getAllTopicsScoreParams(
|
|
|
132
132
|
precomputedParams: PreComputedParams
|
|
133
133
|
): Record<string, TopicScoreParams> {
|
|
134
134
|
const {epochDurationMs, slotDurationMs} = precomputedParams;
|
|
135
|
-
const epoch = eth2Context.currentEpoch;
|
|
136
135
|
const topicsParams: Record<string, TopicScoreParams> = {};
|
|
137
|
-
|
|
136
|
+
// Gossipsub copies the score parameters at construction, including those for future subscriptions.
|
|
137
|
+
const boundaries = getActiveForkBoundaries(config, eth2Context.currentEpoch, Infinity);
|
|
138
138
|
const beaconAttestationSubnetWeight = 1 / ATTESTATION_SUBNET_COUNT;
|
|
139
139
|
for (const boundary of boundaries) {
|
|
140
|
+
const currentSlot = Math.max(
|
|
141
|
+
eth2Context.currentSlot,
|
|
142
|
+
computeStartSlotAtEpoch(boundary.epoch - FORK_EPOCH_LOOKAHEAD)
|
|
143
|
+
);
|
|
144
|
+
// The node subscribes to a boundary's topics FORK_EPOCH_LOOKAHEAD epochs early, but peers only publish on
|
|
145
|
+
// them from the boundary epoch. Hold back the mesh delivery penalty until then, otherwise every mesh peer
|
|
146
|
+
// is penalized for an empty topic.
|
|
147
|
+
const subscribeEpoch = Math.max(eth2Context.currentEpoch, boundary.epoch - FORK_EPOCH_LOOKAHEAD);
|
|
148
|
+
const activationDelayMs = Math.max(0, boundary.epoch - subscribeEpoch) * epochDurationMs;
|
|
140
149
|
//first all fixed topics
|
|
141
150
|
topicsParams[
|
|
142
151
|
stringifyGossipTopic(config, {
|
|
@@ -225,8 +234,8 @@ function getAllTopicsScoreParams(
|
|
|
225
234
|
meshMessageInfo: {
|
|
226
235
|
decaySlots: SLOTS_PER_EPOCH * 5,
|
|
227
236
|
capFactor: 3,
|
|
228
|
-
activationWindow: epochDurationMs,
|
|
229
|
-
currentSlot
|
|
237
|
+
activationWindow: activationDelayMs + epochDurationMs,
|
|
238
|
+
currentSlot,
|
|
230
239
|
},
|
|
231
240
|
});
|
|
232
241
|
topicsParams[
|
|
@@ -241,8 +250,8 @@ function getAllTopicsScoreParams(
|
|
|
241
250
|
meshMessageInfo: {
|
|
242
251
|
decaySlots: SLOTS_PER_EPOCH * 5,
|
|
243
252
|
capFactor: 3,
|
|
244
|
-
activationWindow: epochDurationMs,
|
|
245
|
-
currentSlot
|
|
253
|
+
activationWindow: activationDelayMs + epochDurationMs,
|
|
254
|
+
currentSlot,
|
|
246
255
|
},
|
|
247
256
|
});
|
|
248
257
|
|
|
@@ -268,8 +277,8 @@ function getAllTopicsScoreParams(
|
|
|
268
277
|
meshMessageInfo: {
|
|
269
278
|
decaySlots: SLOTS_PER_EPOCH * 2,
|
|
270
279
|
capFactor: 4,
|
|
271
|
-
activationWindow: epochDurationMs,
|
|
272
|
-
currentSlot
|
|
280
|
+
activationWindow: activationDelayMs + epochDurationMs,
|
|
281
|
+
currentSlot,
|
|
273
282
|
},
|
|
274
283
|
});
|
|
275
284
|
|
|
@@ -280,10 +289,10 @@ function getAllTopicsScoreParams(
|
|
|
280
289
|
meshMessageInfo: {
|
|
281
290
|
decaySlots: multipleBurstsPerSubnetPerEpoch ? SLOTS_PER_EPOCH * 4 : SLOTS_PER_EPOCH * 16,
|
|
282
291
|
capFactor: 16,
|
|
283
|
-
activationWindow:
|
|
284
|
-
|
|
285
|
-
: epochDurationMs,
|
|
286
|
-
currentSlot
|
|
292
|
+
activationWindow:
|
|
293
|
+
activationDelayMs +
|
|
294
|
+
(multipleBurstsPerSubnetPerEpoch ? slotDurationMs * (SLOTS_PER_EPOCH / 2 + 1) : epochDurationMs),
|
|
295
|
+
currentSlot,
|
|
287
296
|
},
|
|
288
297
|
});
|
|
289
298
|
for (let subnet = 0; subnet < ATTESTATION_SUBNET_COUNT; subnet++) {
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
ATTESTATION_SUBNET_COUNT,
|
|
5
5
|
ForkName,
|
|
6
6
|
ForkSeq,
|
|
7
|
-
MAX_SIGNED_INCLUSION_LIST_SIZE,
|
|
8
7
|
SYNC_COMMITTEE_SUBNET_COUNT,
|
|
9
8
|
isForkPostAltair,
|
|
10
9
|
isForkPostElectra,
|
|
@@ -92,7 +91,6 @@ function stringifyGossipTopicType(topic: GossipTopic): string {
|
|
|
92
91
|
case GossipType.payload_attestation_message:
|
|
93
92
|
case GossipType.execution_payload_bid:
|
|
94
93
|
case GossipType.proposer_preferences:
|
|
95
|
-
case GossipType.inclusion_list:
|
|
96
94
|
return topic.type;
|
|
97
95
|
case GossipType.beacon_attestation:
|
|
98
96
|
case GossipType.sync_committee:
|
|
@@ -142,8 +140,6 @@ export function getGossipSSZType(topic: GossipTopic) {
|
|
|
142
140
|
return isForkPostGloas(fork) ? sszTypesFor(fork).SignedExecutionPayloadBid : ssz.gloas.SignedExecutionPayloadBid;
|
|
143
141
|
case GossipType.proposer_preferences:
|
|
144
142
|
return ssz.gloas.SignedProposerPreferences;
|
|
145
|
-
case GossipType.inclusion_list:
|
|
146
|
-
return ssz.heze.SignedInclusionList;
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
145
|
|
|
@@ -152,9 +148,6 @@ export function getGossipSSZType(topic: GossipTopic) {
|
|
|
152
148
|
*/
|
|
153
149
|
export function getGossipSSZMaxSize(topic: GossipTopic, config: ChainForkConfig, sszType: CompositeTypeAny): number {
|
|
154
150
|
const maxSize = Math.min(sszType.maxSize, config.MAX_PAYLOAD_SIZE);
|
|
155
|
-
if (topic.type === GossipType.inclusion_list) {
|
|
156
|
-
return Math.min(maxSize, MAX_SIGNED_INCLUSION_LIST_SIZE);
|
|
157
|
-
}
|
|
158
151
|
if (isForkPostGloas(topic.boundary.fork) && topic.type === GossipType.data_column_sidecar) {
|
|
159
152
|
return Math.min(maxSize, computeMaxGloasDataColumnSidecarSize(config));
|
|
160
153
|
}
|
|
@@ -225,7 +218,6 @@ export function parseGossipTopic(forkDigestContext: ForkDigestContext, topicStr:
|
|
|
225
218
|
case GossipType.payload_attestation_message:
|
|
226
219
|
case GossipType.execution_payload_bid:
|
|
227
220
|
case GossipType.proposer_preferences:
|
|
228
|
-
case GossipType.inclusion_list:
|
|
229
221
|
return {type: gossipTypeStr, boundary, encoding};
|
|
230
222
|
}
|
|
231
223
|
|
|
@@ -276,10 +268,6 @@ export function getCoreTopicsAtFork(
|
|
|
276
268
|
topics.push({type: GossipType.proposer_preferences});
|
|
277
269
|
}
|
|
278
270
|
|
|
279
|
-
if (ForkSeq[fork] >= ForkSeq.heze) {
|
|
280
|
-
topics.push({type: GossipType.inclusion_list});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
271
|
// After fulu also track data_column_sidecar_{index}
|
|
284
272
|
if (ForkSeq[fork] >= ForkSeq.fulu) {
|
|
285
273
|
topics.push(...getDataColumnSidecarTopics(networkConfig, opts.subscribeAllColumnSubnets));
|
|
@@ -384,7 +372,6 @@ export const gossipTopicIgnoreDuplicatePublishError: Record<GossipType, boolean>
|
|
|
384
372
|
[GossipType.payload_attestation_message]: true,
|
|
385
373
|
[GossipType.execution_payload_bid]: true,
|
|
386
374
|
[GossipType.proposer_preferences]: true,
|
|
387
|
-
[GossipType.inclusion_list]: true,
|
|
388
375
|
};
|
|
389
376
|
|
|
390
377
|
/**
|
|
@@ -422,5 +409,4 @@ export const gossipTopicAllowPublishToZeroPeers: Record<GossipType, boolean> = {
|
|
|
422
409
|
[GossipType.payload_attestation_message]: false,
|
|
423
410
|
[GossipType.execution_payload_bid]: false,
|
|
424
411
|
[GossipType.proposer_preferences]: false,
|
|
425
|
-
[GossipType.inclusion_list]: false,
|
|
426
412
|
};
|
package/src/network/interface.ts
CHANGED
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
capella,
|
|
33
33
|
fulu,
|
|
34
34
|
gloas,
|
|
35
|
-
heze,
|
|
36
35
|
phase0,
|
|
37
36
|
} from "@lodestar/types";
|
|
38
37
|
import {BlockInputSource} from "../chain/blocks/blockInput/types.js";
|
|
@@ -116,7 +115,6 @@ export interface INetwork extends INetworkCorePublic {
|
|
|
116
115
|
publishSignedExecutionPayloadBid(signedBid: gloas.SignedExecutionPayloadBid): Promise<number>;
|
|
117
116
|
publishPayloadAttestationMessage(payloadAttestationMessage: gloas.PayloadAttestationMessage): Promise<number>;
|
|
118
117
|
publishProposerPreferences(signedProposerPreferences: gloas.SignedProposerPreferences): Promise<number>;
|
|
119
|
-
publishInclusionList(signedInclusionList: heze.SignedInclusionList): Promise<number>;
|
|
120
118
|
|
|
121
119
|
// Debug
|
|
122
120
|
dumpGossipQueue(gossipType: GossipType): Promise<PendingGossipsubMessage[]>;
|
package/src/network/network.ts
CHANGED
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
capella,
|
|
27
27
|
fulu,
|
|
28
28
|
gloas,
|
|
29
|
-
heze,
|
|
30
29
|
isGloasDataColumnSidecar,
|
|
31
30
|
phase0,
|
|
32
31
|
} from "@lodestar/types";
|
|
@@ -36,7 +35,7 @@ import {ChainEvent, IBeaconChain} from "../chain/index.js";
|
|
|
36
35
|
import {computeSubnetForDataColumnSidecar} from "../chain/validation/dataColumnSidecar.js";
|
|
37
36
|
import {GoodByeReasonCode} from "../constants/index.js";
|
|
38
37
|
import {IBeaconDb} from "../db/interface.js";
|
|
39
|
-
import {Metrics
|
|
38
|
+
import {Metrics} from "../metrics/index.js";
|
|
40
39
|
import {IClock} from "../util/clock.js";
|
|
41
40
|
import {CustodyConfig} from "../util/dataColumns.js";
|
|
42
41
|
import {PeerIdStr, peerIdToString} from "../util/peerId.js";
|
|
@@ -46,7 +45,7 @@ import {
|
|
|
46
45
|
DataColumnSidecarsByRootRequest,
|
|
47
46
|
ExecutionPayloadEnvelopesByRootRequest,
|
|
48
47
|
} from "../util/types.js";
|
|
49
|
-
import {INetworkCore,
|
|
48
|
+
import {INetworkCore, WorkerNetworkCore} from "./core/index.js";
|
|
50
49
|
import {INetworkEventBus, NetworkEvent, NetworkEventBus, NetworkEventData} from "./events.js";
|
|
51
50
|
import {getActiveForkBoundaries} from "./forks.js";
|
|
52
51
|
import {GossipHandlers, GossipTopicMap, GossipType, GossipTypeMap} from "./gossip/index.js";
|
|
@@ -100,12 +99,7 @@ export type NetworkInitModules = {
|
|
|
100
99
|
};
|
|
101
100
|
|
|
102
101
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* Exists a front class that's what consumers interact with.
|
|
106
|
-
* This class will multiplex between:
|
|
107
|
-
* - libp2p in worker
|
|
108
|
-
* - libp2p in main thread
|
|
102
|
+
* Front class that consumers interact with. libp2p runs in a worker thread.
|
|
109
103
|
*/
|
|
110
104
|
export class Network implements INetwork {
|
|
111
105
|
readonly peerId: PeerId;
|
|
@@ -173,42 +167,23 @@ export class Network implements INetwork {
|
|
|
173
167
|
const initialStatus = chain.getStatus();
|
|
174
168
|
const initialCustodyGroupCount = chain.custodyConfig.targetCustodyGroupCount;
|
|
175
169
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
logger,
|
|
194
|
-
events,
|
|
195
|
-
metrics,
|
|
196
|
-
getReqRespHandler,
|
|
197
|
-
})
|
|
198
|
-
: await NetworkCore.init({
|
|
199
|
-
opts,
|
|
200
|
-
config,
|
|
201
|
-
privateKey,
|
|
202
|
-
peerStoreDir,
|
|
203
|
-
logger,
|
|
204
|
-
clock: chain.clock,
|
|
205
|
-
events,
|
|
206
|
-
getReqRespHandler,
|
|
207
|
-
metricsRegistry: metrics ? new RegistryMetricCreator() : null,
|
|
208
|
-
initialStatus,
|
|
209
|
-
initialCustodyGroupCount,
|
|
210
|
-
activeValidatorCount,
|
|
211
|
-
});
|
|
170
|
+
const core = await WorkerNetworkCore.init({
|
|
171
|
+
opts: {
|
|
172
|
+
...opts,
|
|
173
|
+
peerStoreDir,
|
|
174
|
+
metricsEnabled: Boolean(metrics),
|
|
175
|
+
activeValidatorCount,
|
|
176
|
+
genesisTime: chain.genesisTime,
|
|
177
|
+
initialStatus,
|
|
178
|
+
initialCustodyGroupCount,
|
|
179
|
+
},
|
|
180
|
+
config,
|
|
181
|
+
privateKey,
|
|
182
|
+
logger,
|
|
183
|
+
events,
|
|
184
|
+
metrics,
|
|
185
|
+
getReqRespHandler,
|
|
186
|
+
});
|
|
212
187
|
|
|
213
188
|
const networkProcessor = new NetworkProcessor(
|
|
214
189
|
{chain, db, config, logger, metrics, events, gossipHandlers, core, aggregatorTracker},
|
|
@@ -545,16 +520,6 @@ export class Network implements INetwork {
|
|
|
545
520
|
);
|
|
546
521
|
}
|
|
547
522
|
|
|
548
|
-
async publishInclusionList(signedInclusionList: heze.SignedInclusionList): Promise<number> {
|
|
549
|
-
const epoch = computeEpochAtSlot(signedInclusionList.message.slot);
|
|
550
|
-
const boundary = this.config.getForkBoundaryAtEpoch(epoch);
|
|
551
|
-
|
|
552
|
-
return this.publishGossip<GossipType.inclusion_list>(
|
|
553
|
-
{type: GossipType.inclusion_list, boundary},
|
|
554
|
-
signedInclusionList
|
|
555
|
-
);
|
|
556
|
-
}
|
|
557
|
-
|
|
558
523
|
async publishProposerPreferences(signedProposerPreferences: gloas.SignedProposerPreferences): Promise<number> {
|
|
559
524
|
const epoch = computeEpochAtSlot(signedProposerPreferences.message.proposalSlot);
|
|
560
525
|
const boundary = this.config.getForkBoundaryAtEpoch(epoch);
|
package/src/network/options.ts
CHANGED
|
@@ -28,7 +28,6 @@ export interface NetworkOptions
|
|
|
28
28
|
/** Include the version in libp2p Identify. Private mode takes precedence. */
|
|
29
29
|
advertiseVersion?: boolean;
|
|
30
30
|
private?: boolean;
|
|
31
|
-
useWorker?: boolean;
|
|
32
31
|
maxYoungGenerationSizeMb?: number;
|
|
33
32
|
disableLightClientServer?: boolean;
|
|
34
33
|
/**
|
|
@@ -67,7 +66,6 @@ export const defaultNetworkOptions: NetworkOptions = {
|
|
|
67
66
|
/** disabled by default */
|
|
68
67
|
discv5: null,
|
|
69
68
|
rateLimitMultiplier: 1,
|
|
70
|
-
useWorker: true,
|
|
71
69
|
// set after testing before 1.19.0, see https://github.com/ChainSafe/lodestar/issues/6596
|
|
72
70
|
disableFloodPublish: true,
|
|
73
71
|
// default set via research in https://github.com/ChainSafe/lodestar/issues/2115
|
|
@@ -4,7 +4,7 @@ import {ENR} from "@chainsafe/enr";
|
|
|
4
4
|
import {BeaconConfig} from "@lodestar/config";
|
|
5
5
|
import {LoggerNode} from "@lodestar/logger/node";
|
|
6
6
|
import {ATTESTATION_SUBNET_COUNT, ForkSeq, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params";
|
|
7
|
-
import {
|
|
7
|
+
import {SubnetID} from "@lodestar/types";
|
|
8
8
|
import {bytesToInt, pruneSetToMax, sleep, toHex} from "@lodestar/utils";
|
|
9
9
|
import {IClock} from "../../util/clock.js";
|
|
10
10
|
import {getCustodyGroups} from "../../util/dataColumns.js";
|
|
@@ -252,32 +252,22 @@ export class PeerDiscovery {
|
|
|
252
252
|
}
|
|
253
253
|
cachedENRsReverse.reverse();
|
|
254
254
|
|
|
255
|
-
this.peersToConnect
|
|
255
|
+
this.peersToConnect = peersToConnect;
|
|
256
256
|
|
|
257
257
|
// starting from PeerDAS, we need to prioritize column subnet peers first in order to have stable subnet sampling
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
cachedENRsToDial.set(cachedENR.peerId.toString(), cachedENR);
|
|
268
|
-
|
|
269
|
-
if (++cachedENRsInGroup >= maxPeersToConnect) {
|
|
270
|
-
continue group;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
const groupPeersToConnect = Math.max(maxPeersToConnect - cachedENRsInGroup, 0);
|
|
275
|
-
this.custodyGroupQueries.set(group, groupPeersToConnect);
|
|
276
|
-
groupsToDiscover.add(group);
|
|
277
|
-
groupPeersToDiscover += groupPeersToConnect;
|
|
258
|
+
this.custodyGroupQueries.clear();
|
|
259
|
+
if (this.config.getForkSeq(this.clock.currentSlot) >= ForkSeq.fulu) {
|
|
260
|
+
for (const [group, count] of custodyGroupRequests) {
|
|
261
|
+
if (count > 0) this.custodyGroupQueries.set(group, count);
|
|
262
|
+
}
|
|
263
|
+
for (const cachedENR of cachedENRsReverse) {
|
|
264
|
+
if (this.custodyGroupQueries.size === 0) break;
|
|
265
|
+
if (this.consumeCustodyGroupRequests(cachedENR)) {
|
|
266
|
+
cachedENRsToDial.set(cachedENR.peerId.toString(), cachedENR);
|
|
278
267
|
}
|
|
279
268
|
}
|
|
280
269
|
}
|
|
270
|
+
const groupPeersToDiscover = Array.from(this.custodyGroupQueries.values()).reduce((sum, count) => sum + count, 0);
|
|
281
271
|
|
|
282
272
|
subnet: for (const subnetRequest of subnetRequests) {
|
|
283
273
|
// Get cached ENRs from the discovery service that are in the requested `subnetId`, but not connected yet
|
|
@@ -312,7 +302,7 @@ export class PeerDiscovery {
|
|
|
312
302
|
}
|
|
313
303
|
|
|
314
304
|
// If subnetRequests won't connect enough peers for peersToConnect, add more
|
|
315
|
-
if (cachedENRsToDial.size < peersToConnect) {
|
|
305
|
+
if (groupPeersToDiscover === 0 && cachedENRsToDial.size < peersToConnect) {
|
|
316
306
|
for (const cachedENR of cachedENRsReverse) {
|
|
317
307
|
cachedENRsToDial.set(cachedENR.peerId.toString(), cachedENR);
|
|
318
308
|
if (cachedENRsToDial.size >= peersToConnect) {
|
|
@@ -330,7 +320,8 @@ export class PeerDiscovery {
|
|
|
330
320
|
}
|
|
331
321
|
|
|
332
322
|
// Run a discv5 subnet query to try to discover new peers
|
|
333
|
-
const shouldRunFindRandomNodeQuery =
|
|
323
|
+
const shouldRunFindRandomNodeQuery =
|
|
324
|
+
groupPeersToDiscover > 0 || subnetsToDiscoverPeers.length > 0 || cachedENRsToDial.size < peersToConnect;
|
|
334
325
|
if (shouldRunFindRandomNodeQuery) {
|
|
335
326
|
void this.runFindRandomNodeQuery();
|
|
336
327
|
}
|
|
@@ -339,7 +330,7 @@ export class PeerDiscovery {
|
|
|
339
330
|
peersToConnect,
|
|
340
331
|
peersAvailableToDial: cachedENRsToDial.size,
|
|
341
332
|
subnetsToDiscover: subnetsToDiscoverPeers.length,
|
|
342
|
-
groupsToDiscover: Array.from(
|
|
333
|
+
groupsToDiscover: Array.from(this.custodyGroupQueries.keys()).join(","),
|
|
343
334
|
groupPeersToDiscover,
|
|
344
335
|
shouldRunFindRandomNodeQuery,
|
|
345
336
|
});
|
|
@@ -411,7 +402,14 @@ export class PeerDiscovery {
|
|
|
411
402
|
if (this.randomNodeQuery.code === QueryStatusCode.Active) {
|
|
412
403
|
this.randomNodeQuery.count++;
|
|
413
404
|
}
|
|
414
|
-
|
|
405
|
+
let peerId: PeerId;
|
|
406
|
+
try {
|
|
407
|
+
peerId = enr.peerId;
|
|
408
|
+
} catch (e) {
|
|
409
|
+
this.logger.debug("Discovered ENR with invalid public key", {nodeId: enr.nodeId}, e as Error);
|
|
410
|
+
this.metrics?.discovery.discoveredStatus.inc({status: DiscoveredPeerStatus.error});
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
415
413
|
// At least one transport is known to be present, checked inside the worker
|
|
416
414
|
const multiaddrTCP = enr.getLocationMultiaddr(ENRKey.tcp);
|
|
417
415
|
const multiaddrQUIC = enr.getLocationMultiaddr(ENRKey.quic);
|
|
@@ -530,32 +528,24 @@ export class PeerDiscovery {
|
|
|
530
528
|
}
|
|
531
529
|
}
|
|
532
530
|
|
|
533
|
-
private
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
// given SAMPLES_PER_SLOT = 8 and 100 peers, we have 800 custody columns from peers
|
|
539
|
-
// with NUMBER_OF_CUSTODY_GROUPS = 128, we have 800 / 128 = 6.25 peers per column in average
|
|
540
|
-
// it would not be hard to find TARGET_SUBNET_PEERS(6) peers per sampling columns columns and TARGET_GROUP_PEERS_PER_SUBNET(4) peers per non-sampling columns
|
|
541
|
-
// after some first heartbeats, we should have no more column requested, then go with conditions of prior forks
|
|
542
|
-
let hasMatchingGroup = false;
|
|
543
|
-
let custodyGroupRequestCount = 0;
|
|
544
|
-
for (const [group, peersToConnect] of this.custodyGroupQueries.entries()) {
|
|
545
|
-
if (peersToConnect <= 0) {
|
|
546
|
-
this.custodyGroupQueries.delete(group);
|
|
547
|
-
} else if (peer.custodyGroups.includes(group)) {
|
|
548
|
-
this.custodyGroupQueries.set(group, Math.max(0, peersToConnect - 1));
|
|
549
|
-
hasMatchingGroup = true;
|
|
550
|
-
custodyGroupRequestCount += peersToConnect;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
531
|
+
private consumeCustodyGroupRequests(peer: CachedENR): boolean {
|
|
532
|
+
let matched = false;
|
|
533
|
+
for (const group of peer.custodyGroups ?? []) {
|
|
534
|
+
const remaining = this.custodyGroupQueries.get(group);
|
|
535
|
+
if (remaining === undefined) continue;
|
|
553
536
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
537
|
+
if (remaining === 1) this.custodyGroupQueries.delete(group);
|
|
538
|
+
else this.custodyGroupQueries.set(group, remaining - 1);
|
|
539
|
+
matched = true;
|
|
540
|
+
}
|
|
541
|
+
return matched;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
private shouldDialPeer(peer: CachedENR): boolean {
|
|
545
|
+
const needsCustodyPeers = this.custodyGroupQueries.size > 0;
|
|
546
|
+
if (needsCustodyPeers && !this.consumeCustodyGroupRequests(peer)) {
|
|
547
|
+
this.metrics?.discovery.notDialReason.inc({reason: NotDialReason.not_contain_requested_sampling_groups});
|
|
548
|
+
return false;
|
|
559
549
|
}
|
|
560
550
|
|
|
561
551
|
// logics up to Deneb fork
|
|
@@ -580,7 +570,7 @@ export class PeerDiscovery {
|
|
|
580
570
|
// ideally we may want to leave this cheap condition at the top of the function
|
|
581
571
|
// however we want to also update peersToConnect in this.subnetRequests
|
|
582
572
|
// the this.subnetRequests[type] gradually has 0 subnet so this function should be cheap enough
|
|
583
|
-
if (this.peersToConnect > 0) {
|
|
573
|
+
if (needsCustodyPeers || this.peersToConnect > 0) {
|
|
584
574
|
return true;
|
|
585
575
|
}
|
|
586
576
|
|
|
@@ -85,8 +85,7 @@ export class PeerRpcScoreStore implements IPeerRpcScoreStore {
|
|
|
85
85
|
for (const [peerIdStr, peerScore] of this.scores) {
|
|
86
86
|
const newScore = peerScore.update();
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
if (Math.abs(newScore) < SCORE_THRESHOLD) {
|
|
88
|
+
if (Math.abs(newScore) < SCORE_THRESHOLD && !peerScore.isCoolingDown()) {
|
|
90
89
|
this.scores.delete(peerIdStr);
|
|
91
90
|
}
|
|
92
91
|
}
|