@lodestar/beacon-node 1.51.0-dev.41b1b87394 → 1.51.0-dev.42cba9af41
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 +19 -61
- 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 +17 -0
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -2
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +7 -31
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +3 -4
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +12 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +17 -2
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts +9 -2
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +12 -4
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +11 -56
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +5 -241
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.d.ts +2 -4
- package/lib/chain/blocks/blockInput/errors.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/errors.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +2 -18
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +0 -1
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +36 -53
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +4 -0
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +24 -3
- 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 +2 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +0 -19
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +0 -24
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +6 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +7 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +4 -0
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +3 -0
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts +0 -2
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +6 -24
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts +1 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +37 -11
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/chain.d.ts +24 -3
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +120 -39
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +7 -7
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -5
- package/lib/chain/emitter.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 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +11 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.d.ts +51 -0
- package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -0
- package/lib/chain/forkChoiceExecutionEngine.js +117 -0
- package/lib/chain/forkChoiceExecutionEngine.js.map +1 -0
- package/lib/chain/interface.d.ts +7 -4
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +17 -4
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +177 -37
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/index.d.ts +1 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +1 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/singleAttestationPool.d.ts +77 -0
- package/lib/chain/opPools/singleAttestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/singleAttestationPool.js +209 -0
- package/lib/chain/opPools/singleAttestationPool.js.map +1 -0
- package/lib/chain/options.d.ts +5 -2
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +3 -2
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/proposerTracker.d.ts +31 -0
- package/lib/chain/proposerTracker.d.ts.map +1 -0
- package/lib/chain/proposerTracker.js +75 -0
- package/lib/chain/proposerTracker.js.map +1 -0
- package/lib/chain/regen/interface.d.ts +1 -1
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +1 -1
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +5 -3
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -14
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +6 -65
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +1 -1
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.js +1 -1
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +16 -10
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +11 -0
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +1 -2
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +0 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +3 -2
- package/lib/db/dataColumnStore.d.ts.map +1 -1
- package/lib/db/dataColumnStore.js +3 -3
- package/lib/db/dataColumnStore.js.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.d.ts +1 -1
- package/lib/db/flatFileStore/flatFileStore.d.ts.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.js +5 -4
- package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
- package/lib/db/flatFileStore/interface.d.ts +2 -1
- package/lib/db/flatFileStore/interface.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.d.ts +0 -1
- package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.js +0 -1
- package/lib/db/repositories/blobSidecars.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts +2 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +14 -4
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/execution/engine/http.d.ts +4 -6
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +8 -10
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +17 -5
- 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 -4
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +2 -12
- 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 +0 -4
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -4
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +1 -15
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +0 -9
- package/lib/execution/engine/sszTypes.d.ts.map +1 -1
- package/lib/execution/engine/sszTypes.js +0 -5
- package/lib/execution/engine/sszTypes.js.map +1 -1
- package/lib/execution/engine/transport.d.ts +1 -14
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +0 -8
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +0 -8
- package/lib/execution/engine/types.js.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 +0 -9
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +0 -30
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +26 -8
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +69 -18
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +2 -1
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +4 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +1 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +2 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +3 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +4 -1
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/gossip/interface.d.ts +1 -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/topic.d.ts +0 -16
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +0 -23
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +2 -5
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +4 -6
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +8 -20
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +2 -0
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/utils/subnetMap.d.ts +5 -2
- package/lib/network/peers/utils/subnetMap.d.ts.map +1 -1
- package/lib/network/peers/utils/subnetMap.js +6 -3
- package/lib/network/peers/utils/subnetMap.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +1 -8
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +22 -112
- 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 -3
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByHead.js +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByHead.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +1 -12
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +0 -2
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +0 -10
- 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 +1 -17
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +2 -8
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +1 -7
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts +35 -5
- package/lib/network/subnets/attnetsService.d.ts.map +1 -1
- package/lib/network/subnets/attnetsService.js +84 -6
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/network/subnets/interface.d.ts +7 -0
- package/lib/network/subnets/interface.d.ts.map +1 -1
- package/lib/network/subnets/interface.js.map +1 -1
- package/lib/sync/range/batch.d.ts +2 -3
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +9 -22
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +2 -15
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/sync.d.ts +8 -0
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +42 -22
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +1 -7
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +6 -34
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +24 -128
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +2 -18
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +14 -99
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/bitArray.d.ts +6 -6
- package/lib/util/bitArray.d.ts.map +1 -1
- package/lib/util/bitArray.js +25 -50
- package/lib/util/bitArray.js.map +1 -1
- package/lib/util/blobs.d.ts +1 -7
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +0 -19
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/execution.d.ts +3 -4
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +1 -73
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +0 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +1 -17
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +0 -5
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -2
- package/lib/util/types.js.map +1 -1
- package/package.json +17 -17
- package/src/api/impl/beacon/blocks/index.ts +24 -64
- package/src/api/impl/beacon/pool/index.ts +26 -0
- package/src/chain/GetBlobsTracker.ts +10 -39
- package/src/chain/archiveStore/archiveStore.ts +5 -4
- package/src/chain/archiveStore/utils/archiveBlocks.ts +21 -2
- package/src/chain/archiveStore/utils/pruneHistory.ts +16 -6
- package/src/chain/blocks/blockInput/blockInput.ts +11 -343
- package/src/chain/blocks/blockInput/errors.ts +1 -2
- package/src/chain/blocks/blockInput/types.ts +2 -20
- package/src/chain/blocks/importBlock.ts +56 -72
- package/src/chain/blocks/importExecutionPayload.ts +42 -13
- package/src/chain/blocks/index.ts +5 -2
- package/src/chain/blocks/types.ts +1 -30
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +6 -1
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -6
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +4 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -0
- package/src/chain/blocks/writeBlockInputToDb.ts +6 -29
- package/src/chain/bls/multithread/index.ts +34 -14
- package/src/chain/chain.ts +135 -37
- package/src/chain/emitter.ts +8 -8
- package/src/chain/errors/index.ts +0 -1
- package/src/chain/forkChoice/index.ts +11 -0
- package/src/chain/forkChoiceExecutionEngine.ts +183 -0
- package/src/chain/interface.ts +7 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +222 -35
- package/src/chain/opPools/index.ts +1 -0
- package/src/chain/opPools/singleAttestationPool.ts +287 -0
- package/src/chain/options.ts +5 -2
- package/src/chain/produceBlock/produceBlockBody.ts +7 -3
- package/src/chain/proposerTracker.ts +94 -0
- package/src/chain/regen/interface.ts +1 -1
- package/src/chain/regen/queued.ts +6 -4
- package/src/chain/seenCache/seenGossipBlockInput.ts +9 -93
- package/src/chain/validation/aggregateAndProof.ts +1 -1
- package/src/chain/validation/attestation.ts +1 -1
- package/src/chain/validation/syncCommittee.ts +31 -15
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +13 -0
- package/src/chain/validatorMonitor.ts +0 -6
- package/src/db/dataColumnStore.ts +5 -4
- package/src/db/flatFileStore/flatFileStore.ts +5 -4
- package/src/db/flatFileStore/interface.ts +2 -1
- package/src/db/repositories/blobSidecars.ts +0 -1
- package/src/db/repositories/dataColumnSidecarArchive.ts +14 -4
- package/src/execution/engine/http.ts +19 -42
- package/src/execution/engine/interface.ts +18 -9
- package/src/execution/engine/jsonRpcTransport.ts +10 -22
- package/src/execution/engine/mock.ts +0 -7
- package/src/execution/engine/restTransport.ts +3 -22
- package/src/execution/engine/sszTypes.ts +0 -9
- package/src/execution/engine/transport.ts +8 -17
- package/src/execution/engine/types.ts +0 -17
- package/src/index.ts +1 -1
- package/src/metrics/metrics/beacon.ts +0 -30
- package/src/metrics/metrics/lodestar.ts +70 -18
- package/src/network/core/networkCore.ts +6 -1
- package/src/network/core/networkCoreWorker.ts +1 -0
- package/src/network/core/networkCoreWorkerHandler.ts +4 -1
- package/src/network/core/types.ts +4 -1
- package/src/network/gossip/interface.ts +0 -5
- package/src/network/gossip/topic.ts +0 -25
- package/src/network/interface.ts +0 -5
- package/src/network/network.ts +10 -39
- package/src/network/options.ts +2 -0
- package/src/network/peers/utils/subnetMap.ts +6 -3
- package/src/network/processor/extractSlotRootFns.ts +0 -9
- package/src/network/processor/gossipHandlers.ts +30 -143
- 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/beaconBlocksByHead.ts +1 -1
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -2
- package/src/network/reqresp/handlers/index.ts +0 -17
- package/src/network/reqresp/protocols.ts +0 -12
- package/src/network/reqresp/rateLimit.ts +1 -17
- package/src/network/reqresp/types.ts +0 -13
- package/src/network/subnets/attnetsService.ts +94 -6
- package/src/network/subnets/interface.ts +7 -0
- package/src/sync/range/batch.ts +9 -21
- package/src/sync/range/chain.ts +2 -14
- package/src/sync/sync.ts +43 -22
- package/src/sync/unknownBlock.ts +1 -8
- package/src/sync/utils/downloadByRange.ts +31 -230
- package/src/sync/utils/downloadByRoot.ts +15 -142
- package/src/util/bitArray.ts +22 -43
- package/src/util/blobs.ts +0 -34
- package/src/util/execution.ts +8 -102
- package/src/util/sszBytes.ts +0 -22
- package/src/util/types.ts +1 -8
- package/lib/chain/errors/blobSidecarError.d.ts +0 -108
- package/lib/chain/errors/blobSidecarError.d.ts.map +0 -1
- package/lib/chain/errors/blobSidecarError.js +0 -38
- package/lib/chain/errors/blobSidecarError.js.map +0 -1
- package/lib/chain/validation/blobSidecar.d.ts +0 -16
- package/lib/chain/validation/blobSidecar.d.ts.map +0 -1
- package/lib/chain/validation/blobSidecar.js +0 -276
- package/lib/chain/validation/blobSidecar.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +0 -9
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +0 -91
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts +0 -5
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +0 -46
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +0 -1
- package/src/chain/errors/blobSidecarError.ts +0 -70
- package/src/chain/validation/blobSidecar.ts +0 -357
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +0 -133
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +0 -69
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
ssz,
|
|
27
27
|
sszTypesFor,
|
|
28
28
|
} from "@lodestar/types";
|
|
29
|
-
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
30
29
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
31
30
|
import {
|
|
32
31
|
ExecutionPayloadStatus,
|
|
@@ -102,7 +101,6 @@ export type EngineApiRpcParamTypes = {
|
|
|
102
101
|
*/
|
|
103
102
|
engine_getClientVersionV1: [ClientVersionRpc];
|
|
104
103
|
|
|
105
|
-
engine_getBlobsV1: [DATA[]];
|
|
106
104
|
engine_getBlobsV2: [DATA[]];
|
|
107
105
|
|
|
108
106
|
engine_getInclusionListV1: [];
|
|
@@ -161,7 +159,6 @@ export type EngineApiRpcReturnTypes = {
|
|
|
161
159
|
|
|
162
160
|
engine_getClientVersionV1: ClientVersionRpc[];
|
|
163
161
|
|
|
164
|
-
engine_getBlobsV1: (BlobAndProofRpc | null)[];
|
|
165
162
|
engine_getBlobsV2: BlobAndProofV2Rpc[] | null;
|
|
166
163
|
|
|
167
164
|
engine_getInclusionListV1: InclusionListRpc;
|
|
@@ -248,11 +245,6 @@ export type ConsolidationRequestsRpc = DATA;
|
|
|
248
245
|
export type BuilderDepositRequestsRpc = DATA;
|
|
249
246
|
export type BuilderExitRequestsRpc = DATA;
|
|
250
247
|
|
|
251
|
-
export type BlobAndProofRpc = {
|
|
252
|
-
blob: DATA;
|
|
253
|
-
proof: DATA;
|
|
254
|
-
};
|
|
255
|
-
|
|
256
248
|
export type BlobAndProofV2Rpc = {
|
|
257
249
|
blob: DATA;
|
|
258
250
|
proofs: DATA[];
|
|
@@ -701,15 +693,6 @@ export function serializeExecutionPayloadBody(data: ExecutionPayloadBody | null)
|
|
|
701
693
|
: null;
|
|
702
694
|
}
|
|
703
695
|
|
|
704
|
-
export function deserializeBlobAndProofs(data: BlobAndProofRpc | null): BlobAndProof | null {
|
|
705
|
-
return data
|
|
706
|
-
? {
|
|
707
|
-
blob: dataToBytes(data.blob, BLOB_BYTES),
|
|
708
|
-
proof: dataToBytes(data.proof, PROOF_BYTES),
|
|
709
|
-
}
|
|
710
|
-
: null;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
696
|
export function deserializeBlobAndProofsV2(data: BlobAndProofV2Rpc): BlobAndProofV2 {
|
|
714
697
|
return {
|
|
715
698
|
blob: dataToBytes(data.blob, BLOB_BYTES),
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ 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 {initializeExecutionEngine} from "./execution/index.js";
|
|
10
|
+
export {ExecutionPayloadStatus, initializeExecutionEngine} from "./execution/index.js";
|
|
11
11
|
// Export metrics utilities to de-duplicate validator metrics
|
|
12
12
|
export {
|
|
13
13
|
type HttpMetricsServer,
|
|
@@ -186,36 +186,6 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
|
|
|
186
186
|
}),
|
|
187
187
|
},
|
|
188
188
|
|
|
189
|
-
blobs: {
|
|
190
|
-
getBlobsV1Requests: register.gauge({
|
|
191
|
-
name: "beacon_get_blobs_v1_calls_total",
|
|
192
|
-
help: "Number of getBlobsV1 requests that get made",
|
|
193
|
-
}),
|
|
194
|
-
getBlobsV1RequestedBlobCount: register.gauge({
|
|
195
|
-
name: "beacon_get_blobs_v1_requested_blobs_count_total",
|
|
196
|
-
help: "Number of versioned hashes that get sent in getBlobsV1 request",
|
|
197
|
-
}),
|
|
198
|
-
getBlobsV1Error: register.gauge({
|
|
199
|
-
name: "beacon_get_blobs_v1_response_error_total",
|
|
200
|
-
help: "Number of getBlobsV1 calls that errored ",
|
|
201
|
-
}),
|
|
202
|
-
getBlobsV1Miss: register.gauge({
|
|
203
|
-
name: "beacon_get_blobs_v1_missing_blob_response_total",
|
|
204
|
-
help: "Number of getBlobsV1 misses where a versioned hash returns a null",
|
|
205
|
-
}),
|
|
206
|
-
getBlobsV1Hit: register.gauge({
|
|
207
|
-
name: "beacon_get_blobs_v1_blob_returned_response_total",
|
|
208
|
-
help: "Number of getBlobsV1 hits where a versioned hash returns blob",
|
|
209
|
-
}),
|
|
210
|
-
getBlobsV1HitButArrivedWhileWaiting: register.gauge({
|
|
211
|
-
name: "beacon_get_blobs_v1_blob_returned_but_arrived_during_response_total",
|
|
212
|
-
help: "Number of getBlobsV1 hits where a versioned hash returns blob but the blob already arrived via gossip",
|
|
213
|
-
}),
|
|
214
|
-
getBlobsV1HitUseful: register.gauge({
|
|
215
|
-
name: "beacon_get_blobs_v1_blob_useful_response_total",
|
|
216
|
-
help: "Number of getBlobsV1 hits where a versioned hash returns blob and the blob is needed so call is useful",
|
|
217
|
-
}),
|
|
218
|
-
},
|
|
219
189
|
payloadEnvelopeReconstruction: {
|
|
220
190
|
envelopes: register.counter<{result: "success" | "unavailable" | "mismatch"}>({
|
|
221
191
|
name: "beacon_payload_envelope_reconstruction_envelopes_total",
|
|
@@ -1054,10 +1054,6 @@ export function createLodestarMetrics(
|
|
|
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
|
}),
|
|
1057
|
-
publishedFromEngine: register.counter({
|
|
1058
|
-
name: "lodestar_gossip_blob_published_from_engine_total",
|
|
1059
|
-
help: "Total number of blobs retrieved from execution engine and published to gossip",
|
|
1060
|
-
}),
|
|
1061
1057
|
},
|
|
1062
1058
|
// Gossip execution payload envelope
|
|
1063
1059
|
gossipExecutionPayloadEnvelope: {
|
|
@@ -1179,11 +1175,6 @@ export function createLodestarMetrics(
|
|
|
1179
1175
|
help: "Total number of imported blocks by source",
|
|
1180
1176
|
labelNames: ["source"],
|
|
1181
1177
|
}),
|
|
1182
|
-
blobsBySource: register.gauge<{blobsSource: BlockInputSource}>({
|
|
1183
|
-
name: "lodestar_import_blobs_by_source_total",
|
|
1184
|
-
help: "Total number of imported blobs by source",
|
|
1185
|
-
labelNames: ["blobsSource"],
|
|
1186
|
-
}),
|
|
1187
1178
|
notOverrideFcuReason: register.counter<{reason: NotReorgedReason}>({
|
|
1188
1179
|
name: "lodestar_import_block_not_override_fcu_reason_total",
|
|
1189
1180
|
help: "Reason why the fcu call is not suppressed during block import",
|
|
@@ -1347,8 +1338,67 @@ export function createLodestarMetrics(
|
|
|
1347
1338
|
name: "lodestar_oppool_aggregated_attestation_pool_packed_attestations_missing_shuffling_committees_total",
|
|
1348
1339
|
help: "Total number of committees skipped due to missing shuffling when producing packed attestations",
|
|
1349
1340
|
}),
|
|
1341
|
+
attestationValue: register.counter<{source: "aggregate" | "single"}>({
|
|
1342
|
+
name: "lodestar_oppool_packed_attestation_value_total",
|
|
1343
|
+
help: "Sum of new seen effective balance increments times participation flag weight of packed attestations, by source",
|
|
1344
|
+
labelNames: ["source"],
|
|
1345
|
+
}),
|
|
1346
|
+
blockNewSeenAttesters: register.gauge({
|
|
1347
|
+
name: "lodestar_oppool_packed_attestations_block_new_seen_attesters",
|
|
1348
|
+
help: "Total number of new seen attesters across all packed attestations of the last produced block",
|
|
1349
|
+
}),
|
|
1350
|
+
singlesValueRatio: register.histogram({
|
|
1351
|
+
name: "lodestar_oppool_packed_attestations_singles_value_ratio",
|
|
1352
|
+
help: "Ratio of attestation value contributed by single attestations per produced block",
|
|
1353
|
+
buckets: [0, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1],
|
|
1354
|
+
}),
|
|
1355
|
+
singlesNewSeenAttesters: register.histogram({
|
|
1356
|
+
name: "lodestar_oppool_packed_attestations_singles_new_seen_attesters",
|
|
1357
|
+
help: "Number of attesters newly included only thanks to single attestations per produced block",
|
|
1358
|
+
buckets: [0, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 1024],
|
|
1359
|
+
}),
|
|
1360
|
+
singlesNewSeenAttestersByInclusionDistance: register.gauge<{inclusionDistance: number}>({
|
|
1361
|
+
name: "lodestar_oppool_packed_attestations_singles_new_seen_attesters_by_inclusion_distance",
|
|
1362
|
+
help: "Number of attesters newly included only thanks to single attestations in the last produced block, by inclusion distance",
|
|
1363
|
+
labelNames: ["inclusionDistance"],
|
|
1364
|
+
}),
|
|
1365
|
+
singlesNewSeenEffectiveBalance: register.histogram({
|
|
1366
|
+
name: "lodestar_oppool_packed_attestations_singles_new_seen_effective_balance",
|
|
1367
|
+
help: "Effective balance increments of attesters newly included only thanks to single attestations per produced block",
|
|
1368
|
+
buckets: [0, 32, 160, 320, 800, 1600, 3200, 8000, 32000],
|
|
1369
|
+
}),
|
|
1370
|
+
singlesOnlyConsolidations: register.histogram({
|
|
1371
|
+
name: "lodestar_oppool_packed_attestations_singles_only_consolidations",
|
|
1372
|
+
help: "Number of packed attestations built only from single attestations per produced block",
|
|
1373
|
+
buckets: [0, 1, 2, 4, 8],
|
|
1374
|
+
}),
|
|
1375
|
+
singlesFoldedCommittees: register.histogram({
|
|
1376
|
+
name: "lodestar_oppool_packed_attestations_singles_folded_committees",
|
|
1377
|
+
help: "Number of committees in packed attestations that received single attestations per produced block",
|
|
1378
|
+
buckets: [0, 1, 2, 4, 8, 16, 32, 64],
|
|
1379
|
+
}),
|
|
1350
1380
|
},
|
|
1351
1381
|
},
|
|
1382
|
+
singleAttestationPool: {
|
|
1383
|
+
size: register.gauge({
|
|
1384
|
+
name: "lodestar_oppool_single_attestation_pool_size",
|
|
1385
|
+
help: "Current number of single attestations in the SingleAttestationPool",
|
|
1386
|
+
}),
|
|
1387
|
+
gossipInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
|
|
1388
|
+
name: "lodestar_oppool_single_attestation_pool_gossip_insert_outcome_total",
|
|
1389
|
+
help: "Total number of InsertOutcome as a result of adding a single attestation from gossip to the SingleAttestationPool",
|
|
1390
|
+
labelNames: ["insertOutcome"],
|
|
1391
|
+
}),
|
|
1392
|
+
apiInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
|
|
1393
|
+
name: "lodestar_oppool_single_attestation_pool_api_insert_outcome_total",
|
|
1394
|
+
help: "Total number of InsertOutcome as a result of adding a single attestation from api to the SingleAttestationPool",
|
|
1395
|
+
labelNames: ["insertOutcome"],
|
|
1396
|
+
}),
|
|
1397
|
+
deletedByBlock: register.counter({
|
|
1398
|
+
name: "lodestar_oppool_single_attestation_pool_deleted_by_block_total",
|
|
1399
|
+
help: "Total number of single attestations deleted because a canonical block includes them",
|
|
1400
|
+
}),
|
|
1401
|
+
},
|
|
1352
1402
|
attestationPool: {
|
|
1353
1403
|
size: register.gauge({
|
|
1354
1404
|
name: "lodestar_oppool_attestation_pool_size",
|
|
@@ -1497,6 +1547,17 @@ export function createLodestarMetrics(
|
|
|
1497
1547
|
},
|
|
1498
1548
|
},
|
|
1499
1549
|
|
|
1550
|
+
proposerTracker: {
|
|
1551
|
+
proposalSlots: register.gauge({
|
|
1552
|
+
name: "lodestar_proposer_tracker_proposal_slots",
|
|
1553
|
+
help: "Current number of upcoming block proposals of connected validators tracked by the ProposerTracker",
|
|
1554
|
+
}),
|
|
1555
|
+
collectableSlot: register.gauge({
|
|
1556
|
+
name: "lodestar_proposer_tracker_collectable_slot",
|
|
1557
|
+
help: "1 if single attestations of the clock slot are collected for an upcoming local proposal, 0 otherwise",
|
|
1558
|
+
}),
|
|
1559
|
+
},
|
|
1560
|
+
|
|
1500
1561
|
chain: {
|
|
1501
1562
|
blacklistedBlocks: register.gauge({
|
|
1502
1563
|
name: "lodestar_blacklisted_blocks_total",
|
|
@@ -1793,11 +1854,6 @@ export function createLodestarMetrics(
|
|
|
1793
1854
|
help: "Total number of duplicate blocks that pass validation and attempt to be cached but are known",
|
|
1794
1855
|
labelNames: ["source"],
|
|
1795
1856
|
}),
|
|
1796
|
-
duplicateBlobCount: register.counter<{source: BlockInputSource}>({
|
|
1797
|
-
name: "lodestar_seen_block_input_cache_duplicate_blob_total",
|
|
1798
|
-
help: "Total number of duplicate blobs that pass validation and attempt to be cached but are known",
|
|
1799
|
-
labelNames: ["source"],
|
|
1800
|
-
}),
|
|
1801
1857
|
duplicateColumnCount: register.counter<{source: BlockInputSource}>({
|
|
1802
1858
|
name: "lodestar_seen_block_input_cache_duplicate_column_total",
|
|
1803
1859
|
help: "Total number of duplicate columns that pass validation and attempt to be cached but are known",
|
|
@@ -1807,10 +1863,6 @@ export function createLodestarMetrics(
|
|
|
1807
1863
|
name: "lodestar_seen_block_input_cache_items_created_by_block_total",
|
|
1808
1864
|
help: "Number of BlockInputs created via a block being seen first",
|
|
1809
1865
|
}),
|
|
1810
|
-
createdByBlob: register.counter({
|
|
1811
|
-
name: "lodestar_seen_block_input_cache_items_created_by_blob_total",
|
|
1812
|
-
help: "Number of BlockInputs created via a blob being seen first",
|
|
1813
|
-
}),
|
|
1814
1866
|
createdByColumn: register.counter({
|
|
1815
1867
|
name: "lodestar_seen_block_input_cache_items_created_by_column_total",
|
|
1816
1868
|
help: "Number of BlockInputs created via a data column being seen first",
|
|
@@ -8,7 +8,7 @@ import {BeaconConfig, ForkBoundary} from "@lodestar/config";
|
|
|
8
8
|
import type {LoggerNode} from "@lodestar/logger/node";
|
|
9
9
|
import {isForkPostFulu} from "@lodestar/params";
|
|
10
10
|
import {ResponseIncoming} from "@lodestar/reqresp";
|
|
11
|
-
import {Epoch, Status, fulu, sszTypesFor} from "@lodestar/types";
|
|
11
|
+
import {Epoch, Slot, Status, fulu, sszTypesFor} from "@lodestar/types";
|
|
12
12
|
import {formatNodePeer} from "../../api/impl/node/utils.js";
|
|
13
13
|
import {GoodByeReasonCode} from "../../constants/index.js";
|
|
14
14
|
import {RegistryMetricCreator} from "../../metrics/index.js";
|
|
@@ -345,6 +345,11 @@ export class NetworkCore implements INetworkCore {
|
|
|
345
345
|
if (subscriptions.length > 0) this.peerManager.onCommitteeSubscriptions();
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
+
async addLocalProposalSlots(slots: Slot[]): Promise<void> {
|
|
349
|
+
// no peerManager.onCommitteeSubscriptions(): the extra subscription relies on connected peers, no discovery
|
|
350
|
+
this.attnetsService.addLocalProposalSlots(slots);
|
|
351
|
+
}
|
|
352
|
+
|
|
348
353
|
async prepareSyncCommitteeSubnets(subscriptions: CommitteeSubscription[]): Promise<void> {
|
|
349
354
|
this.syncnetsService.addCommitteeSubscriptions(subscriptions);
|
|
350
355
|
if (subscriptions.length > 0) this.peerManager.onCommitteeSubscriptions();
|
|
@@ -136,6 +136,7 @@ const libp2pWorkerApi: NetworkWorkerApi = {
|
|
|
136
136
|
|
|
137
137
|
prepareBeaconCommitteeSubnets: (subscriptions) => core.prepareBeaconCommitteeSubnets(subscriptions),
|
|
138
138
|
prepareSyncCommitteeSubnets: (subscriptions) => core.prepareSyncCommitteeSubnets(subscriptions),
|
|
139
|
+
addLocalProposalSlots: (slots) => core.addLocalProposalSlots(slots),
|
|
139
140
|
reportPeer: (peer, action, actionName) => core.reportPeer(peer, action, actionName),
|
|
140
141
|
reStatusPeers: (peers) => core.reStatusPeers(peers),
|
|
141
142
|
goodbyeAndDisconnect: (peer, reason) => core.goodbyeAndDisconnect(peer, reason),
|
|
@@ -9,7 +9,7 @@ import {routes} from "@lodestar/api";
|
|
|
9
9
|
import {BeaconConfig, chainConfigToJson} from "@lodestar/config";
|
|
10
10
|
import type {LoggerNode} from "@lodestar/logger/node";
|
|
11
11
|
import {ResponseIncoming, ResponseOutgoing} from "@lodestar/reqresp";
|
|
12
|
-
import {Status} from "@lodestar/types";
|
|
12
|
+
import {Slot, Status} from "@lodestar/types";
|
|
13
13
|
import {withTimeout} from "@lodestar/utils";
|
|
14
14
|
import {GoodByeReasonCode} from "../../constants/index.js";
|
|
15
15
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -220,6 +220,9 @@ export class WorkerNetworkCore implements INetworkCore {
|
|
|
220
220
|
prepareSyncCommitteeSubnets(subscriptions: CommitteeSubscription[]): Promise<void> {
|
|
221
221
|
return this.getApi().prepareSyncCommitteeSubnets(subscriptions);
|
|
222
222
|
}
|
|
223
|
+
addLocalProposalSlots(slots: Slot[]): Promise<void> {
|
|
224
|
+
return this.getApi().addLocalProposalSlots(slots);
|
|
225
|
+
}
|
|
223
226
|
subscribeGossipCoreTopics(): Promise<void> {
|
|
224
227
|
return this.getApi().subscribeGossipCoreTopics();
|
|
225
228
|
}
|
|
@@ -4,7 +4,7 @@ import {routes} from "@lodestar/api";
|
|
|
4
4
|
import {SpecJson} from "@lodestar/config";
|
|
5
5
|
import {LoggerNodeOpts} from "@lodestar/logger/node";
|
|
6
6
|
import {ResponseIncoming} from "@lodestar/reqresp";
|
|
7
|
-
import {Status} from "@lodestar/types";
|
|
7
|
+
import {Slot, Status} from "@lodestar/types";
|
|
8
8
|
import {GoodByeReasonCode} from "../../constants/index.js";
|
|
9
9
|
import {PeerIdStr} from "../../util/peerId.js";
|
|
10
10
|
import {NetworkOptions} from "../options.js";
|
|
@@ -62,6 +62,8 @@ export interface INetworkCore extends INetworkCorePublic {
|
|
|
62
62
|
|
|
63
63
|
/** Chain must push status updates to the network core */
|
|
64
64
|
updateStatus(status: Status): Promise<void>;
|
|
65
|
+
/** Block proposal slots of connected validators, used to subscribe to all attestation subnets before them */
|
|
66
|
+
addLocalProposalSlots(slots: Slot[]): Promise<void>;
|
|
65
67
|
|
|
66
68
|
setTargetGroupCount(count: number): Promise<void>;
|
|
67
69
|
/** Opens stream to handle ReqResp outgoing request */
|
|
@@ -111,6 +113,7 @@ export type NetworkWorkerApi = INetworkCorePublic & {
|
|
|
111
113
|
getConnectedPeers(): Promise<PeerIdStr[]>;
|
|
112
114
|
getConnectedPeerCount(): Promise<number>;
|
|
113
115
|
updateStatus(status: Status): Promise<void>;
|
|
116
|
+
addLocalProposalSlots(slots: Slot[]): Promise<void>;
|
|
114
117
|
|
|
115
118
|
setTargetGroupCount(count: number): Promise<void>;
|
|
116
119
|
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
SubnetID,
|
|
15
15
|
altair,
|
|
16
16
|
capella,
|
|
17
|
-
deneb,
|
|
18
17
|
gloas,
|
|
19
18
|
heze,
|
|
20
19
|
phase0,
|
|
@@ -27,7 +26,6 @@ import {JobItemQueue} from "../../util/queue/index.js";
|
|
|
27
26
|
|
|
28
27
|
export enum GossipType {
|
|
29
28
|
beacon_block = "beacon_block",
|
|
30
|
-
blob_sidecar = "blob_sidecar",
|
|
31
29
|
data_column_sidecar = "data_column_sidecar",
|
|
32
30
|
beacon_aggregate_and_proof = "beacon_aggregate_and_proof",
|
|
33
31
|
beacon_attestation = "beacon_attestation",
|
|
@@ -64,7 +62,6 @@ export interface IGossipTopic {
|
|
|
64
62
|
|
|
65
63
|
export type GossipTopicTypeMap = {
|
|
66
64
|
[GossipType.beacon_block]: {type: GossipType.beacon_block};
|
|
67
|
-
[GossipType.blob_sidecar]: {type: GossipType.blob_sidecar; subnet: SubnetID};
|
|
68
65
|
[GossipType.data_column_sidecar]: {type: GossipType.data_column_sidecar; subnet: SubnetID};
|
|
69
66
|
[GossipType.beacon_aggregate_and_proof]: {type: GossipType.beacon_aggregate_and_proof};
|
|
70
67
|
[GossipType.beacon_attestation]: {type: GossipType.beacon_attestation; subnet: SubnetID};
|
|
@@ -100,7 +97,6 @@ export type SSZTypeOfGossipTopic<T extends GossipTopic> = T extends {type: infer
|
|
|
100
97
|
|
|
101
98
|
export type GossipTypeMap = {
|
|
102
99
|
[GossipType.beacon_block]: SignedBeaconBlock;
|
|
103
|
-
[GossipType.blob_sidecar]: deneb.BlobSidecar;
|
|
104
100
|
[GossipType.beacon_aggregate_and_proof]: SignedAggregateAndProof;
|
|
105
101
|
[GossipType.beacon_attestation]: SingleAttestation;
|
|
106
102
|
[GossipType.data_column_sidecar]: DataColumnSidecar;
|
|
@@ -121,7 +117,6 @@ export type GossipTypeMap = {
|
|
|
121
117
|
|
|
122
118
|
export type GossipFnByType = {
|
|
123
119
|
[GossipType.beacon_block]: (signedBlock: SignedBeaconBlock) => Promise<void> | void;
|
|
124
|
-
[GossipType.blob_sidecar]: (blobSidecar: deneb.BlobSidecar) => Promise<void> | void;
|
|
125
120
|
[GossipType.beacon_aggregate_and_proof]: (aggregateAndProof: SignedAggregateAndProof) => Promise<void> | void;
|
|
126
121
|
[GossipType.beacon_attestation]: (attestation: SingleAttestation) => Promise<void> | void;
|
|
127
122
|
[GossipType.data_column_sidecar]: (dataColumnSidecar: DataColumnSidecar) => Promise<void> | void;
|
|
@@ -97,8 +97,6 @@ function stringifyGossipTopicType(topic: GossipTopic): string {
|
|
|
97
97
|
case GossipType.beacon_attestation:
|
|
98
98
|
case GossipType.sync_committee:
|
|
99
99
|
return `${topic.type}_${topic.subnet}`;
|
|
100
|
-
case GossipType.blob_sidecar:
|
|
101
|
-
return `${topic.type}_${topic.subnet}`;
|
|
102
100
|
case GossipType.data_column_sidecar:
|
|
103
101
|
return `${topic.type}_${topic.subnet}`;
|
|
104
102
|
}
|
|
@@ -110,8 +108,6 @@ export function getGossipSSZType(topic: GossipTopic) {
|
|
|
110
108
|
case GossipType.beacon_block:
|
|
111
109
|
// beacon_block is updated in altair to support the updated SignedBeaconBlock type
|
|
112
110
|
return ssz[fork].SignedBeaconBlock;
|
|
113
|
-
case GossipType.blob_sidecar:
|
|
114
|
-
return ssz.deneb.BlobSidecar;
|
|
115
111
|
case GossipType.data_column_sidecar:
|
|
116
112
|
return isForkPostFulu(fork) ? sszTypesFor(fork).DataColumnSidecar : ssz.fulu.DataColumnSidecar;
|
|
117
113
|
case GossipType.beacon_aggregate_and_proof:
|
|
@@ -255,13 +251,6 @@ export function parseGossipTopic(forkDigestContext: ForkDigestContext, topicStr:
|
|
|
255
251
|
}
|
|
256
252
|
}
|
|
257
253
|
|
|
258
|
-
if (gossipTypeStr.startsWith(GossipType.blob_sidecar)) {
|
|
259
|
-
const subnetStr = gossipTypeStr.slice(GossipType.blob_sidecar.length + 1); // +1 for '_' concatenating the topic name and the subnet
|
|
260
|
-
const subnet = parseInt(subnetStr, 10);
|
|
261
|
-
if (Number.isNaN(subnet)) throw Error(`subnet ${subnetStr} is not a number`);
|
|
262
|
-
return {type: GossipType.blob_sidecar, subnet, boundary, encoding};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
254
|
if (gossipTypeStr.startsWith(GossipType.data_column_sidecar)) {
|
|
266
255
|
const subnetStr = gossipTypeStr.slice(GossipType.data_column_sidecar.length + 1); // +1 for '_' concatenating the topic name and the subnet
|
|
267
256
|
const subnet = parseInt(subnetStr, 10);
|
|
@@ -309,18 +298,6 @@ export function getCoreTopicsAtFork(
|
|
|
309
298
|
topics.push(...getDataColumnSidecarTopics(networkConfig, opts.subscribeAllColumnSubnets));
|
|
310
299
|
}
|
|
311
300
|
|
|
312
|
-
// After Deneb and before Fulu also track blob_sidecar_{subnet_id}
|
|
313
|
-
if (ForkSeq[fork] >= ForkSeq.deneb && ForkSeq[fork] < ForkSeq.fulu) {
|
|
314
|
-
const {config} = networkConfig;
|
|
315
|
-
const subnetCount = isForkPostElectra(fork)
|
|
316
|
-
? config.BLOB_SIDECAR_SUBNET_COUNT_ELECTRA
|
|
317
|
-
: config.BLOB_SIDECAR_SUBNET_COUNT;
|
|
318
|
-
|
|
319
|
-
for (let subnet = 0; subnet < subnetCount; subnet++) {
|
|
320
|
-
topics.push({type: GossipType.blob_sidecar, subnet});
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
301
|
// capella
|
|
325
302
|
if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
326
303
|
topics.push({type: GossipType.bls_to_execution_change});
|
|
@@ -405,7 +382,6 @@ function parseEncodingStr(encodingStr: string): GossipEncoding {
|
|
|
405
382
|
// TODO: Review which yes, and which not
|
|
406
383
|
export const gossipTopicIgnoreDuplicatePublishError: Record<GossipType, boolean> = {
|
|
407
384
|
[GossipType.beacon_block]: true,
|
|
408
|
-
[GossipType.blob_sidecar]: true,
|
|
409
385
|
[GossipType.data_column_sidecar]: true,
|
|
410
386
|
[GossipType.beacon_aggregate_and_proof]: true,
|
|
411
387
|
[GossipType.beacon_attestation]: true,
|
|
@@ -438,7 +414,6 @@ export const gossipTopicIgnoreDuplicatePublishError: Record<GossipType, boolean>
|
|
|
438
414
|
*/
|
|
439
415
|
export const gossipTopicAllowPublishToZeroPeers: Record<GossipType, boolean> = {
|
|
440
416
|
[GossipType.beacon_block]: false,
|
|
441
|
-
[GossipType.blob_sidecar]: false,
|
|
442
417
|
// data_column_sidecar: we ensure having all topic peers via prioritizePeers(). Even with 0 peers on the
|
|
443
418
|
// topic the overall publish can still succeed, because a supernode rebuilds and publishes the missing
|
|
444
419
|
// columns for us, so track sent peers as 0 instead of raising
|
package/src/network/interface.ts
CHANGED
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
SubnetID,
|
|
31
31
|
altair,
|
|
32
32
|
capella,
|
|
33
|
-
deneb,
|
|
34
33
|
fulu,
|
|
35
34
|
gloas,
|
|
36
35
|
heze,
|
|
@@ -42,7 +41,6 @@ import {CustodyConfig} from "../util/dataColumns.js";
|
|
|
42
41
|
import {PeerIdStr} from "../util/peerId.js";
|
|
43
42
|
import {
|
|
44
43
|
BeaconBlocksByRootRequest,
|
|
45
|
-
BlobSidecarsByRootRequest,
|
|
46
44
|
DataColumnSidecarsByRootRequest,
|
|
47
45
|
ExecutionPayloadEnvelopesByRootRequest,
|
|
48
46
|
} from "../util/types.js";
|
|
@@ -82,8 +80,6 @@ export interface INetwork extends INetworkCorePublic {
|
|
|
82
80
|
sendBeaconBlocksByRange(peerId: PeerIdStr, request: phase0.BeaconBlocksByRangeRequest): Promise<SignedBeaconBlock[]>;
|
|
83
81
|
sendBeaconBlocksByRoot(peerId: PeerIdStr, request: BeaconBlocksByRootRequest): Promise<SignedBeaconBlock[]>;
|
|
84
82
|
sendBeaconBlocksByHead(peerId: PeerIdStr, request: fulu.BeaconBlocksByHeadRequest): Promise<SignedBeaconBlock[]>;
|
|
85
|
-
sendBlobSidecarsByRange(peerId: PeerIdStr, request: deneb.BlobSidecarsByRangeRequest): Promise<deneb.BlobSidecar[]>;
|
|
86
|
-
sendBlobSidecarsByRoot(peerId: PeerIdStr, request: BlobSidecarsByRootRequest): Promise<deneb.BlobSidecar[]>;
|
|
87
83
|
sendDataColumnSidecarsByRange(
|
|
88
84
|
peerId: PeerIdStr,
|
|
89
85
|
request: fulu.DataColumnSidecarsByRangeRequest
|
|
@@ -103,7 +99,6 @@ export interface INetwork extends INetworkCorePublic {
|
|
|
103
99
|
|
|
104
100
|
// Gossip
|
|
105
101
|
publishBeaconBlock(signedBlock: SignedBeaconBlock): Promise<number>;
|
|
106
|
-
publishBlobSidecar(blobSidecar: deneb.BlobSidecar): Promise<number>;
|
|
107
102
|
publishBeaconAggregateAndProof(aggregateAndProof: SignedAggregateAndProof): Promise<number>;
|
|
108
103
|
publishBeaconAttestation(attestation: SingleAttestation, subnet: SubnetID): Promise<number>;
|
|
109
104
|
publishDataColumnSidecar(
|
package/src/network/network.ts
CHANGED
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
SignedAggregateAndProof,
|
|
20
20
|
SignedBeaconBlock,
|
|
21
21
|
SingleAttestation,
|
|
22
|
+
Slot,
|
|
22
23
|
SlotRootHex,
|
|
23
24
|
SubnetID,
|
|
24
25
|
altair,
|
|
25
26
|
capella,
|
|
26
|
-
deneb,
|
|
27
27
|
fulu,
|
|
28
28
|
gloas,
|
|
29
29
|
heze,
|
|
@@ -43,7 +43,6 @@ import {PeerIdStr, peerIdToString} from "../util/peerId.js";
|
|
|
43
43
|
import {promiseAllMaybeAsync} from "../util/promises.js";
|
|
44
44
|
import {
|
|
45
45
|
BeaconBlocksByRootRequest,
|
|
46
|
-
BlobSidecarsByRootRequest,
|
|
47
46
|
DataColumnSidecarsByRootRequest,
|
|
48
47
|
ExecutionPayloadEnvelopesByRootRequest,
|
|
49
48
|
} from "../util/types.js";
|
|
@@ -150,9 +149,9 @@ export class Network implements INetwork {
|
|
|
150
149
|
this.chain.emitter.on(routes.events.EventType.lightClientOptimisticUpdate, this.onLightClientOptimisticUpdate);
|
|
151
150
|
this.chain.emitter.on(ChainEvent.updateTargetCustodyGroupCount, this.onTargetGroupCountUpdated);
|
|
152
151
|
this.chain.emitter.on(ChainEvent.publishDataColumns, this.onPublishDataColumns);
|
|
153
|
-
this.chain.emitter.on(ChainEvent.publishBlobSidecars, this.onPublishBlobSidecars);
|
|
154
152
|
this.chain.emitter.on(ChainEvent.publishProposerSlashing, this.onPublishProposerSlashing);
|
|
155
153
|
this.chain.emitter.on(ChainEvent.updateStatus, this.onUpdateStatus);
|
|
154
|
+
this.chain.emitter.on(ChainEvent.localProposalSlots, this.onLocalProposalSlots);
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
static async init({
|
|
@@ -255,9 +254,9 @@ export class Network implements INetwork {
|
|
|
255
254
|
this.chain.emitter.off(routes.events.EventType.lightClientOptimisticUpdate, this.onLightClientOptimisticUpdate);
|
|
256
255
|
this.chain.emitter.off(ChainEvent.updateTargetCustodyGroupCount, this.onTargetGroupCountUpdated);
|
|
257
256
|
this.chain.emitter.off(ChainEvent.publishDataColumns, this.onPublishDataColumns);
|
|
258
|
-
this.chain.emitter.off(ChainEvent.publishBlobSidecars, this.onPublishBlobSidecars);
|
|
259
257
|
this.chain.emitter.off(ChainEvent.publishProposerSlashing, this.onPublishProposerSlashing);
|
|
260
258
|
this.chain.emitter.off(ChainEvent.updateStatus, this.onUpdateStatus);
|
|
259
|
+
this.chain.emitter.off(ChainEvent.localProposalSlots, this.onLocalProposalSlots);
|
|
261
260
|
this.connectedPeersSyncMeta.clear();
|
|
262
261
|
this.subscribedToCoreTopics = false;
|
|
263
262
|
const results = await Promise.allSettled([this.networkProcessor.stop(), this.core.close()]);
|
|
@@ -285,6 +284,13 @@ export class Network implements INetwork {
|
|
|
285
284
|
return this.core.prepareBeaconCommitteeSubnets(subscriptions);
|
|
286
285
|
}
|
|
287
286
|
|
|
287
|
+
/** The core subscribes to all attestation subnets before these proposals, see `slotsToSubscribeBeforeProposalDuty` */
|
|
288
|
+
private onLocalProposalSlots = (proposalSlots: Slot[]): void => {
|
|
289
|
+
this.core.addLocalProposalSlots(proposalSlots).catch((e) => {
|
|
290
|
+
this.logger.debug("Error adding local proposal slots", {slots: proposalSlots.join(",")}, e as Error);
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
|
|
288
294
|
async prepareSyncCommitteeSubnets(subscriptions: CommitteeSubscription[]): Promise<void> {
|
|
289
295
|
return this.core.prepareSyncCommitteeSubnets(subscriptions);
|
|
290
296
|
}
|
|
@@ -373,15 +379,6 @@ export class Network implements INetwork {
|
|
|
373
379
|
return this.publishGossip<GossipType.beacon_block>({type: GossipType.beacon_block, boundary}, signedBlock);
|
|
374
380
|
}
|
|
375
381
|
|
|
376
|
-
async publishBlobSidecar(blobSidecar: deneb.BlobSidecar): Promise<number> {
|
|
377
|
-
const epoch = computeEpochAtSlot(blobSidecar.signedBlockHeader.message.slot);
|
|
378
|
-
const boundary = this.config.getForkBoundaryAtEpoch(epoch);
|
|
379
|
-
|
|
380
|
-
const subnet = blobSidecar.index;
|
|
381
|
-
|
|
382
|
-
return this.publishGossip<GossipType.blob_sidecar>({type: GossipType.blob_sidecar, boundary, subnet}, blobSidecar);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
382
|
async publishDataColumnSidecar(
|
|
386
383
|
dataColumnSidecar: DataColumnSidecar
|
|
387
384
|
): Promise<{sentPeers: number; alreadyPublished: boolean}> {
|
|
@@ -662,28 +659,6 @@ export class Network implements INetwork {
|
|
|
662
659
|
);
|
|
663
660
|
}
|
|
664
661
|
|
|
665
|
-
async sendBlobSidecarsByRange(
|
|
666
|
-
peerId: PeerIdStr,
|
|
667
|
-
request: deneb.BlobSidecarsByRangeRequest
|
|
668
|
-
): Promise<deneb.BlobSidecar[]> {
|
|
669
|
-
const epoch = computeEpochAtSlot(request.startSlot);
|
|
670
|
-
return collectMaxResponseTyped(
|
|
671
|
-
this.sendReqRespRequest(peerId, ReqRespMethod.BlobSidecarsByRange, [Version.V1], request),
|
|
672
|
-
// request's count represent the slots, so the actual max count received could be slots * blobs per slot
|
|
673
|
-
request.count * this.config.getMaxBlobsPerBlock(epoch),
|
|
674
|
-
responseSszTypeByMethod[ReqRespMethod.BlobSidecarsByRange]
|
|
675
|
-
);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
async sendBlobSidecarsByRoot(peerId: PeerIdStr, request: BlobSidecarsByRootRequest): Promise<deneb.BlobSidecar[]> {
|
|
679
|
-
return collectMaxResponseTyped(
|
|
680
|
-
this.sendReqRespRequest(peerId, ReqRespMethod.BlobSidecarsByRoot, [Version.V1], request),
|
|
681
|
-
request.length,
|
|
682
|
-
responseSszTypeByMethod[ReqRespMethod.BlobSidecarsByRoot],
|
|
683
|
-
this.chain.serializedCache
|
|
684
|
-
);
|
|
685
|
-
}
|
|
686
|
-
|
|
687
662
|
async sendDataColumnSidecarsByRange(
|
|
688
663
|
peerId: PeerIdStr,
|
|
689
664
|
request: fulu.DataColumnSidecarsByRangeRequest
|
|
@@ -884,10 +859,6 @@ export class Network implements INetwork {
|
|
|
884
859
|
await promiseAllMaybeAsync(sidecars.map((sidecar) => () => this.publishDataColumnSidecar(sidecar)));
|
|
885
860
|
};
|
|
886
861
|
|
|
887
|
-
private onPublishBlobSidecars = (sidecars: deneb.BlobSidecar[]): Promise<number[]> => {
|
|
888
|
-
return promiseAllMaybeAsync(sidecars.map((sidecar) => () => this.publishBlobSidecar(sidecar)));
|
|
889
|
-
};
|
|
890
|
-
|
|
891
862
|
private onPublishProposerSlashing = async (proposerSlashing: phase0.ProposerSlashing): Promise<void> => {
|
|
892
863
|
try {
|
|
893
864
|
await this.publishProposerSlashing(proposerSlashing);
|
package/src/network/options.ts
CHANGED
|
@@ -74,6 +74,8 @@ export const defaultNetworkOptions: NetworkOptions = {
|
|
|
74
74
|
maxYoungGenerationSizeMb: 152,
|
|
75
75
|
// subscribe 2 slots before aggregator dutied slot to get stable mesh peers as monitored on goerli
|
|
76
76
|
slotsToSubscribeBeforeAggregatorDuty: 2,
|
|
77
|
+
// up to the max number of attestations per block
|
|
78
|
+
slotsToSubscribeBeforeProposalDuty: 8,
|
|
77
79
|
// This will enable the light client server by default
|
|
78
80
|
disableLightClientServer: false,
|
|
79
81
|
quic: true,
|
|
@@ -66,11 +66,14 @@ export class SubnetMap {
|
|
|
66
66
|
return subnets;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Return subnetIds with a `toSlot` less than `currentSlot`. Also deletes expired entries
|
|
71
|
+
* @param keep expired subnets for which it returns true are neither returned nor deleted
|
|
72
|
+
*/
|
|
73
|
+
getExpired(currentSlot: Slot, keep?: (subnet: SubnetID) => boolean): SubnetID[] {
|
|
71
74
|
const subnetIds: SubnetID[] = [];
|
|
72
75
|
for (const [subnet, toSlot] of this.subnets.entries()) {
|
|
73
|
-
if (toSlot < currentSlot) {
|
|
76
|
+
if (toSlot < currentSlot && keep?.(subnet) !== true) {
|
|
74
77
|
subnetIds.push(subnet);
|
|
75
78
|
this.subnets.delete(subnet);
|
|
76
79
|
}
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
getBlockRootFromPayloadAttestationMessageSerialized,
|
|
7
7
|
getBlockRootFromSignedAggregateAndProofSerialized,
|
|
8
8
|
getSlotFromBeaconAttestationSerialized,
|
|
9
|
-
getSlotFromBlobSidecarSerialized,
|
|
10
9
|
getSlotFromDataColumnSidecarSerialized,
|
|
11
10
|
getSlotFromExecutionPayloadEnvelopeSerialized,
|
|
12
11
|
getSlotFromPayloadAttestationMessageSerialized,
|
|
@@ -49,14 +48,6 @@ export function createExtractBlockSlotRootFns(): ExtractSlotRootFns {
|
|
|
49
48
|
}
|
|
50
49
|
return {slot};
|
|
51
50
|
},
|
|
52
|
-
[GossipType.blob_sidecar]: (data: Uint8Array): SlotOptionalRoot | null => {
|
|
53
|
-
const slot = getSlotFromBlobSidecarSerialized(data);
|
|
54
|
-
|
|
55
|
-
if (slot === null) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
return {slot};
|
|
59
|
-
},
|
|
60
51
|
[GossipType.data_column_sidecar]: (data: Uint8Array, fork: ForkName): SlotOptionalRoot | null => {
|
|
61
52
|
const slot = getSlotFromDataColumnSidecarSerialized(data, fork);
|
|
62
53
|
|