@lodestar/beacon-node 1.52.0-dev.53c3aab4e9 → 1.52.0-dev.643dd3c5bf
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 +63 -39
- 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 +3 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +2 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +6 -2
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +19 -11
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +4 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +4 -0
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +7 -0
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +8 -4
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +3 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +25 -5
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +3 -17
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +21 -17
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +3 -3
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +7 -5
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +2 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +2 -2
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +3 -3
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
- package/lib/chain/bls/utils.js +1 -1
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +6 -5
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +83 -31
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +15 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +8 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +9 -3
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +2 -1
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +55 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +8 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +1 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +1 -4
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.d.ts +5 -3
- package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.js +34 -11
- package/lib/chain/forkChoiceExecutionEngine.js.map +1 -1
- package/lib/chain/interface.d.ts +1 -1
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +13 -6
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +95 -115
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/inclusionListStore.d.ts +4 -1
- package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -1
- package/lib/chain/opPools/inclusionListStore.js +5 -2
- package/lib/chain/opPools/inclusionListStore.js.map +1 -1
- package/lib/chain/opPools/opPool.js +6 -6
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/options.js +2 -2
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +45 -0
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +265 -69
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -0
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +23 -15
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts +1 -0
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js +1 -1
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.d.ts +8 -2
- package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.js +43 -6
- package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +13 -4
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.js +13 -12
- package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +5 -0
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +39 -1
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +37 -9
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +32 -16
- 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 +9 -1
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +8 -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 +47 -42
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +100 -9
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +9 -0
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +39 -6
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/execution/engine/blockHash.d.ts +12 -0
- package/lib/execution/engine/blockHash.d.ts.map +1 -0
- package/lib/execution/engine/blockHash.js +17 -0
- package/lib/execution/engine/blockHash.js.map +1 -0
- package/lib/execution/engine/http.d.ts +2 -2
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +13 -7
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +16 -3
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js +11 -0
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.d.ts +2 -0
- package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.js +14 -6
- package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -2
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +4 -4
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -6
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +6 -1
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js +7 -2
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/restHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/restHttpClient.js +9 -5
- package/lib/execution/engine/restHttpClient.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -2
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +4 -4
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/signal.d.ts +6 -0
- package/lib/execution/engine/signal.d.ts.map +1 -0
- package/lib/execution/engine/signal.js +24 -0
- package/lib/execution/engine/signal.js.map +1 -0
- package/lib/execution/engine/transport.d.ts +2 -2
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +9 -0
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +16 -2
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +3 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +42 -28
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/core/events.d.ts +6 -2
- package/lib/network/core/events.d.ts.map +1 -1
- package/lib/network/core/events.js +9 -0
- package/lib/network/core/events.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +3 -2
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +1 -0
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +5 -2
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +1 -7
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +0 -13
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/network.d.ts +1 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +26 -12
- package/lib/network/network.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +22 -2
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +2 -0
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +11 -2
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +19 -6
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +4 -1
- 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 +4 -2
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/utils/collect.d.ts +4 -4
- package/lib/network/reqresp/utils/collect.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collect.js +9 -8
- package/lib/network/reqresp/utils/collect.js.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +2 -2
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
- package/lib/sync/range/batch.d.ts +10 -0
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +29 -0
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +17 -2
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +60 -20
- 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 +44 -3
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/range/utils/batches.d.ts +20 -4
- package/lib/sync/range/utils/batches.d.ts.map +1 -1
- package/lib/sync/range/utils/batches.js +31 -13
- package/lib/sync/range/utils/batches.js.map +1 -1
- package/lib/sync/range/utils/peerBalancer.d.ts +1 -1
- package/lib/sync/range/utils/peerBalancer.d.ts.map +1 -1
- package/lib/sync/range/utils/peerBalancer.js +5 -2
- package/lib/sync/range/utils/peerBalancer.js.map +1 -1
- package/lib/sync/types.d.ts +14 -1
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +2 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +28 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +340 -27
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +22 -1
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +55 -25
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +24 -2
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +48 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/asyncIterableToEvents.d.ts +20 -3
- package/lib/util/asyncIterableToEvents.d.ts.map +1 -1
- package/lib/util/asyncIterableToEvents.js +76 -20
- package/lib/util/asyncIterableToEvents.js.map +1 -1
- package/lib/util/dataColumns.d.ts +1 -1
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +4 -1
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/eventLoop.d.ts +3 -3
- package/lib/util/eventLoop.d.ts.map +1 -1
- package/lib/util/eventLoop.js +3 -3
- package/lib/util/eventLoop.js.map +1 -1
- package/package.json +27 -27
- package/src/api/impl/beacon/blocks/index.ts +74 -47
- package/src/api/impl/beacon/pool/index.ts +9 -7
- package/src/api/impl/beacon/state/utils.ts +2 -1
- package/src/api/impl/debug/index.ts +6 -2
- package/src/api/impl/validator/index.ts +21 -11
- package/src/chain/ColumnReconstructionTracker.ts +5 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +9 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +1 -1
- package/src/chain/archiveStore/utils/pruneHistory.ts +9 -4
- package/src/chain/blocks/blockInput/blockInput.ts +4 -1
- package/src/chain/blocks/importExecutionPayload.ts +30 -4
- package/src/chain/blocks/index.ts +3 -31
- package/src/chain/blocks/verifyBlock.ts +24 -17
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +4 -4
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +7 -4
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -0
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +5 -4
- package/src/chain/bls/utils.ts +1 -1
- package/src/chain/chain.ts +116 -48
- package/src/chain/errors/attestationError.ts +11 -1
- package/src/chain/errors/executionPayloadBid.ts +9 -2
- package/src/chain/errors/executionPayloadEnvelope.ts +58 -0
- package/src/chain/forkChoice/index.ts +1 -4
- package/src/chain/forkChoiceExecutionEngine.ts +48 -15
- package/src/chain/interface.ts +1 -1
- package/src/chain/lightClient/index.ts +108 -142
- package/src/chain/opPools/inclusionListStore.ts +5 -2
- package/src/chain/opPools/opPool.ts +6 -6
- package/src/chain/options.ts +2 -2
- package/src/chain/prepareNextSlot.ts +347 -89
- package/src/chain/produceBlock/produceBlockBody.ts +25 -16
- package/src/chain/seenCache/seenAttesters.ts +1 -1
- package/src/chain/seenCache/seenBlockAttesters.ts +48 -6
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +35 -15
- package/src/chain/shufflingCache.ts +40 -1
- package/src/chain/validation/aggregateAndProof.ts +43 -14
- package/src/chain/validation/attestation.ts +31 -20
- package/src/chain/validation/block.ts +9 -1
- package/src/chain/validation/dataColumnSidecar.ts +7 -1
- package/src/chain/validation/executionPayloadBid.ts +60 -44
- package/src/chain/validation/executionPayloadEnvelope.ts +115 -8
- package/src/chain/validation/payloadAttestationMessage.ts +10 -0
- package/src/chain/validation/voluntaryExit.ts +44 -6
- package/src/execution/engine/blockHash.ts +27 -0
- package/src/execution/engine/http.ts +18 -10
- package/src/execution/engine/interface.ts +18 -3
- package/src/execution/engine/jsonRpcHttpClient.ts +26 -14
- package/src/execution/engine/jsonRpcTransport.ts +8 -4
- package/src/execution/engine/mock.ts +13 -8
- package/src/execution/engine/payloadIdCache.ts +12 -4
- package/src/execution/engine/restHttpClient.ts +17 -11
- package/src/execution/engine/restTransport.ts +5 -4
- package/src/execution/engine/signal.ts +28 -0
- package/src/execution/engine/transport.ts +3 -2
- package/src/index.ts +6 -1
- package/src/metrics/metrics/beacon.ts +20 -2
- package/src/metrics/metrics/lodestar.ts +42 -28
- package/src/network/core/events.ts +12 -0
- package/src/network/core/networkCoreWorkerHandler.ts +6 -2
- package/src/network/gossip/gossipsub.ts +6 -2
- package/src/network/gossip/topic.ts +1 -14
- package/src/network/network.ts +39 -13
- package/src/network/peers/peerManager.ts +26 -2
- package/src/network/peers/utils/prioritizePeers.ts +14 -1
- package/src/network/processor/gossipHandlers.ts +25 -13
- package/src/network/processor/gossipValidatorFn.ts +4 -0
- package/src/network/processor/index.ts +7 -2
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +1 -1
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +1 -1
- package/src/network/reqresp/utils/collect.ts +16 -8
- package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +3 -2
- package/src/sync/range/batch.ts +33 -0
- package/src/sync/range/chain.ts +72 -17
- package/src/sync/range/range.ts +57 -3
- package/src/sync/range/utils/batches.ts +38 -13
- package/src/sync/range/utils/peerBalancer.ts +4 -1
- package/src/sync/types.ts +13 -0
- package/src/sync/unknownBlock.ts +389 -29
- package/src/sync/utils/downloadByRange.ts +89 -29
- package/src/sync/utils/downloadByRoot.ts +75 -7
- package/src/util/asyncIterableToEvents.ts +100 -21
- package/src/util/dataColumns.ts +4 -1
- package/src/util/eventLoop.ts +3 -3
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ReqOpts,
|
|
7
7
|
} from "./jsonRpcHttpClient.js";
|
|
8
8
|
import {JwtClaim, encodeJwtToken} from "./jwt.js";
|
|
9
|
+
import {withRequestSignal} from "./signal.js";
|
|
9
10
|
import {ExecutionForkName} from "./sszTypes.js";
|
|
10
11
|
|
|
11
12
|
export const ENGINE_REST_BASE_PATH = "/engine/v1";
|
|
@@ -115,15 +116,18 @@ export class EngineRestHttpClient {
|
|
|
115
116
|
/** Perform request with retries without emitting events, used to probe support for the REST API */
|
|
116
117
|
async requestWithRetries(req: EngineRestRequest, opts?: ReqOpts): Promise<EngineRestResponse> {
|
|
117
118
|
const routeId = opts?.routeId ?? "unknown";
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
// The delay between retries has to end with the request signal as well
|
|
120
|
+
return withRequestSignal(this.opts.signal, opts?.signal, (signal) =>
|
|
121
|
+
retry(() => this.requestAnyUrl(req, opts), {
|
|
122
|
+
retries: opts?.retries ?? this.opts.retries ?? 0,
|
|
123
|
+
retryDelay: opts?.retryDelay ?? this.opts.retryDelay,
|
|
124
|
+
shouldRetry: opts?.shouldRetry ?? isRetryableEngineRestError,
|
|
125
|
+
signal,
|
|
126
|
+
onRetry: () => {
|
|
127
|
+
this.metrics?.retryCount.inc({routeId});
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
);
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
private async requestAnyUrl(req: EngineRestRequest, opts?: ReqOpts): Promise<EngineRestResponse> {
|
|
@@ -154,7 +158,8 @@ export class EngineRestHttpClient {
|
|
|
154
158
|
// Not AbortSignal.any(), Node retains every composite until the long-lived parent signal aborts
|
|
155
159
|
const onParentSignalAbort = (): void => controller.abort();
|
|
156
160
|
this.opts.signal?.addEventListener("abort", onParentSignalAbort, {once: true});
|
|
157
|
-
|
|
161
|
+
opts?.signal?.addEventListener("abort", onParentSignalAbort, {once: true});
|
|
162
|
+
if (this.opts.signal?.aborted || opts?.signal?.aborted) {
|
|
158
163
|
controller.abort();
|
|
159
164
|
}
|
|
160
165
|
|
|
@@ -223,7 +228,7 @@ export class EngineRestHttpClient {
|
|
|
223
228
|
} catch (e) {
|
|
224
229
|
this.metrics?.requestErrors.inc({routeId});
|
|
225
230
|
if (controller.signal.aborted) {
|
|
226
|
-
if (this.opts.signal?.aborted) {
|
|
231
|
+
if (this.opts.signal?.aborted || opts?.signal?.aborted) {
|
|
227
232
|
throw new ErrorAborted("request");
|
|
228
233
|
}
|
|
229
234
|
throw new TimeoutError("request");
|
|
@@ -235,6 +240,7 @@ export class EngineRestHttpClient {
|
|
|
235
240
|
|
|
236
241
|
clearTimeout(timeout);
|
|
237
242
|
this.opts.signal?.removeEventListener("abort", onParentSignalAbort);
|
|
243
|
+
opts?.signal?.removeEventListener("abort", onParentSignalAbort);
|
|
238
244
|
}
|
|
239
245
|
}
|
|
240
246
|
}
|
|
@@ -241,7 +241,8 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
241
241
|
headBlockHash: RootHex,
|
|
242
242
|
safeBlockHash: RootHex,
|
|
243
243
|
finalizedBlockHash: RootHex,
|
|
244
|
-
payloadAttributes?: PayloadAttributes
|
|
244
|
+
payloadAttributes?: PayloadAttributes,
|
|
245
|
+
signal?: AbortSignal
|
|
245
246
|
): Promise<ForkchoiceUpdatedResult> {
|
|
246
247
|
const forkchoiceState = {
|
|
247
248
|
headBlockHash: fromHex(headBlockHash),
|
|
@@ -279,7 +280,7 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
279
280
|
|
|
280
281
|
const res = await this.client.request(
|
|
281
282
|
{method: "POST", path: "/forkchoice", executionFork: toExecutionForkName(fork), body, responseType: "ssz"},
|
|
282
|
-
fcUReqOpts
|
|
283
|
+
{...fcUReqOpts, signal}
|
|
283
284
|
);
|
|
284
285
|
const {payloadStatus, payloadId} = deserializeResponse(
|
|
285
286
|
ForkchoiceUpdateResponse,
|
|
@@ -293,14 +294,14 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
296
|
|
|
296
|
-
async getPayload(fork: ForkName, payloadId: PayloadId): Promise<GetPayloadResult> {
|
|
297
|
+
async getPayload(fork: ForkName, payloadId: PayloadId, signal?: AbortSignal): Promise<GetPayloadResult> {
|
|
297
298
|
if (!PAYLOAD_ID_REGEX.test(payloadId)) {
|
|
298
299
|
throw Error(`Invalid payloadId=${payloadId}, expected 0x prefixed 8 bytes hex`);
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
const res = await this.client.request(
|
|
302
303
|
{method: "GET", path: `/payloads/${payloadId}`, executionFork: toExecutionForkName(fork), responseType: "ssz"},
|
|
303
|
-
getPayloadOpts
|
|
304
|
+
{...getPayloadOpts, signal}
|
|
304
305
|
);
|
|
305
306
|
|
|
306
307
|
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `fn` with a signal that aborts with either the signal of the client or the signal of a single request.
|
|
3
|
+
* Not AbortSignal.any(), Node retains every composite until the long-lived client signal aborts.
|
|
4
|
+
*/
|
|
5
|
+
export async function withRequestSignal<T>(
|
|
6
|
+
clientSignal: AbortSignal | undefined,
|
|
7
|
+
requestSignal: AbortSignal | undefined,
|
|
8
|
+
fn: (signal: AbortSignal | undefined) => Promise<T>
|
|
9
|
+
): Promise<T> {
|
|
10
|
+
if (requestSignal === undefined) {
|
|
11
|
+
return fn(clientSignal);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const controller = new AbortController();
|
|
15
|
+
const onAbort = (): void => controller.abort();
|
|
16
|
+
clientSignal?.addEventListener("abort", onAbort, {once: true});
|
|
17
|
+
requestSignal.addEventListener("abort", onAbort, {once: true});
|
|
18
|
+
if (clientSignal?.aborted || requestSignal.aborted) {
|
|
19
|
+
controller.abort();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
return await fn(controller.signal);
|
|
24
|
+
} finally {
|
|
25
|
+
clientSignal?.removeEventListener("abort", onAbort);
|
|
26
|
+
requestSignal.removeEventListener("abort", onAbort);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -42,10 +42,11 @@ export interface IEngineTransport {
|
|
|
42
42
|
headBlockHash: RootHex,
|
|
43
43
|
safeBlockHash: RootHex,
|
|
44
44
|
finalizedBlockHash: RootHex,
|
|
45
|
-
payloadAttributes?: PayloadAttributes
|
|
45
|
+
payloadAttributes?: PayloadAttributes,
|
|
46
|
+
signal?: AbortSignal
|
|
46
47
|
): Promise<ForkchoiceUpdatedResult>;
|
|
47
48
|
|
|
48
|
-
getPayload(fork: ForkName, payloadId: PayloadId): Promise<GetPayloadResult>;
|
|
49
|
+
getPayload(fork: ForkName, payloadId: PayloadId, signal?: AbortSignal): Promise<GetPayloadResult>;
|
|
49
50
|
|
|
50
51
|
getPayloadBodiesByHashV2(blockHashes: RootHex[]): Promise<(ExecutionPayloadBodyV2 | null)[]>;
|
|
51
52
|
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,12 @@ export {DbCPStateDatastore} from "./chain/stateCache/datastore/db.js";
|
|
|
7
7
|
export {FileCPStateDatastore} from "./chain/stateCache/datastore/file.js";
|
|
8
8
|
export {BeaconDb, type IBeaconDb} from "./db/index.js";
|
|
9
9
|
// Export execution engine to make it usable by builder
|
|
10
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
ExecutionEngineError,
|
|
12
|
+
ExecutionEngineErrorCode,
|
|
13
|
+
ExecutionPayloadStatus,
|
|
14
|
+
initializeExecutionEngine,
|
|
15
|
+
} from "./execution/index.js";
|
|
11
16
|
// Export metrics utilities to de-duplicate validator metrics
|
|
12
17
|
export {
|
|
13
18
|
type HttpMetricsServer,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {ProducedBlockSource} from "@lodestar/types";
|
|
2
2
|
import {BlockSelectionResult} from "../../api/impl/validator/index.js";
|
|
3
3
|
import {InclusionListSource} from "../../chain/blocks/types.js";
|
|
4
|
+
import {PreparePayloadReason} from "../../chain/prepareNextSlot.js";
|
|
4
5
|
import {BlockProductionStep, PayloadPreparationType} from "../../chain/produceBlock/index.js";
|
|
5
6
|
import {RegistryMetricCreator} from "../utils/registryMetricCreator.js";
|
|
6
7
|
|
|
@@ -160,17 +161,25 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
|
|
|
160
161
|
|
|
161
162
|
blockPayload: {
|
|
162
163
|
payloadAdvancePrepTime: register.histogram({
|
|
163
|
-
name: "
|
|
164
|
+
name: "beacon_block_payload_prepare_time_seconds",
|
|
164
165
|
help: "Time for preparing payload in advance",
|
|
165
166
|
buckets: [0.1, 1, 3, 5, 10],
|
|
166
167
|
}),
|
|
168
|
+
payloadReprepare: register.counter<{
|
|
169
|
+
reason: PreparePayloadReason;
|
|
170
|
+
result: "changed" | "unchanged" | "dropped" | "error";
|
|
171
|
+
}>({
|
|
172
|
+
name: "beacon_block_payload_reprepare_total",
|
|
173
|
+
help: "Re-runs of the next slot payload preparation after the scheduled run, by reason and result: prepared again as the head or its parent payload changed, unchanged, dropped as the proposal slot started, or failed",
|
|
174
|
+
labelNames: ["reason", "result"],
|
|
175
|
+
}),
|
|
167
176
|
executionPayloadEnvelopeProcessingTime: register.histogram({
|
|
168
177
|
name: "beacon_block_payload_envelope_processing_seconds",
|
|
169
178
|
help: "Time to process execution payload envelope during block production",
|
|
170
179
|
buckets: [0.005, 0.01, 0.05, 0.1, 0.2, 0.5, 1],
|
|
171
180
|
}),
|
|
172
181
|
payloadFetchedTime: register.histogram<{prepType: PayloadPreparationType}>({
|
|
173
|
-
name: "
|
|
182
|
+
name: "beacon_block_payload_fetched_time_seconds",
|
|
174
183
|
help: "Time to fetch the payload from EL",
|
|
175
184
|
labelNames: ["prepType"],
|
|
176
185
|
buckets: [0.1, 0.2, 0.3, 0.5, 0.7, 1, 2],
|
|
@@ -334,6 +343,15 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
|
|
|
334
343
|
help: "Time taken to compute data column sidecars, including cells and inclusion proof",
|
|
335
344
|
buckets: [0.1, 0.25, 0.5, 0.75, 1, 2, 5],
|
|
336
345
|
}),
|
|
346
|
+
dataColumnSidecarProposerSignatureChecks: register.counter<{result: "cache_hit" | "verification"}>({
|
|
347
|
+
name: "beacon_data_column_sidecar_proposer_signature_checks_total",
|
|
348
|
+
help: "Gossip data column proposer signature checks answered by the cache or by a started verification",
|
|
349
|
+
labelNames: ["result"],
|
|
350
|
+
}),
|
|
351
|
+
dataColumnSidecarProposerSignatureBlocks: register.counter({
|
|
352
|
+
name: "beacon_data_column_sidecar_proposer_signature_blocks_total",
|
|
353
|
+
help: "Blocks whose proposer signature a gossip data column verified and cached first",
|
|
354
|
+
}),
|
|
337
355
|
dataColumnSidecarInclusionProofVerificationTime: register.histogram({
|
|
338
356
|
name: "beacon_data_column_sidecar_inclusion_proof_verification_seconds",
|
|
339
357
|
help: "Time taken to verify data_column sidecar inclusion proof",
|
|
@@ -68,7 +68,7 @@ export function createLodestarMetrics(
|
|
|
68
68
|
if (genesisTime) {
|
|
69
69
|
register
|
|
70
70
|
.gauge({
|
|
71
|
-
name: "
|
|
71
|
+
name: "lodestar_genesis_time_seconds",
|
|
72
72
|
help: "Genesis time in seconds",
|
|
73
73
|
})
|
|
74
74
|
.set(genesisTime);
|
|
@@ -565,13 +565,13 @@ export function createLodestarMetrics(
|
|
|
565
565
|
}),
|
|
566
566
|
// To measure the time cost of main thread <-> worker message passing
|
|
567
567
|
latencyToWorker: register.histogram({
|
|
568
|
-
name: "
|
|
568
|
+
name: "lodestar_bls_thread_pool_latency_to_worker_seconds",
|
|
569
569
|
help: "Time from sending the job to the worker and the worker receiving it",
|
|
570
570
|
// The dashboard treats 20ms as slow; values above 100ms only need severe-stall classification.
|
|
571
571
|
buckets: [0.00025, 0.001, 0.005, 0.02, 0.1],
|
|
572
572
|
}),
|
|
573
573
|
latencyFromWorker: register.histogram({
|
|
574
|
-
name: "
|
|
574
|
+
name: "lodestar_bls_thread_pool_latency_from_worker_seconds",
|
|
575
575
|
help: "Time from the worker sending the result and the main thread receiving it",
|
|
576
576
|
buckets: [0.00025, 0.001, 0.005, 0.02, 0.1],
|
|
577
577
|
}),
|
|
@@ -775,7 +775,7 @@ export function createLodestarMetrics(
|
|
|
775
775
|
labelNames: ["reason"],
|
|
776
776
|
}),
|
|
777
777
|
elapsedTimeTillReceived: register.histogram({
|
|
778
|
-
name: "
|
|
778
|
+
name: "lodestar_sync_unknown_block_elapsed_time_till_received_seconds",
|
|
779
779
|
help: "Time elapsed between block slot time and the time block received via unknown block sync",
|
|
780
780
|
buckets: [0.5, 1, 2, 4, 6, 12],
|
|
781
781
|
}),
|
|
@@ -930,86 +930,86 @@ export function createLodestarMetrics(
|
|
|
930
930
|
// Gossip block
|
|
931
931
|
gossipBlock: {
|
|
932
932
|
elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
|
|
933
|
-
name: "
|
|
933
|
+
name: "lodestar_gossip_block_elapsed_time_till_received_seconds",
|
|
934
934
|
help: "Time elapsed between block slot time and the time block received via gossip",
|
|
935
935
|
labelNames: ["source"],
|
|
936
936
|
buckets: [0.5, 1, 2, 4, 6, 12],
|
|
937
937
|
}),
|
|
938
938
|
elapsedTimeTillProcessed: register.histogram({
|
|
939
|
-
name: "
|
|
939
|
+
name: "lodestar_gossip_block_elapsed_time_till_processed_seconds",
|
|
940
940
|
help: "Time elapsed between block slot time and the time block processed",
|
|
941
941
|
buckets: [0.5, 1, 2, 4, 6, 12],
|
|
942
942
|
}),
|
|
943
943
|
|
|
944
944
|
gossipValidation: {
|
|
945
945
|
recvToValidation: register.histogram({
|
|
946
|
-
name: "
|
|
946
|
+
name: "lodestar_gossip_block_received_to_gossip_validate_seconds",
|
|
947
947
|
help: "Time elapsed between block received and block validated",
|
|
948
948
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
949
949
|
}),
|
|
950
950
|
validationTime: register.histogram({
|
|
951
|
-
name: "
|
|
951
|
+
name: "lodestar_gossip_block_gossip_validate_time_seconds",
|
|
952
952
|
help: "Time to apply gossip validations",
|
|
953
953
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
954
954
|
}),
|
|
955
955
|
},
|
|
956
956
|
stateTransition: {
|
|
957
957
|
recvToValidation: register.histogram({
|
|
958
|
-
name: "
|
|
958
|
+
name: "lodestar_gossip_block_received_to_state_transition_seconds",
|
|
959
959
|
help: "Time elapsed between block received and block state transition",
|
|
960
960
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
961
961
|
}),
|
|
962
962
|
validationTime: register.histogram({
|
|
963
|
-
name: "
|
|
963
|
+
name: "lodestar_gossip_block_state_transition_time_seconds",
|
|
964
964
|
help: "Time to validate block state transition",
|
|
965
965
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
966
966
|
}),
|
|
967
967
|
},
|
|
968
968
|
signatureVerification: {
|
|
969
969
|
recvToValidation: register.histogram({
|
|
970
|
-
name: "
|
|
970
|
+
name: "lodestar_gossip_block_received_to_signatures_verification_seconds",
|
|
971
971
|
help: "Time elapsed between block received and block signatures verification",
|
|
972
972
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
973
973
|
}),
|
|
974
974
|
validationTime: register.histogram({
|
|
975
|
-
name: "
|
|
975
|
+
name: "lodestar_gossip_block_signatures_verification_time_seconds",
|
|
976
976
|
help: "Time elapsed for block signatures verification",
|
|
977
977
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
978
978
|
}),
|
|
979
979
|
},
|
|
980
980
|
executionPayload: {
|
|
981
981
|
recvToValidation: register.histogram({
|
|
982
|
-
name: "
|
|
982
|
+
name: "lodestar_gossip_block_received_to_execution_payload_verification_seconds",
|
|
983
983
|
help: "Time elapsed between block received and execution payload verification",
|
|
984
984
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
985
985
|
}),
|
|
986
986
|
validationTime: register.histogram({
|
|
987
|
-
name: "
|
|
987
|
+
name: "lodestar_gossip_execution_payload_verification_time_seconds",
|
|
988
988
|
help: "Time elapsed for execution payload verification",
|
|
989
989
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
990
990
|
}),
|
|
991
991
|
},
|
|
992
992
|
blockImport: {
|
|
993
993
|
recvToValidation: register.histogram({
|
|
994
|
-
name: "
|
|
994
|
+
name: "lodestar_gossip_block_received_to_block_import_seconds",
|
|
995
995
|
help: "Time elapsed between block received and block import",
|
|
996
996
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
997
997
|
}),
|
|
998
998
|
validationTime: register.histogram({
|
|
999
|
-
name: "
|
|
999
|
+
name: "lodestar_gossip_block_block_import_time_seconds",
|
|
1000
1000
|
help: "Time elapsed for block import",
|
|
1001
1001
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
1002
1002
|
}),
|
|
1003
1003
|
},
|
|
1004
1004
|
|
|
1005
1005
|
receivedToBlobsAvailabilityTime: register.histogram<{numBlobs: number}>({
|
|
1006
|
-
name: "
|
|
1006
|
+
name: "lodestar_gossip_block_received_to_blobs_availability_time_seconds",
|
|
1007
1007
|
help: "Time elapsed between block received and blobs became available",
|
|
1008
1008
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
1009
1009
|
labelNames: ["numBlobs"],
|
|
1010
1010
|
}),
|
|
1011
1011
|
receivedToFullyVerifiedTime: register.histogram({
|
|
1012
|
-
name: "
|
|
1012
|
+
name: "lodestar_gossip_block_received_to_fully_verified_time_seconds",
|
|
1013
1013
|
help: "Time elapsed between block received and fully verified state, signatures and payload",
|
|
1014
1014
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
1015
1015
|
}),
|
|
@@ -1019,7 +1019,7 @@ export function createLodestarMetrics(
|
|
|
1019
1019
|
buckets: [0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.5, 1],
|
|
1020
1020
|
}),
|
|
1021
1021
|
verifiedToBlobsAvailabiltyTime: register.histogram<{numBlobs: number}>({
|
|
1022
|
-
name: "
|
|
1022
|
+
name: "lodestar_gossip_block_verified_to_blobs_availability_time_seconds",
|
|
1023
1023
|
help: "Time elapsed between block verified and blobs became available",
|
|
1024
1024
|
buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
|
|
1025
1025
|
labelNames: ["numBlobs"],
|
|
@@ -1045,12 +1045,12 @@ export function createLodestarMetrics(
|
|
|
1045
1045
|
},
|
|
1046
1046
|
gossipBlob: {
|
|
1047
1047
|
recvToValidation: register.histogram({
|
|
1048
|
-
name: "
|
|
1048
|
+
name: "lodestar_gossip_blob_received_to_gossip_validate_seconds",
|
|
1049
1049
|
help: "Time elapsed between blob received and blob validation",
|
|
1050
1050
|
buckets: [0.05, 0.1, 0.2, 0.5, 1, 1.5, 2, 4],
|
|
1051
1051
|
}),
|
|
1052
1052
|
validationTime: register.histogram({
|
|
1053
|
-
name: "
|
|
1053
|
+
name: "lodestar_gossip_blob_gossip_validate_time_seconds",
|
|
1054
1054
|
help: "Time elapsed for blob validation",
|
|
1055
1055
|
buckets: [0.05, 0.1, 0.2, 0.5, 1, 1.5, 2, 4],
|
|
1056
1056
|
}),
|
|
@@ -1058,7 +1058,7 @@ export function createLodestarMetrics(
|
|
|
1058
1058
|
// Gossip execution payload envelope
|
|
1059
1059
|
gossipExecutionPayloadEnvelope: {
|
|
1060
1060
|
elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
|
|
1061
|
-
name: "
|
|
1061
|
+
name: "lodestar_gossip_execution_payload_envelope_elapsed_time_till_received_seconds",
|
|
1062
1062
|
help: "Time elapsed between slot time and the time execution payload envelope received",
|
|
1063
1063
|
labelNames: ["source"],
|
|
1064
1064
|
buckets: [0.5, 1, 2, 4, 6, 12],
|
|
@@ -1068,6 +1068,11 @@ export function createLodestarMetrics(
|
|
|
1068
1068
|
help: "Count of errors, by error type, while processing execution payload envelopes",
|
|
1069
1069
|
labelNames: ["error"],
|
|
1070
1070
|
}),
|
|
1071
|
+
blockHashTime: register.histogram({
|
|
1072
|
+
name: "lodestar_gossip_execution_payload_envelope_block_hash_seconds",
|
|
1073
|
+
help: "Time to compute the execution block hash of a gossip execution payload envelope",
|
|
1074
|
+
buckets: [0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.5, 1],
|
|
1075
|
+
}),
|
|
1071
1076
|
executionPayload: {
|
|
1072
1077
|
recvToValidation: register.histogram({
|
|
1073
1078
|
name: "lodestar_gossip_execution_payload_envelope_received_to_execution_payload_verification_seconds",
|
|
@@ -1157,7 +1162,7 @@ export function createLodestarMetrics(
|
|
|
1157
1162
|
help: "Count persisting block with serialized data",
|
|
1158
1163
|
}),
|
|
1159
1164
|
elapsedTimeTillBecomeHead: register.histogram({
|
|
1160
|
-
name: "
|
|
1165
|
+
name: "lodestar_gossip_block_elapsed_time_till_become_head_seconds",
|
|
1161
1166
|
help: "Time elapsed between block slot time and the time block becomes head",
|
|
1162
1167
|
buckets: [0.5, 1, 2, 4, 6, 12],
|
|
1163
1168
|
}),
|
|
@@ -1595,7 +1600,7 @@ export function createLodestarMetrics(
|
|
|
1595
1600
|
help: "Avg min max of all state cache items total read count",
|
|
1596
1601
|
}),
|
|
1597
1602
|
secondsSinceLastRead: register.avgMinMax({
|
|
1598
|
-
name: "
|
|
1603
|
+
name: "lodestar_state_cache_since_last_read_seconds",
|
|
1599
1604
|
help: "Avg min max of all state cache items seconds since last reads",
|
|
1600
1605
|
}),
|
|
1601
1606
|
stateClonedCount: register.histogram({
|
|
@@ -1664,7 +1669,7 @@ export function createLodestarMetrics(
|
|
|
1664
1669
|
help: "Avg min max of all state cache items total read count",
|
|
1665
1670
|
}),
|
|
1666
1671
|
secondsSinceLastRead: register.avgMinMax({
|
|
1667
|
-
name: "
|
|
1672
|
+
name: "lodestar_cp_state_epoch_since_last_read_seconds",
|
|
1668
1673
|
help: "Avg min max of all state cache items seconds since last reads",
|
|
1669
1674
|
}),
|
|
1670
1675
|
stateClonedCount: register.histogram({
|
|
@@ -1682,7 +1687,7 @@ export function createLodestarMetrics(
|
|
|
1682
1687
|
help: "Total number of states pruned from memory",
|
|
1683
1688
|
}),
|
|
1684
1689
|
statePersistSecFromSlot: register.histogram({
|
|
1685
|
-
name: "
|
|
1690
|
+
name: "lodestar_cp_state_cache_state_persist_from_slot_seconds",
|
|
1686
1691
|
help: "Histogram of time to persist state to db since the clock slot",
|
|
1687
1692
|
buckets: [0, 2, 4, 6, 8, 10, 12],
|
|
1688
1693
|
}),
|
|
@@ -1710,7 +1715,7 @@ export function createLodestarMetrics(
|
|
|
1710
1715
|
buckets: [0, 1, 2, 4, 8, 16, 32],
|
|
1711
1716
|
}),
|
|
1712
1717
|
stateReloadSecFromSlot: register.histogram({
|
|
1713
|
-
name: "
|
|
1718
|
+
name: "lodestar_cp_state_cache_state_reload_from_slot_seconds",
|
|
1714
1719
|
help: "Histogram of time to load state from db since the clock slot",
|
|
1715
1720
|
buckets: [0, 2, 4, 6, 8, 10, 12],
|
|
1716
1721
|
}),
|
|
@@ -1784,6 +1789,15 @@ export function createLodestarMetrics(
|
|
|
1784
1789
|
help: "Time from promise insertion until promise resolution when shuffling was ready in seconds",
|
|
1785
1790
|
buckets: [0.5, 1, 1.5, 2],
|
|
1786
1791
|
}),
|
|
1792
|
+
committeePubkeysComputeTime: register.histogram({
|
|
1793
|
+
name: "lodestar_shuffling_cache_committee_pubkeys_compute_seconds",
|
|
1794
|
+
help: "Time to aggregate the committee pubkeys of a shuffling off the main thread in seconds",
|
|
1795
|
+
buckets: [0.1, 0.25, 0.5, 1, 2, 5],
|
|
1796
|
+
}),
|
|
1797
|
+
committeePubkeysErrors: register.counter({
|
|
1798
|
+
name: "lodestar_shuffling_cache_committee_pubkeys_errors_total",
|
|
1799
|
+
help: "Total number of shufflings whose committee pubkeys could not be computed",
|
|
1800
|
+
}),
|
|
1787
1801
|
},
|
|
1788
1802
|
|
|
1789
1803
|
seenCache: {
|
|
@@ -1916,7 +1930,7 @@ export function createLodestarMetrics(
|
|
|
1916
1930
|
labelNames: ["entrypoint", "caller"],
|
|
1917
1931
|
}),
|
|
1918
1932
|
regenFnCallDuration: register.histogram<{entrypoint: RegenFnName; caller: RegenCaller}>({
|
|
1919
|
-
name: "
|
|
1933
|
+
name: "lodestar_regen_fn_call_duration_seconds",
|
|
1920
1934
|
help: "regen function duration",
|
|
1921
1935
|
labelNames: ["entrypoint", "caller"],
|
|
1922
1936
|
buckets: [0.1, 1, 10, 100],
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
IteratorEvent,
|
|
6
6
|
RequestCancelEvent,
|
|
7
7
|
RequestEvent,
|
|
8
|
+
ResponsePullEvent,
|
|
8
9
|
} from "../../util/asyncIterableToEvents.js";
|
|
9
10
|
import {StrictEventEmitterSingleArg} from "../../util/strictEvents.js";
|
|
10
11
|
import {EventDirection} from "../events.js";
|
|
@@ -14,18 +15,22 @@ export enum ReqRespBridgeEvent {
|
|
|
14
15
|
outgoingRequest = "reqresp.outgoingRequest",
|
|
15
16
|
outgoingRequestCancel = "reqresp.outgoingRequestCancel",
|
|
16
17
|
outgoingResponse = "reqresp.outgoingResponse",
|
|
18
|
+
outgoingResponsePull = "reqresp.outgoingResponsePull",
|
|
17
19
|
incomingRequest = "reqresp.incomingRequest",
|
|
18
20
|
incomingRequestCancel = "reqresp.incomingRequestCancel",
|
|
19
21
|
incomingResponse = "reqresp.incomingResponse",
|
|
22
|
+
incomingResponsePull = "reqresp.incomingResponsePull",
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
export type ReqRespBridgeEventData = {
|
|
23
26
|
[ReqRespBridgeEvent.outgoingRequest]: RequestEvent<OutgoingRequestArgs>;
|
|
24
27
|
[ReqRespBridgeEvent.outgoingRequestCancel]: RequestCancelEvent;
|
|
25
28
|
[ReqRespBridgeEvent.outgoingResponse]: IteratorEvent<ResponseOutgoing>;
|
|
29
|
+
[ReqRespBridgeEvent.outgoingResponsePull]: ResponsePullEvent;
|
|
26
30
|
[ReqRespBridgeEvent.incomingRequest]: RequestEvent<IncomingRequestArgs>;
|
|
27
31
|
[ReqRespBridgeEvent.incomingRequestCancel]: RequestCancelEvent;
|
|
28
32
|
[ReqRespBridgeEvent.incomingResponse]: IteratorEvent<ResponseIncoming>;
|
|
33
|
+
[ReqRespBridgeEvent.incomingResponsePull]: ResponsePullEvent;
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
type IReqRespBridgeEventBus = StrictEventEmitterSingleArg<ReqRespBridgeEventData>;
|
|
@@ -37,9 +42,12 @@ export const reqRespBridgeEventDirection: Record<ReqRespBridgeEvent, EventDirect
|
|
|
37
42
|
[ReqRespBridgeEvent.outgoingRequest]: EventDirection.mainToWorker,
|
|
38
43
|
[ReqRespBridgeEvent.outgoingRequestCancel]: EventDirection.mainToWorker,
|
|
39
44
|
[ReqRespBridgeEvent.outgoingResponse]: EventDirection.mainToWorker,
|
|
45
|
+
// Credit flows from the consumer back to the producer, opposite the response it paces
|
|
46
|
+
[ReqRespBridgeEvent.outgoingResponsePull]: EventDirection.workerToMain,
|
|
40
47
|
[ReqRespBridgeEvent.incomingRequest]: EventDirection.workerToMain,
|
|
41
48
|
[ReqRespBridgeEvent.incomingRequestCancel]: EventDirection.workerToMain,
|
|
42
49
|
[ReqRespBridgeEvent.incomingResponse]: EventDirection.workerToMain,
|
|
50
|
+
[ReqRespBridgeEvent.incomingResponsePull]: EventDirection.mainToWorker,
|
|
43
51
|
};
|
|
44
52
|
|
|
45
53
|
export function getReqRespBridgeReqEvents(
|
|
@@ -49,9 +57,11 @@ export function getReqRespBridgeReqEvents(
|
|
|
49
57
|
emitRequest: (data) => events.emit(ReqRespBridgeEvent.outgoingRequest, data),
|
|
50
58
|
emitRequestCancel: (data) => events.emit(ReqRespBridgeEvent.outgoingRequestCancel, data),
|
|
51
59
|
emitResponse: (data) => events.emit(ReqRespBridgeEvent.incomingResponse, data),
|
|
60
|
+
emitResponsePull: (data) => events.emit(ReqRespBridgeEvent.incomingResponsePull, data),
|
|
52
61
|
onRequest: (cb) => events.on(ReqRespBridgeEvent.outgoingRequest, cb),
|
|
53
62
|
onRequestCancel: (cb) => events.on(ReqRespBridgeEvent.outgoingRequestCancel, cb),
|
|
54
63
|
onResponse: (cb) => events.on(ReqRespBridgeEvent.incomingResponse, cb),
|
|
64
|
+
onResponsePull: (cb) => events.on(ReqRespBridgeEvent.incomingResponsePull, cb),
|
|
55
65
|
};
|
|
56
66
|
}
|
|
57
67
|
|
|
@@ -62,9 +72,11 @@ export function getReqRespBridgeRespEvents(
|
|
|
62
72
|
emitRequest: (data) => events.emit(ReqRespBridgeEvent.incomingRequest, data),
|
|
63
73
|
emitRequestCancel: (data) => events.emit(ReqRespBridgeEvent.incomingRequestCancel, data),
|
|
64
74
|
emitResponse: (data) => events.emit(ReqRespBridgeEvent.outgoingResponse, data),
|
|
75
|
+
emitResponsePull: (data) => events.emit(ReqRespBridgeEvent.outgoingResponsePull, data),
|
|
65
76
|
onRequest: (cb) => events.on(ReqRespBridgeEvent.incomingRequest, cb),
|
|
66
77
|
onRequestCancel: (cb) => events.on(ReqRespBridgeEvent.incomingRequestCancel, cb),
|
|
67
78
|
onResponse: (cb) => events.on(ReqRespBridgeEvent.outgoingResponse, cb),
|
|
79
|
+
onResponsePull: (cb) => events.on(ReqRespBridgeEvent.outgoingResponsePull, cb),
|
|
68
80
|
};
|
|
69
81
|
}
|
|
70
82
|
|
|
@@ -74,8 +74,12 @@ export class WorkerNetworkCore implements INetworkCore {
|
|
|
74
74
|
private readonly reqRespBridgeEventBus = new ReqRespBridgeEventBus();
|
|
75
75
|
|
|
76
76
|
constructor(private readonly modules: WorkerNetworkCoreModules) {
|
|
77
|
-
// Get called from main thread to issue a ReqResp request, and emits event to worker
|
|
78
|
-
|
|
77
|
+
// Get called from main thread to issue a ReqResp request, and emits event to worker. Unbounded: we
|
|
78
|
+
// buffer the whole response into an array anyway, so pacing the worker only risks a read buffer overflow
|
|
79
|
+
this.reqRespBridgeReqCaller = new AsyncIterableBridgeCaller(
|
|
80
|
+
getReqRespBridgeReqEvents(this.reqRespBridgeEventBus),
|
|
81
|
+
Infinity
|
|
82
|
+
);
|
|
79
83
|
// Handles ReqResp response from worker and calls async generator in main thread
|
|
80
84
|
this.reqRespBridgeRespHandler = new AsyncIterableBridgeHandler(
|
|
81
85
|
getReqRespBridgeRespEvents(this.reqRespBridgeEventBus),
|
|
@@ -25,7 +25,7 @@ import {getSlotDurations} from "@lodestar/state-transition";
|
|
|
25
25
|
import {SubnetID} from "@lodestar/types";
|
|
26
26
|
import {Logger, Map2d, Map2dArr} from "@lodestar/utils";
|
|
27
27
|
import {RegistryMetricCreator} from "../../metrics/index.js";
|
|
28
|
-
import {
|
|
28
|
+
import {callAfterIO, callInNextEventLoop} from "../../util/eventLoop.js";
|
|
29
29
|
import {NetworkEvent, NetworkEventBus, NetworkEventData} from "../events.js";
|
|
30
30
|
import {Libp2p} from "../interface.js";
|
|
31
31
|
import {NetworkConfig} from "../networkConfig.js";
|
|
@@ -433,7 +433,7 @@ export class Eth2Gossipsub {
|
|
|
433
433
|
// See https://github.com/ChainSafe/lodestar/issues/5604
|
|
434
434
|
// A block arrives once per slot and cannot cause that lag, so it skips the 1ms timer delay
|
|
435
435
|
if (topic.type === GossipType.beacon_block) {
|
|
436
|
-
|
|
436
|
+
callAfterIO(emitPendingMessage);
|
|
437
437
|
} else {
|
|
438
438
|
callInNextEventLoop(emitPendingMessage);
|
|
439
439
|
}
|
|
@@ -505,6 +505,10 @@ export class Eth2Gossipsub {
|
|
|
505
505
|
getDirectPeers(): string[] {
|
|
506
506
|
return Array.from(this.gossipsub.direct);
|
|
507
507
|
}
|
|
508
|
+
|
|
509
|
+
isDirectPeer(peerIdStr: string): boolean {
|
|
510
|
+
return this.gossipsub.direct.has(peerIdStr);
|
|
511
|
+
}
|
|
508
512
|
}
|
|
509
513
|
|
|
510
514
|
/**
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isForkPostGloas,
|
|
13
13
|
} from "@lodestar/params";
|
|
14
14
|
import {TypeSizes} from "@lodestar/reqresp";
|
|
15
|
-
import {
|
|
15
|
+
import {SingleAttestation, ssz, sszTypesFor} from "@lodestar/types";
|
|
16
16
|
import {GossipAction, GossipActionError, GossipErrorCode} from "../../chain/errors/gossipValidation.js";
|
|
17
17
|
import {computeMaxGloasDataColumnSidecarSize} from "../../util/sszBytes.js";
|
|
18
18
|
import {NetworkConfig} from "../networkConfig.js";
|
|
@@ -173,19 +173,6 @@ export function sszDeserialize<T extends GossipTopic>(topic: T, serializedData:
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/**
|
|
177
|
-
* @deprecated
|
|
178
|
-
* Deserialize a gossip serialized data into an Attestation object.
|
|
179
|
-
* No longer used post-electra. Use `sszDeserializeSingleAttestation` instead
|
|
180
|
-
*/
|
|
181
|
-
export function sszDeserializeAttestation(fork: ForkName, serializedData: Uint8Array): Attestation {
|
|
182
|
-
try {
|
|
183
|
-
return sszTypesFor(fork).Attestation.deserialize(serializedData);
|
|
184
|
-
} catch (_e) {
|
|
185
|
-
throw new GossipActionError(GossipAction.REJECT, {code: GossipErrorCode.INVALID_SERIALIZED_BYTES_ERROR_CODE});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
176
|
/**
|
|
190
177
|
* Deserialize a gossip seralized data into an SingleAttestation object.
|
|
191
178
|
*/
|