@lodestar/beacon-node 1.50.0-dev.8ba9d1dd30 → 1.50.0-dev.9203d3d7da
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 +13 -3
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/index.js +13 -0
- package/lib/api/impl/beacon/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +28 -6
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +26 -18
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts +1 -0
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +80 -18
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +0 -2
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +4 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts +5 -0
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +14 -24
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +5 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -1
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +2 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/beaconProposerCache.d.ts +6 -0
- package/lib/chain/beaconProposerCache.d.ts.map +1 -1
- package/lib/chain/beaconProposerCache.js +16 -0
- package/lib/chain/beaconProposerCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +20 -11
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +7 -7
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +2 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +5 -4
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +10 -5
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +105 -35
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +7 -1
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -0
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/envelopeReconstructionError.d.ts +5 -0
- package/lib/chain/errors/envelopeReconstructionError.d.ts.map +1 -1
- package/lib/chain/errors/envelopeReconstructionError.js +2 -0
- package/lib/chain/errors/envelopeReconstructionError.js.map +1 -1
- package/lib/chain/errors/gossipValidation.d.ts +1 -0
- package/lib/chain/errors/gossipValidation.d.ts.map +1 -1
- package/lib/chain/errors/gossipValidation.js +1 -0
- package/lib/chain/errors/gossipValidation.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +2 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +6 -3
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +4 -2
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +30 -8
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +1 -23
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.d.ts +8 -4
- package/lib/chain/opPools/proposerPreferencesPool.d.ts.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.js +27 -12
- package/lib/chain/opPools/proposerPreferencesPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +11 -0
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +22 -0
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +2 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +15 -6
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +8 -0
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +48 -34
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +2 -0
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +10 -4
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/reprocess.d.ts +2 -1
- package/lib/chain/reprocess.d.ts.map +1 -1
- package/lib/chain/reprocess.js +2 -1
- package/lib/chain/reprocess.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -0
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +22 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +9 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +23 -13
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +18 -8
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +72 -18
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +5 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +70 -58
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/constants/constants.d.ts +1 -0
- package/lib/constants/constants.d.ts.map +1 -1
- package/lib/constants/constants.js +1 -0
- package/lib/constants/constants.js.map +1 -1
- package/lib/db/beacon.d.ts +4 -1
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +6 -1
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/buckets.d.ts +3 -1
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -0
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/interface.d.ts +4 -1
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/blockArchive.js +2 -2
- package/lib/db/repositories/blockArchive.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +3 -3
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.js +1 -2
- package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
- package/lib/db/repositories/earliestAvailableSlot.d.ts +11 -0
- package/lib/db/repositories/earliestAvailableSlot.d.ts.map +1 -0
- package/lib/db/repositories/earliestAvailableSlot.js +19 -0
- package/lib/db/repositories/earliestAvailableSlot.js.map +1 -0
- package/lib/db/repositories/index.d.ts +1 -0
- package/lib/db/repositories/index.d.ts.map +1 -1
- package/lib/db/repositories/index.js +1 -0
- package/lib/db/repositories/index.js.map +1 -1
- package/lib/db/repositories/proposerPreferences.d.ts +14 -0
- package/lib/db/repositories/proposerPreferences.d.ts.map +1 -0
- package/lib/db/repositories/proposerPreferences.js +21 -0
- package/lib/db/repositories/proposerPreferences.js.map +1 -0
- package/lib/execution/engine/blobVersionedHashes.d.ts +9 -0
- package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -0
- package/lib/execution/engine/blobVersionedHashes.js +74 -0
- package/lib/execution/engine/blobVersionedHashes.js.map +1 -0
- package/lib/execution/engine/disabled.d.ts +0 -2
- package/lib/execution/engine/disabled.d.ts.map +1 -1
- package/lib/execution/engine/disabled.js +0 -6
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +46 -16
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +236 -213
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.d.ts +3 -2
- package/lib/execution/engine/index.d.ts.map +1 -1
- package/lib/execution/engine/index.js +33 -8
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +2 -4
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +25 -0
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -0
- package/lib/execution/engine/jsonRpcTransport.js +158 -0
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -0
- package/lib/execution/engine/mock.d.ts +0 -2
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +0 -8
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/restHttpClient.d.ts +71 -0
- package/lib/execution/engine/restHttpClient.d.ts.map +1 -0
- package/lib/execution/engine/restHttpClient.js +201 -0
- package/lib/execution/engine/restHttpClient.js.map +1 -0
- package/lib/execution/engine/restTransport.d.ts +46 -0
- package/lib/execution/engine/restTransport.d.ts.map +1 -0
- package/lib/execution/engine/restTransport.js +399 -0
- package/lib/execution/engine/restTransport.js.map +1 -0
- package/lib/execution/engine/sszTypes.d.ts +1261 -0
- package/lib/execution/engine/sszTypes.d.ts.map +1 -0
- package/lib/execution/engine/sszTypes.js +216 -0
- package/lib/execution/engine/sszTypes.js.map +1 -0
- package/lib/execution/engine/transport.d.ts +39 -0
- package/lib/execution/engine/transport.d.ts.map +1 -0
- package/lib/execution/engine/transport.js +2 -0
- package/lib/execution/engine/transport.js.map +1 -0
- package/lib/execution/engine/types.d.ts +2 -8
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +24 -57
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts.map +1 -1
- package/lib/execution/engine/utils.js +9 -2
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +10 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +22 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/metrics.d.ts +7 -3
- package/lib/metrics/metrics.d.ts.map +1 -1
- package/lib/metrics/metrics.js +4 -4
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/network/core/events.d.ts +5 -1
- package/lib/network/core/events.d.ts.map +1 -1
- package/lib/network/core/events.js +8 -0
- package/lib/network/core/events.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +0 -14
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +63 -64
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts +4 -2
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +6 -2
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts +8 -0
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +52 -5
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
- package/lib/network/reqresp/rateLimit.js +2 -2
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts.map +1 -1
- package/lib/network/subnets/attnetsService.js +3 -1
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/node/nodejs.d.ts +3 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +27 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +12 -13
- package/lib/node/notifier.js.map +1 -1
- package/lib/node/options.d.ts +3 -2
- package/lib/node/options.d.ts.map +1 -1
- package/lib/node/options.js +2 -2
- package/lib/node/options.js.map +1 -1
- package/lib/sync/range/batch.d.ts +11 -5
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +21 -17
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +4 -4
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +12 -6
- 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 +75 -29
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +5 -2
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +52 -26
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +38 -14
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +84 -39
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/util/asyncIterableToEvents.d.ts +10 -2
- package/lib/util/asyncIterableToEvents.d.ts.map +1 -1
- package/lib/util/asyncIterableToEvents.js +29 -3
- package/lib/util/asyncIterableToEvents.js.map +1 -1
- package/lib/util/clock.d.ts.map +1 -1
- package/lib/util/clock.js +3 -4
- package/lib/util/clock.js.map +1 -1
- package/lib/util/execution.d.ts +9 -11
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +5 -1
- package/lib/util/execution.js.map +1 -1
- package/lib/util/metadata.d.ts.map +1 -1
- package/lib/util/metadata.js +2 -1
- package/lib/util/metadata.js.map +1 -1
- package/lib/util/sszBytes.d.ts +2 -2
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +22 -14
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +18 -17
- package/src/api/impl/beacon/blocks/index.ts +17 -7
- package/src/api/impl/beacon/index.ts +15 -0
- package/src/api/impl/beacon/state/index.ts +43 -6
- package/src/api/impl/debug/index.ts +28 -19
- package/src/api/impl/validator/index.ts +102 -21
- package/src/chain/ColumnReconstructionTracker.ts +4 -6
- package/src/chain/archiveStore/archiveStore.ts +19 -25
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +5 -7
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +1 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -2
- package/src/chain/archiveStore/historicalState/worker.ts +1 -2
- package/src/chain/archiveStore/interface.ts +1 -1
- package/src/chain/archiveStore/utils/pruneHistory.ts +4 -1
- package/src/chain/beaconProposerCache.ts +19 -1
- package/src/chain/blocks/blockInput/blockInput.ts +1 -1
- package/src/chain/blocks/importBlock.ts +24 -10
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/verifyBlock.ts +8 -6
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -3
- package/src/chain/chain.ts +135 -37
- package/src/chain/emitter.ts +7 -1
- package/src/chain/errors/envelopeReconstructionError.ts +3 -0
- package/src/chain/errors/gossipValidation.ts +1 -0
- package/src/chain/forkChoice/index.ts +2 -0
- package/src/chain/interface.ts +7 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +34 -10
- package/src/chain/opPools/opPool.ts +1 -31
- package/src/chain/opPools/proposerPreferencesPool.ts +34 -11
- package/src/chain/opPools/utils.ts +31 -0
- package/src/chain/options.ts +3 -3
- package/src/chain/prepareNextSlot.ts +22 -6
- package/src/chain/produceBlock/computeNewStateRoot.ts +10 -3
- package/src/chain/produceBlock/produceBlockBody.ts +78 -39
- package/src/chain/regen/regen.ts +12 -4
- package/src/chain/reprocess.ts +2 -1
- package/src/chain/seenCache/seenGossipBlockInput.ts +25 -1
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +31 -13
- package/src/chain/shufflingCache.ts +84 -22
- package/src/chain/stateCache/persistentCheckpointsCache.ts +4 -1
- package/src/chain/validatorMonitor.ts +82 -61
- package/src/constants/constants.ts +1 -0
- package/src/db/beacon.ts +6 -0
- package/src/db/buckets.ts +2 -0
- package/src/db/interface.ts +4 -0
- package/src/db/repositories/blockArchive.ts +2 -2
- package/src/db/repositories/blockArchiveIndex.ts +2 -3
- package/src/db/repositories/earliestAvailableSlot.ts +19 -0
- package/src/db/repositories/index.ts +1 -0
- package/src/db/repositories/proposerPreferences.ts +23 -0
- package/src/execution/engine/blobVersionedHashes.ts +72 -0
- package/src/execution/engine/disabled.ts +0 -8
- package/src/execution/engine/http.ts +304 -300
- package/src/execution/engine/index.ts +41 -7
- package/src/execution/engine/interface.ts +2 -6
- package/src/execution/engine/jsonRpcTransport.ts +247 -0
- package/src/execution/engine/mock.ts +1 -19
- package/src/execution/engine/restHttpClient.ts +269 -0
- package/src/execution/engine/restTransport.ts +544 -0
- package/src/execution/engine/sszTypes.ts +354 -0
- package/src/execution/engine/transport.ts +61 -0
- package/src/execution/engine/types.ts +34 -84
- package/src/execution/engine/utils.ts +12 -2
- package/src/metrics/metrics/lodestar.ts +23 -0
- package/src/metrics/metrics.ts +21 -6
- package/src/network/core/events.ts +16 -1
- package/src/network/processor/gossipHandlers.ts +94 -77
- package/src/network/processor/gossipValidatorFn.ts +12 -2
- package/src/network/processor/index.ts +58 -5
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +1 -1
- package/src/network/reqresp/rateLimit.ts +2 -2
- package/src/network/subnets/attnetsService.ts +8 -3
- package/src/node/nodejs.ts +35 -3
- package/src/node/notifier.ts +14 -13
- package/src/node/options.ts +10 -1
- package/src/sync/range/batch.ts +25 -19
- package/src/sync/range/chain.ts +15 -8
- package/src/sync/range/range.ts +76 -30
- package/src/sync/unknownBlock.ts +65 -27
- package/src/sync/utils/downloadByRange.ts +123 -58
- package/src/util/asyncIterableToEvents.ts +44 -5
- package/src/util/clock.ts +3 -4
- package/src/util/execution.ts +16 -8
- package/src/util/metadata.ts +2 -1
- package/src/util/sszBytes.ts +25 -12
|
@@ -6,6 +6,10 @@ export type RequestEvent<T> = {
|
|
|
6
6
|
id: number;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
export type RequestCancelEvent = {
|
|
10
|
+
id: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
9
13
|
export enum IteratorEventType {
|
|
10
14
|
next = "iterator.next",
|
|
11
15
|
done = "iterator.done",
|
|
@@ -19,8 +23,10 @@ export type IteratorEvent<V> =
|
|
|
19
23
|
|
|
20
24
|
export type AsyncIterableEventBus<Args, Item> = {
|
|
21
25
|
emitRequest(data: RequestEvent<Args>): void;
|
|
26
|
+
emitRequestCancel(data: RequestCancelEvent): void;
|
|
22
27
|
emitResponse(data: IteratorEvent<Item>): void;
|
|
23
28
|
onRequest(handler: (data: RequestEvent<Args>) => void): void;
|
|
29
|
+
onRequestCancel(handler: (data: RequestCancelEvent) => void): void;
|
|
24
30
|
onResponse(handler: (data: IteratorEvent<Item>) => void): void;
|
|
25
31
|
};
|
|
26
32
|
|
|
@@ -37,7 +43,9 @@ export class AsyncIterableBridgeCaller<Args, Item> {
|
|
|
37
43
|
// TODO: Consider expiring the requests after no reply for long enough, t
|
|
38
44
|
private readonly pending = new Map<number, PendingItem<Item>>();
|
|
39
45
|
|
|
40
|
-
constructor(
|
|
46
|
+
constructor(
|
|
47
|
+
private readonly events: Pick<AsyncIterableEventBus<Args, Item>, "onResponse" | "emitRequest" | "emitRequestCancel">
|
|
48
|
+
) {
|
|
41
49
|
events.onResponse(this.onResponse.bind(this));
|
|
42
50
|
}
|
|
43
51
|
|
|
@@ -89,7 +97,10 @@ export class AsyncIterableBridgeCaller<Args, Item> {
|
|
|
89
97
|
|
|
90
98
|
async return() {
|
|
91
99
|
// This will be reached if the consumer called 'break' or 'return' early in the loop.
|
|
92
|
-
|
|
100
|
+
// Without the cancel the handler keeps producing items that cross the thread boundary just to be dropped
|
|
101
|
+
if (self.pending.delete(id)) {
|
|
102
|
+
self.events.emitRequestCancel({id});
|
|
103
|
+
}
|
|
93
104
|
return {value: undefined, done: true};
|
|
94
105
|
},
|
|
95
106
|
};
|
|
@@ -132,20 +143,35 @@ export class AsyncIterableBridgeCaller<Args, Item> {
|
|
|
132
143
|
}
|
|
133
144
|
|
|
134
145
|
export class AsyncIterableBridgeHandler<Args, Item> {
|
|
146
|
+
private readonly iterators = new Map<number, AsyncIterator<Item>>();
|
|
147
|
+
|
|
135
148
|
constructor(
|
|
136
|
-
private readonly events: Pick<AsyncIterableEventBus<Args, Item>, "onRequest" | "emitResponse">,
|
|
149
|
+
private readonly events: Pick<AsyncIterableEventBus<Args, Item>, "onRequest" | "onRequestCancel" | "emitResponse">,
|
|
137
150
|
private readonly handler: (args: Args) => AsyncIterable<Item>
|
|
138
151
|
) {
|
|
139
152
|
events.onRequest(this.onRequest.bind(this));
|
|
153
|
+
events.onRequestCancel(this.onRequestCancel.bind(this));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
get iteratingCount(): number {
|
|
157
|
+
return this.iterators.size;
|
|
140
158
|
}
|
|
141
159
|
|
|
142
160
|
private async onRequest(data: RequestEvent<Args>): Promise<void> {
|
|
143
161
|
try {
|
|
144
|
-
|
|
162
|
+
const iterator = this.handler(data.callArgs)[Symbol.asyncIterator]();
|
|
163
|
+
this.iterators.set(data.id, iterator);
|
|
164
|
+
|
|
165
|
+
while (true) {
|
|
166
|
+
const result = await iterator.next();
|
|
167
|
+
if (result.done) {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
|
|
145
171
|
this.events.emitResponse({
|
|
146
172
|
type: IteratorEventType.next,
|
|
147
173
|
id: data.id,
|
|
148
|
-
item,
|
|
174
|
+
item: result.value,
|
|
149
175
|
});
|
|
150
176
|
}
|
|
151
177
|
|
|
@@ -159,6 +185,19 @@ export class AsyncIterableBridgeHandler<Args, Item> {
|
|
|
159
185
|
id: data.id,
|
|
160
186
|
error: toThreadBoundaryError(e as Error),
|
|
161
187
|
});
|
|
188
|
+
} finally {
|
|
189
|
+
this.iterators.delete(data.id);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
private onRequestCancel(data: RequestCancelEvent): void {
|
|
194
|
+
const iterator = this.iterators.get(data.id);
|
|
195
|
+
if (!iterator?.return) {
|
|
196
|
+
return;
|
|
162
197
|
}
|
|
198
|
+
|
|
199
|
+
// An async generator queues return() behind the next() that is in flight, so at most one more
|
|
200
|
+
// item is produced before its finally blocks run. Any error surfaces through that next() call.
|
|
201
|
+
void iterator.return().catch(() => {});
|
|
163
202
|
}
|
|
164
203
|
}
|
package/src/util/clock.ts
CHANGED
|
@@ -78,9 +78,9 @@ export class Clock extends EventEmitter implements IClock {
|
|
|
78
78
|
|
|
79
79
|
this.config = config;
|
|
80
80
|
this.genesisTime = genesisTime;
|
|
81
|
-
this.timeoutId = setTimeout(this.onNextSlot, this.msUntilNextSlot());
|
|
82
81
|
this.signal = signal;
|
|
83
82
|
this._currentSlot = getCurrentSlot(this.config, this.genesisTime);
|
|
83
|
+
this.timeoutId = setTimeout(this.onNextSlot, this.msUntilNextSlot());
|
|
84
84
|
this.signal.addEventListener("abort", () => clearTimeout(this.timeoutId), {once: true});
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -204,8 +204,7 @@ export class Clock extends EventEmitter implements IClock {
|
|
|
204
204
|
};
|
|
205
205
|
|
|
206
206
|
private msUntilNextSlot(): number {
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
return milliSecondsPerSlot - (diffInMilliSeconds % milliSecondsPerSlot);
|
|
207
|
+
const nextSlotTimeSec = computeTimeAtSlot(this.config, this._currentSlot + 1, this.genesisTime);
|
|
208
|
+
return Math.max(0, nextSlotTimeSec * 1000 - Date.now());
|
|
210
209
|
}
|
|
211
210
|
}
|
package/src/util/execution.ts
CHANGED
|
@@ -266,14 +266,15 @@ type SlotEnvelopeBytes = {slot: Slot; envelopeBytes: Uint8Array};
|
|
|
266
266
|
|
|
267
267
|
type RangeEntry = ArchivedEnvelope & {slot: Slot};
|
|
268
268
|
|
|
269
|
-
/** What
|
|
270
|
-
export type
|
|
269
|
+
/** What an envelope that cannot be rebuilt (EL-unavailable body or body root mismatch) means on a given serving path */
|
|
270
|
+
export type ReconstructMissPolicy = "throw" | "omit";
|
|
271
271
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
272
|
+
/**
|
|
273
|
+
* An archived envelope that could not be rebuilt. `"unavailable"`: the EL does not have the block or its
|
|
274
|
+
* block access list (BODY_UNAVAILABLE). `"mismatch"`: an EL body does not hash to its stored root, a local
|
|
275
|
+
* inconsistency (BODY_ROOT_MISMATCH). `error` carries the matching code for paths that surface it.
|
|
276
|
+
*/
|
|
277
|
+
export type RebuildMiss = {slot: Slot; reason: "unavailable" | "mismatch"; error: EnvelopeReconstructionError};
|
|
277
278
|
|
|
278
279
|
/**
|
|
279
280
|
* Stream finalized envelopes over [startSlot, endSlot) as serialized bytes, rebuilding header
|
|
@@ -405,7 +406,14 @@ async function reconstructEnvelopesBatch(
|
|
|
405
406
|
// A zero-length block access list cannot be valid, RLP encodes an empty list as 0xc0
|
|
406
407
|
if (body == null || body.withdrawals == null || body.blockAccessList == null || body.blockAccessList.length === 0) {
|
|
407
408
|
metrics?.payloadEnvelopeReconstruction.envelopes.inc({result: "unavailable"});
|
|
408
|
-
return {
|
|
409
|
+
return {
|
|
410
|
+
slot,
|
|
411
|
+
reason: "unavailable",
|
|
412
|
+
error: new EnvelopeReconstructionError(
|
|
413
|
+
{code: EnvelopeReconstructionErrorCode.BODY_UNAVAILABLE, slot},
|
|
414
|
+
`execution client cannot serve the payload body or block access list for archived envelope slot=${slot}`
|
|
415
|
+
),
|
|
416
|
+
};
|
|
409
417
|
}
|
|
410
418
|
try {
|
|
411
419
|
const envelope = signedHeaderEnvelopeToFull(headerEnvelope, {
|
package/src/util/metadata.ts
CHANGED
|
@@ -6,7 +6,8 @@ export function getLodestarClientVersion(info?: {version?: string; commit?: stri
|
|
|
6
6
|
code: ClientCode.LS,
|
|
7
7
|
name: "Lodestar",
|
|
8
8
|
version: info?.version ?? "",
|
|
9
|
-
commit
|
|
9
|
+
// engine_getClientVersionV1 defines commit as 4 bytes, so builds without git data must not send an empty one
|
|
10
|
+
commit: info?.commit ? info.commit.slice(0, 8) : "00000000",
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
|
package/src/util/sszBytes.ts
CHANGED
|
@@ -6,10 +6,12 @@ import {
|
|
|
6
6
|
FIELD_ELEMENTS_PER_BLOB,
|
|
7
7
|
ForkName,
|
|
8
8
|
ForkPostDeneb,
|
|
9
|
+
ForkPostGloas,
|
|
9
10
|
ForkSeq,
|
|
10
11
|
MAX_COMMITTEES_PER_SLOT,
|
|
11
12
|
isForkPostElectra,
|
|
12
13
|
isForkPostGloas,
|
|
14
|
+
isForkPostHeze,
|
|
13
15
|
} from "@lodestar/params";
|
|
14
16
|
import {BLSSignature, CommitteeIndex, RootHex, Slot, ValidatorIndex, ssz} from "@lodestar/types";
|
|
15
17
|
|
|
@@ -57,6 +59,8 @@ const ATTESTATION_DATA_SIZE = 128;
|
|
|
57
59
|
// MAX_COMMITTEES_PER_SLOT is in bit, need to convert to byte
|
|
58
60
|
const COMMITTEE_BITS_SIZE = Math.max(Math.ceil(MAX_COMMITTEES_PER_SLOT / 8), 1);
|
|
59
61
|
const SIGNATURE_SIZE = 96;
|
|
62
|
+
// SyncAggregate is a fixed-size container, so minSize is its serialized size
|
|
63
|
+
const SYNC_AGGREGATE_SIZE = ssz.altair.SyncAggregate.minSize;
|
|
60
64
|
const SINGLE_ATTESTATION_ATTDATA_OFFSET = 8 + 8;
|
|
61
65
|
const SINGLE_ATTESTATION_SLOT_OFFSET = SINGLE_ATTESTATION_ATTDATA_OFFSET;
|
|
62
66
|
const SINGLE_ATTESTATION_COMMITTEE_INDEX_OFFSET = 0;
|
|
@@ -447,30 +451,39 @@ export function getParentRootFromSignedBeaconBlockSerialized(data: Uint8Array):
|
|
|
447
451
|
* BeaconBlockBody (GLOAS) fixed section before signedExecutionPayloadBid offset pointer:
|
|
448
452
|
* randaoReveal(96) + eth1Data(72) + graffiti(32)
|
|
449
453
|
* + proposerSlashings(4) + attesterSlashings(4) + attestations(4) + deposits(4) + voluntaryExits(4)
|
|
450
|
-
* + syncAggregate(
|
|
454
|
+
* + syncAggregate(SyncAggregate.minSize) + blsToExecutionChanges(4) = 384 bytes (mainnet preset)
|
|
451
455
|
*
|
|
452
|
-
*
|
|
456
|
+
* Heze body: randaoReveal(96) + graffiti(32) + proposerSlashings(4) + attesterSlashings(4) + attestations(4) + voluntaryExits(4) + syncAggregate(SyncAggregate.minSize) + blsToExecutionChanges(4) = 308 bytes (mainnet preset)
|
|
457
|
+
*
|
|
458
|
+
* The 4-byte pointer at byte 568 (= 184+384) for Gloas and 492 (= 184+308) for Heze (mainnet preset) gives the offset of SignedExecutionPayloadBid
|
|
453
459
|
* within BeaconBlockBody. parentBlockHash is at that bid's byte 100 (after offset+sig).
|
|
454
460
|
*/
|
|
455
461
|
// BeaconBlock body starts after: msg_offset(4) + sig(96) + slot(8) + proposer_index(8) + parent_root(32) + state_root(32) + body_offset_ptr(4)
|
|
456
462
|
const GLOAS_BODY_START_IN_SIGNED_BEACON_BLOCK =
|
|
457
463
|
VARIABLE_FIELD_OFFSET + SIGNATURE_SIZE + SLOT_SIZE + 8 + ROOT_SIZE + ROOT_SIZE + VARIABLE_FIELD_OFFSET; // = 184
|
|
458
|
-
const GLOAS_SIGNED_BID_OFFSET_POINTER_IN_BODY = 96 + 72 + 32 + 4 + 4 + 4 + 4 + 4 +
|
|
459
|
-
|
|
460
|
-
|
|
464
|
+
const GLOAS_SIGNED_BID_OFFSET_POINTER_IN_BODY = 96 + 72 + 32 + 4 + 4 + 4 + 4 + 4 + SYNC_AGGREGATE_SIZE + 4; // = 384 at mainnet preset
|
|
465
|
+
// Heze removes eth1Data (72 B) and the deposits offset (4 B) from the body fixed section
|
|
466
|
+
const HEZE_SIGNED_BID_OFFSET_POINTER_IN_BODY = GLOAS_SIGNED_BID_OFFSET_POINTER_IN_BODY - 72 - VARIABLE_FIELD_OFFSET; // = 308
|
|
461
467
|
// Within SignedExecutionPayloadBid, parentBlockHash is at byte 100 (msg_offset:4 + sig:96)
|
|
462
468
|
const PARENT_BLOCK_HASH_OFFSET_IN_SIGNED_BID = VARIABLE_FIELD_OFFSET + SIGNATURE_SIZE; // = 100
|
|
463
469
|
|
|
464
|
-
// CAUTION: update offsets if BeaconBlockBody fixed fields change after
|
|
465
|
-
export function getParentBlockHashFromGloasSignedBeaconBlockSerialized(
|
|
466
|
-
|
|
470
|
+
// CAUTION: update offsets if BeaconBlockBody fixed fields change after Heze
|
|
471
|
+
export function getParentBlockHashFromGloasSignedBeaconBlockSerialized(
|
|
472
|
+
data: Uint8Array,
|
|
473
|
+
fork: ForkPostGloas
|
|
474
|
+
): RootHex | null {
|
|
475
|
+
const bidOffsetPointer =
|
|
476
|
+
GLOAS_BODY_START_IN_SIGNED_BEACON_BLOCK +
|
|
477
|
+
(isForkPostHeze(fork) ? HEZE_SIGNED_BID_OFFSET_POINTER_IN_BODY : GLOAS_SIGNED_BID_OFFSET_POINTER_IN_BODY);
|
|
478
|
+
if (data.length < bidOffsetPointer + VARIABLE_FIELD_OFFSET) {
|
|
467
479
|
return null;
|
|
468
480
|
}
|
|
469
481
|
const bidOffset =
|
|
470
|
-
data[
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
482
|
+
(data[bidOffsetPointer] |
|
|
483
|
+
(data[bidOffsetPointer + 1] << 8) |
|
|
484
|
+
(data[bidOffsetPointer + 2] << 16) |
|
|
485
|
+
(data[bidOffsetPointer + 3] << 24)) >>>
|
|
486
|
+
0;
|
|
474
487
|
|
|
475
488
|
const parentBlockHashStart =
|
|
476
489
|
GLOAS_BODY_START_IN_SIGNED_BEACON_BLOCK + bidOffset + PARENT_BLOCK_HASH_OFFSET_IN_SIGNED_BID;
|