@lodestar/beacon-node 1.35.0-dev.f80d2d52da → 1.35.0-dev.fd1dac853d
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/api.d.ts.map +1 -0
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -0
- package/lib/api/impl/beacon/blocks/index.js +58 -46
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/blocks/utils.d.ts.map +1 -0
- package/lib/api/impl/beacon/index.d.ts.map +1 -0
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -0
- package/lib/api/impl/beacon/pool/index.js +3 -3
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/rewards/index.d.ts.map +1 -0
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -0
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -0
- package/lib/api/impl/config/constants.d.ts +5 -0
- package/lib/api/impl/config/constants.d.ts.map +1 -0
- package/lib/api/impl/config/constants.js +6 -1
- package/lib/api/impl/config/constants.js.map +1 -1
- package/lib/api/impl/config/index.d.ts.map +1 -0
- package/lib/api/impl/debug/index.d.ts.map +1 -0
- package/lib/api/impl/debug/index.js +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/errors.d.ts.map +1 -0
- package/lib/api/impl/errors.js +2 -0
- package/lib/api/impl/errors.js.map +1 -1
- package/lib/api/impl/events/index.d.ts.map +1 -0
- package/lib/api/impl/index.d.ts +3 -3
- package/lib/api/impl/index.d.ts.map +1 -0
- package/lib/api/impl/index.js +3 -3
- package/lib/api/impl/index.js.map +1 -1
- package/lib/api/impl/lightclient/index.d.ts.map +1 -0
- package/lib/api/impl/lodestar/index.d.ts.map +1 -0
- package/lib/api/impl/lodestar/index.js +2 -2
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/node/index.d.ts.map +1 -0
- package/lib/api/impl/node/utils.d.ts.map +1 -0
- package/lib/api/impl/proof/index.d.ts.map +1 -0
- package/lib/api/impl/types.d.ts.map +1 -0
- package/lib/api/impl/utils.d.ts.map +1 -0
- package/lib/api/impl/validator/index.d.ts.map +1 -0
- package/lib/api/impl/validator/index.js +22 -26
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts.map +1 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/options.d.ts.map +1 -0
- package/lib/api/rest/activeSockets.d.ts.map +1 -0
- package/lib/api/rest/activeSockets.js +3 -2
- package/lib/api/rest/activeSockets.js.map +1 -1
- package/lib/api/rest/base.d.ts +1 -1
- package/lib/api/rest/base.d.ts.map +1 -0
- package/lib/api/rest/base.js +6 -2
- package/lib/api/rest/base.js.map +1 -1
- package/lib/api/rest/index.d.ts.map +1 -0
- package/lib/api/rest/index.js +2 -0
- package/lib/api/rest/index.js.map +1 -1
- package/lib/api/rest/swaggerUI.d.ts.map +1 -0
- package/lib/api/rest/swaggerUI.js +4 -2
- package/lib/api/rest/swaggerUI.js.map +1 -1
- package/lib/bun-wrappers/prometheus-gc-stats.d.ts +2 -0
- package/lib/bun-wrappers/prometheus-gc-stats.d.ts.map +1 -0
- package/lib/bun-wrappers/prometheus-gc-stats.js +8 -0
- package/lib/bun-wrappers/prometheus-gc-stats.js.map +1 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts +32 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -0
- package/lib/chain/ColumnReconstructionTracker.js +71 -0
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -0
- package/lib/chain/GetBlobsTracker.d.ts +31 -0
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -0
- package/lib/chain/GetBlobsTracker.js +82 -0
- package/lib/chain/GetBlobsTracker.js.map +1 -0
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -0
- package/lib/chain/archiveStore/archiveStore.js +49 -38
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/constants.d.ts.map +1 -0
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +3 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -0
- package/lib/chain/archiveStore/historicalState/worker.d.ts.map +1 -0
- package/lib/chain/archiveStore/historicalState/worker.js +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/index.d.ts +1 -1
- package/lib/chain/archiveStore/index.d.ts.map +1 -0
- package/lib/chain/archiveStore/index.js +1 -1
- package/lib/chain/archiveStore/interface.d.ts.map +1 -0
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -0
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +5 -0
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.js +5 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -0
- package/lib/chain/archiveStore/utils/updateBackfillRange.d.ts.map +1 -0
- package/lib/chain/balancesCache.d.ts.map +1 -0
- package/lib/chain/balancesCache.js +1 -3
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/beaconProposerCache.d.ts.map +1 -0
- package/lib/chain/beaconProposerCache.js +1 -0
- package/lib/chain/beaconProposerCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +19 -7
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -0
- package/lib/chain/blocks/blockInput/blockInput.js +133 -89
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.d.ts.map +1 -0
- package/lib/chain/blocks/blockInput/index.d.ts +1 -1
- package/lib/chain/blocks/blockInput/index.d.ts.map +1 -0
- package/lib/chain/blocks/blockInput/index.js +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +19 -10
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -0
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/blockInput/utils.d.ts +0 -4
- package/lib/chain/blocks/blockInput/utils.d.ts.map +1 -0
- package/lib/chain/blocks/blockInput/utils.js +6 -29
- package/lib/chain/blocks/blockInput/utils.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -0
- package/lib/chain/blocks/importBlock.js +42 -37
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/index.d.ts +6 -5
- package/lib/chain/blocks/index.d.ts.map +1 -0
- package/lib/chain/blocks/index.js +5 -4
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +3 -108
- package/lib/chain/blocks/types.d.ts.map +1 -0
- package/lib/chain/blocks/types.js +0 -119
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/blowfishBanner.d.ts.map +1 -0
- package/lib/chain/blocks/utils/chainSegment.d.ts +2 -2
- package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -0
- package/lib/chain/blocks/utils/chainSegment.js +2 -2
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -0
- package/lib/chain/blocks/utils/giraffeBanner.d.ts.map +1 -0
- package/lib/chain/blocks/utils/ownBanner.d.ts.map +1 -0
- package/lib/chain/blocks/utils/pandaMergeTransitionBanner.d.ts.map +1 -0
- package/lib/chain/blocks/utils/zebraBanner.d.ts.map +1 -0
- package/lib/chain/blocks/verifyBlock.d.ts +3 -3
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -0
- package/lib/chain/blocks/verifyBlock.js +15 -14
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts +7 -22
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -0
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +23 -108
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +4 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -0
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +24 -22
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts +4 -3
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -0
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +2 -2
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -0
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -2
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -0
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +2 -2
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts +3 -3
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -0
- package/lib/chain/blocks/writeBlockInputToDb.js +56 -67
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/bls/index.d.ts.map +1 -0
- package/lib/chain/bls/interface.d.ts.map +1 -0
- package/lib/chain/bls/maybeBatch.d.ts.map +1 -0
- package/lib/chain/bls/multithread/index.d.ts.map +1 -0
- package/lib/chain/bls/multithread/index.js +168 -163
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/jobItem.d.ts.map +1 -0
- package/lib/chain/bls/multithread/poolSize.d.ts.map +1 -0
- package/lib/chain/bls/multithread/types.d.ts.map +1 -0
- package/lib/chain/bls/multithread/utils.d.ts.map +1 -0
- package/lib/chain/bls/multithread/worker.d.ts.map +1 -0
- package/lib/chain/bls/singleThread.d.ts.map +1 -0
- package/lib/chain/bls/singleThread.js +1 -0
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.d.ts.map +1 -0
- package/lib/chain/chain.d.ts +13 -11
- package/lib/chain/chain.d.ts.map +1 -0
- package/lib/chain/chain.js +82 -24
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +43 -2
- package/lib/chain/emitter.d.ts.map +1 -0
- package/lib/chain/emitter.js +18 -0
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -0
- package/lib/chain/errors/attesterSlashingError.d.ts.map +1 -0
- package/lib/chain/errors/blobSidecarError.d.ts +24 -0
- package/lib/chain/errors/blobSidecarError.d.ts.map +1 -0
- package/lib/chain/errors/blobSidecarError.js +10 -0
- package/lib/chain/errors/blobSidecarError.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -0
- package/lib/chain/errors/blockError.js +1 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/blsToExecutionChangeError.d.ts.map +1 -0
- package/lib/chain/errors/dataColumnSidecarError.d.ts +42 -0
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -0
- package/lib/chain/errors/dataColumnSidecarError.js +14 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/errors/gossipValidation.d.ts.map +1 -0
- package/lib/chain/errors/gossipValidation.js +1 -0
- package/lib/chain/errors/gossipValidation.js.map +1 -1
- package/lib/chain/errors/index.d.ts +2 -2
- package/lib/chain/errors/index.d.ts.map +1 -0
- package/lib/chain/errors/index.js +2 -2
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/errors/lightClientError.d.ts.map +1 -0
- package/lib/chain/errors/proposerSlashingError.d.ts.map +1 -0
- package/lib/chain/errors/syncCommitteeError.d.ts.map +1 -0
- package/lib/chain/errors/voluntaryExitError.d.ts.map +1 -0
- package/lib/chain/forkChoice/index.d.ts.map +1 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/genesis/genesis.d.ts.map +1 -0
- package/lib/chain/genesis/genesis.js +16 -5
- package/lib/chain/genesis/genesis.js.map +1 -1
- package/lib/chain/genesis/interface.d.ts.map +1 -0
- package/lib/chain/index.d.ts +2 -2
- package/lib/chain/index.d.ts.map +1 -0
- package/lib/chain/index.js +2 -2
- package/lib/chain/index.js.map +1 -1
- package/lib/chain/initState.d.ts.map +1 -0
- package/lib/chain/interface.d.ts +12 -9
- package/lib/chain/interface.d.ts.map +1 -0
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts.map +1 -0
- package/lib/chain/lightClient/index.js +16 -9
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/lightClient/proofs.d.ts.map +1 -0
- package/lib/chain/lightClient/proofs.js.map +1 -1
- package/lib/chain/lightClient/types.d.ts.map +1 -0
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/aggregatedAttestationPool.js +14 -9
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/attestationPool.d.ts +2 -3
- package/lib/chain/opPools/attestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/attestationPool.js +10 -7
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/chain/opPools/index.d.ts +1 -1
- package/lib/chain/opPools/index.d.ts.map +1 -0
- package/lib/chain/opPools/index.js +1 -1
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts.map +1 -0
- package/lib/chain/opPools/opPool.js +10 -12
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts +3 -2
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -0
- package/lib/chain/opPools/syncCommitteeMessagePool.js +14 -10
- package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -0
- package/lib/chain/opPools/syncContributionAndProofPool.js +5 -2
- package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
- package/lib/chain/opPools/types.d.ts +1 -1
- package/lib/chain/opPools/types.d.ts.map +1 -0
- package/lib/chain/opPools/types.js +1 -1
- package/lib/chain/opPools/types.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts.map +1 -0
- package/lib/chain/options.d.ts.map +1 -0
- package/lib/chain/options.js +1 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +3 -3
- package/lib/chain/prepareNextSlot.d.ts.map +1 -0
- package/lib/chain/prepareNextSlot.js +145 -140
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -0
- package/lib/chain/produceBlock/index.d.ts.map +1 -0
- package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -0
- package/lib/chain/produceBlock/produceBlockBody.js +3 -10
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/produceBlock/validateBlobsAndKzgCommitments.d.ts.map +1 -0
- package/lib/chain/regen/errors.d.ts.map +1 -0
- package/lib/chain/regen/errors.js +1 -0
- package/lib/chain/regen/errors.js.map +1 -1
- package/lib/chain/regen/index.d.ts +1 -1
- package/lib/chain/regen/index.d.ts.map +1 -0
- package/lib/chain/regen/index.js +1 -1
- package/lib/chain/regen/index.js.map +1 -1
- package/lib/chain/regen/interface.d.ts.map +1 -0
- package/lib/chain/regen/queued.d.ts.map +1 -0
- package/lib/chain/regen/queued.js +35 -28
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts.map +1 -0
- package/lib/chain/regen/regen.js +1 -0
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/reprocess.d.ts.map +1 -0
- package/lib/chain/reprocess.js +3 -1
- package/lib/chain/reprocess.js.map +1 -1
- package/lib/chain/rewards/attestationsRewards.d.ts.map +1 -0
- package/lib/chain/rewards/blockRewards.d.ts.map +1 -0
- package/lib/chain/rewards/syncCommitteeRewards.d.ts.map +1 -0
- package/lib/chain/seenCache/index.d.ts +1 -1
- package/lib/chain/seenCache/index.d.ts.map +1 -0
- package/lib/chain/seenCache/index.js +1 -1
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenAggregateAndProof.d.ts.map +1 -0
- package/lib/chain/seenCache/seenAggregateAndProof.js +7 -6
- package/lib/chain/seenCache/seenAggregateAndProof.js.map +1 -1
- package/lib/chain/seenCache/seenAttestationData.d.ts.map +1 -0
- package/lib/chain/seenCache/seenAttestationData.js +5 -2
- package/lib/chain/seenCache/seenAttestationData.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -0
- package/lib/chain/seenCache/seenAttesters.js +2 -4
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -0
- package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -0
- package/lib/chain/seenCache/seenBlockProposers.js +2 -4
- package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
- package/lib/chain/seenCache/seenCommittee.d.ts.map +1 -0
- package/lib/chain/seenCache/seenCommittee.js +1 -3
- package/lib/chain/seenCache/seenCommittee.js.map +1 -1
- package/lib/chain/seenCache/seenCommitteeContribution.d.ts.map +1 -0
- package/lib/chain/seenCache/seenCommitteeContribution.js +3 -2
- package/lib/chain/seenCache/seenCommitteeContribution.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +74 -78
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -0
- package/lib/chain/seenCache/seenGossipBlockInput.js +235 -369
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/serializeState.d.ts.map +1 -0
- package/lib/chain/shufflingCache.d.ts.map +1 -0
- package/lib/chain/shufflingCache.js +5 -2
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/blockStateCacheImpl.d.ts.map +1 -0
- package/lib/chain/stateCache/blockStateCacheImpl.js +13 -7
- package/lib/chain/stateCache/blockStateCacheImpl.js.map +1 -1
- package/lib/chain/stateCache/datastore/db.d.ts.map +1 -0
- package/lib/chain/stateCache/datastore/db.js +1 -0
- package/lib/chain/stateCache/datastore/db.js.map +1 -1
- package/lib/chain/stateCache/datastore/file.d.ts.map +1 -0
- package/lib/chain/stateCache/datastore/file.js +1 -0
- package/lib/chain/stateCache/datastore/file.js.map +1 -1
- package/lib/chain/stateCache/datastore/index.d.ts +1 -1
- package/lib/chain/stateCache/datastore/index.d.ts.map +1 -0
- package/lib/chain/stateCache/datastore/index.js +1 -1
- package/lib/chain/stateCache/datastore/index.js.map +1 -1
- package/lib/chain/stateCache/datastore/types.d.ts.map +1 -0
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -0
- package/lib/chain/stateCache/fifoBlockStateCache.js +10 -0
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/inMemoryCheckpointsCache.d.ts.map +1 -0
- package/lib/chain/stateCache/inMemoryCheckpointsCache.js +10 -4
- package/lib/chain/stateCache/inMemoryCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/index.d.ts +1 -1
- package/lib/chain/stateCache/index.d.ts.map +1 -0
- package/lib/chain/stateCache/index.js +1 -1
- package/lib/chain/stateCache/index.js.map +1 -1
- package/lib/chain/stateCache/mapMetrics.d.ts.map +1 -0
- package/lib/chain/stateCache/mapMetrics.js +4 -4
- package/lib/chain/stateCache/mapMetrics.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -0
- package/lib/chain/stateCache/persistentCheckpointsCache.js +23 -14
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts.map +1 -0
- package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -0
- package/lib/chain/validation/attestation.d.ts.map +1 -0
- package/lib/chain/validation/attesterSlashing.d.ts.map +1 -0
- package/lib/chain/validation/blobSidecar.d.ts +8 -3
- package/lib/chain/validation/blobSidecar.d.ts.map +1 -0
- package/lib/chain/validation/blobSidecar.js +73 -31
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -0
- package/lib/chain/validation/blsToExecutionChange.d.ts.map +1 -0
- package/lib/chain/validation/dataColumnSidecar.d.ts +7 -9
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -0
- package/lib/chain/validation/dataColumnSidecar.js +95 -57
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/index.d.ts +1 -1
- package/lib/chain/validation/index.d.ts.map +1 -0
- package/lib/chain/validation/index.js +1 -1
- package/lib/chain/validation/index.js.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.d.ts.map +1 -0
- package/lib/chain/validation/lightClientFinalityUpdate.js +4 -3
- package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.d.ts +6 -4
- package/lib/chain/validation/lightClientOptimisticUpdate.d.ts.map +1 -0
- package/lib/chain/validation/lightClientOptimisticUpdate.js +11 -11
- package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.d.ts.map +1 -0
- package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts +1 -2
- package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts.map +1 -0
- package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -0
- package/lib/chain/validation/signatureSets/index.d.ts.map +1 -0
- package/lib/chain/validation/signatureSets/selectionProof.d.ts.map +1 -0
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -0
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -0
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -0
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -0
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -0
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -0
- package/lib/chain/validatorMonitor.d.ts +1 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -0
- package/lib/chain/validatorMonitor.js +23 -16
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/constants/constants.d.ts.map +1 -0
- package/lib/constants/index.d.ts.map +1 -0
- package/lib/constants/network.d.ts.map +1 -0
- package/lib/db/beacon.d.ts.map +1 -0
- package/lib/db/beacon.js +24 -0
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/buckets.d.ts +4 -4
- package/lib/db/buckets.d.ts.map +1 -0
- package/lib/db/buckets.js +4 -4
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/index.d.ts +1 -1
- package/lib/db/index.d.ts.map +1 -0
- package/lib/db/index.js.map +1 -1
- package/lib/db/interface.d.ts.map +1 -0
- package/lib/db/options.d.ts.map +1 -0
- package/lib/db/repositories/attesterSlashing.d.ts.map +1 -0
- package/lib/db/repositories/backfilledRanges.d.ts.map +1 -0
- package/lib/db/repositories/blobSidecars.d.ts.map +1 -0
- package/lib/db/repositories/blobSidecars.js +1 -1
- package/lib/db/repositories/blobSidecars.js.map +1 -1
- package/lib/db/repositories/blobSidecarsArchive.d.ts.map +1 -0
- package/lib/db/repositories/blobSidecarsArchive.js +1 -1
- package/lib/db/repositories/blobSidecarsArchive.js.map +1 -1
- package/lib/db/repositories/block.d.ts.map +1 -0
- package/lib/db/repositories/blockArchive.d.ts.map +1 -0
- package/lib/db/repositories/blockArchive.js +2 -3
- package/lib/db/repositories/blockArchive.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -0
- package/lib/db/repositories/blsToExecutionChange.d.ts.map +1 -0
- package/lib/db/repositories/checkpointState.d.ts.map +1 -0
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -0
- package/lib/db/repositories/dataColumnSidecar.js +2 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -0
- package/lib/db/repositories/dataColumnSidecarArchive.js +2 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/db/repositories/depositDataRoot.d.ts.map +1 -0
- package/lib/db/repositories/depositDataRoot.js +1 -0
- package/lib/db/repositories/depositDataRoot.js.map +1 -1
- package/lib/db/repositories/depositEvent.d.ts.map +1 -0
- package/lib/db/repositories/eth1Data.d.ts.map +1 -0
- package/lib/db/repositories/index.d.ts +10 -10
- package/lib/db/repositories/index.d.ts.map +1 -0
- package/lib/db/repositories/index.js +9 -9
- package/lib/db/repositories/index.js.map +1 -1
- package/lib/db/repositories/lightclientBestUpdate.d.ts.map +1 -0
- package/lib/db/repositories/lightclientCheckpointHeader.d.ts.map +1 -0
- package/lib/db/repositories/lightclientSyncCommittee.d.ts.map +1 -0
- package/lib/db/repositories/lightclientSyncCommitteeWitness.d.ts.map +1 -0
- package/lib/db/repositories/proposerSlashing.d.ts.map +1 -0
- package/lib/db/repositories/stateArchive.d.ts.map +1 -0
- package/lib/db/repositories/stateArchiveIndex.d.ts.map +1 -0
- package/lib/db/repositories/voluntaryExit.d.ts.map +1 -0
- package/lib/db/single/index.d.ts.map +1 -0
- package/lib/db/single/preGenesisState.d.ts.map +1 -0
- package/lib/db/single/preGenesisState.js +6 -0
- package/lib/db/single/preGenesisState.js.map +1 -1
- package/lib/db/single/preGenesisStateLastProcessedBlock.d.ts.map +1 -0
- package/lib/db/single/preGenesisStateLastProcessedBlock.js +5 -0
- package/lib/db/single/preGenesisStateLastProcessedBlock.js.map +1 -1
- package/lib/eth1/errors.d.ts.map +1 -0
- package/lib/eth1/eth1DataCache.d.ts.map +1 -0
- package/lib/eth1/eth1DataCache.js +2 -0
- package/lib/eth1/eth1DataCache.js.map +1 -1
- package/lib/eth1/eth1DepositDataTracker.d.ts.map +1 -0
- package/lib/eth1/eth1DepositDataTracker.js +18 -5
- package/lib/eth1/eth1DepositDataTracker.js.map +1 -1
- package/lib/eth1/eth1DepositsCache.d.ts.map +1 -0
- package/lib/eth1/eth1DepositsCache.js +3 -0
- package/lib/eth1/eth1DepositsCache.js.map +1 -1
- package/lib/eth1/eth1MergeBlockTracker.d.ts.map +1 -0
- package/lib/eth1/eth1MergeBlockTracker.js +10 -4
- package/lib/eth1/eth1MergeBlockTracker.js.map +1 -1
- package/lib/eth1/index.d.ts.map +1 -0
- package/lib/eth1/index.js +2 -0
- package/lib/eth1/index.js.map +1 -1
- package/lib/eth1/interface.d.ts.map +1 -0
- package/lib/eth1/options.d.ts.map +1 -0
- package/lib/eth1/provider/eth1Provider.d.ts +1 -2
- package/lib/eth1/provider/eth1Provider.d.ts.map +1 -0
- package/lib/eth1/provider/eth1Provider.js +6 -2
- package/lib/eth1/provider/eth1Provider.js.map +1 -1
- package/lib/eth1/provider/jsonRpcHttpClient.d.ts +1 -1
- package/lib/eth1/provider/jsonRpcHttpClient.d.ts.map +1 -0
- package/lib/eth1/provider/jsonRpcHttpClient.js +16 -2
- package/lib/eth1/provider/jsonRpcHttpClient.js.map +1 -1
- package/lib/eth1/provider/jwt.d.ts.map +1 -0
- package/lib/eth1/provider/jwt.js.map +1 -1
- package/lib/eth1/provider/utils.d.ts +5 -0
- package/lib/eth1/provider/utils.d.ts.map +1 -0
- package/lib/eth1/provider/utils.js +9 -1
- package/lib/eth1/provider/utils.js.map +1 -1
- package/lib/eth1/stream.d.ts.map +1 -0
- package/lib/eth1/utils/depositContract.d.ts.map +1 -0
- package/lib/eth1/utils/deposits.d.ts.map +1 -0
- package/lib/eth1/utils/deposits.js.map +1 -1
- package/lib/eth1/utils/eth1Data.d.ts.map +1 -0
- package/lib/eth1/utils/eth1DepositEvent.d.ts.map +1 -0
- package/lib/eth1/utils/eth1Vote.d.ts.map +1 -0
- package/lib/eth1/utils/groupDepositEventsByBlock.d.ts.map +1 -0
- package/lib/eth1/utils/optimizeNextBlockDiffForGenesis.d.ts.map +1 -0
- package/lib/execution/builder/cache.d.ts.map +1 -0
- package/lib/execution/builder/cache.js +6 -0
- package/lib/execution/builder/cache.js.map +1 -1
- package/lib/execution/builder/http.d.ts.map +1 -0
- package/lib/execution/builder/http.js +14 -8
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/execution/builder/index.d.ts.map +1 -0
- package/lib/execution/builder/index.js.map +1 -1
- package/lib/execution/builder/interface.d.ts.map +1 -0
- package/lib/execution/builder/utils.d.ts.map +1 -0
- package/lib/execution/engine/disabled.d.ts.map +1 -0
- package/lib/execution/engine/disabled.js +2 -4
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +2 -2
- package/lib/execution/engine/http.d.ts.map +1 -0
- package/lib/execution/engine/http.js +43 -11
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.d.ts.map +1 -0
- package/lib/execution/engine/interface.d.ts +2 -2
- package/lib/execution/engine/interface.d.ts.map +1 -0
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +1 -0
- package/lib/execution/engine/mock.d.ts.map +1 -0
- package/lib/execution/engine/mock.js +16 -12
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -0
- package/lib/execution/engine/payloadIdCache.js +1 -3
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/types.d.ts +5 -1
- package/lib/execution/engine/types.d.ts.map +1 -0
- package/lib/execution/engine/types.js +37 -8
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts.map +1 -0
- package/lib/execution/engine/utils.js +3 -3
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/execution/index.d.ts +2 -2
- package/lib/execution/index.d.ts.map +1 -0
- package/lib/execution/index.js +2 -2
- package/lib/execution/index.js.map +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/metrics/index.d.ts +1 -1
- package/lib/metrics/index.d.ts.map +1 -0
- package/lib/metrics/index.js +1 -1
- package/lib/metrics/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +11 -5
- package/lib/metrics/metrics/beacon.d.ts.map +1 -0
- package/lib/metrics/metrics/beacon.js +40 -20
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +56 -14
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -0
- package/lib/metrics/metrics/lodestar.js +87 -10
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/metrics.d.ts +1 -1
- package/lib/metrics/metrics.d.ts.map +1 -0
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/metrics/nodeJsMetrics.d.ts.map +1 -0
- package/lib/metrics/nodeJsMetrics.js +1 -1
- package/lib/metrics/nodeJsMetrics.js.map +1 -1
- package/lib/metrics/options.d.ts.map +1 -0
- package/lib/metrics/server/http.d.ts +1 -1
- package/lib/metrics/server/http.d.ts.map +1 -0
- package/lib/metrics/server/index.d.ts.map +1 -0
- package/lib/metrics/utils/avgMinMax.d.ts +1 -1
- package/lib/metrics/utils/avgMinMax.d.ts.map +1 -0
- package/lib/metrics/utils/avgMinMax.js +10 -6
- package/lib/metrics/utils/avgMinMax.js.map +1 -1
- package/lib/metrics/utils/gauge.d.ts +1 -1
- package/lib/metrics/utils/gauge.d.ts.map +1 -0
- package/lib/metrics/utils/gauge.js +1 -4
- package/lib/metrics/utils/gauge.js.map +1 -1
- package/lib/metrics/utils/registryMetricCreator.d.ts +1 -1
- package/lib/metrics/utils/registryMetricCreator.d.ts.map +1 -0
- package/lib/metrics/utils/registryMetricCreator.js.map +1 -1
- package/lib/monitoring/clientStats.d.ts.map +1 -0
- package/lib/monitoring/index.d.ts.map +1 -0
- package/lib/monitoring/options.d.ts.map +1 -0
- package/lib/monitoring/properties.d.ts.map +1 -0
- package/lib/monitoring/properties.js +4 -0
- package/lib/monitoring/properties.js.map +1 -1
- package/lib/monitoring/service.d.ts.map +1 -0
- package/lib/monitoring/service.js +13 -1
- package/lib/monitoring/service.js.map +1 -1
- package/lib/monitoring/system.d.ts.map +1 -0
- package/lib/monitoring/system.js +25 -27
- package/lib/monitoring/system.js.map +1 -1
- package/lib/monitoring/types.d.ts.map +1 -0
- package/lib/network/core/events.d.ts.map +1 -0
- package/lib/network/core/index.d.ts.map +1 -0
- package/lib/network/core/metrics.d.ts.map +1 -0
- package/lib/network/core/networkCore.d.ts +2 -2
- package/lib/network/core/networkCore.d.ts.map +1 -0
- package/lib/network/core/networkCore.js +67 -50
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.d.ts.map +1 -0
- package/lib/network/core/networkCoreWorker.js +1 -1
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +2 -2
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -0
- package/lib/network/core/networkCoreWorkerHandler.js +14 -5
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts.map +1 -0
- package/lib/network/discv5/index.d.ts +2 -2
- package/lib/network/discv5/index.d.ts.map +1 -0
- package/lib/network/discv5/index.js +9 -3
- package/lib/network/discv5/index.js.map +1 -1
- package/lib/network/discv5/types.d.ts.map +1 -0
- package/lib/network/discv5/utils.d.ts.map +1 -0
- package/lib/network/discv5/worker.d.ts.map +1 -0
- package/lib/network/discv5/worker.js +3 -3
- package/lib/network/discv5/worker.js.map +1 -1
- package/lib/network/events.d.ts +2 -18
- package/lib/network/events.d.ts.map +1 -0
- package/lib/network/events.js +0 -7
- package/lib/network/events.js.map +1 -1
- package/lib/network/forks.d.ts.map +1 -0
- package/lib/network/gossip/constants.d.ts.map +1 -0
- package/lib/network/gossip/encoding.d.ts +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -0
- package/lib/network/gossip/encoding.js +4 -2
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/errors.d.ts.map +1 -0
- package/lib/network/gossip/errors.js +1 -0
- package/lib/network/gossip/errors.js.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +2 -1
- package/lib/network/gossip/gossipsub.d.ts.map +1 -0
- package/lib/network/gossip/gossipsub.js +44 -18
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/index.d.ts +2 -2
- package/lib/network/gossip/index.d.ts.map +1 -0
- package/lib/network/gossip/index.js +2 -2
- package/lib/network/gossip/index.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +2 -2
- package/lib/network/gossip/interface.d.ts.map +1 -0
- package/lib/network/gossip/metrics.d.ts +15 -7
- package/lib/network/gossip/metrics.d.ts.map +1 -0
- package/lib/network/gossip/metrics.js +16 -6
- package/lib/network/gossip/metrics.js.map +1 -1
- package/lib/network/gossip/scoringParameters.d.ts.map +1 -0
- package/lib/network/gossip/scoringParameters.js +4 -4
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +125 -105
- package/lib/network/gossip/topic.d.ts.map +1 -0
- package/lib/network/gossip/topic.js +2 -1
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/index.d.ts +3 -3
- package/lib/network/index.d.ts.map +1 -0
- package/lib/network/index.js +3 -3
- package/lib/network/index.js.map +1 -1
- package/lib/network/interface.d.ts +3 -2
- package/lib/network/interface.d.ts.map +1 -0
- package/lib/network/libp2p/error.d.ts.map +1 -0
- package/lib/network/libp2p/index.d.ts.map +1 -0
- package/lib/network/libp2p/index.js +11 -3
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/metadata.d.ts.map +1 -0
- package/lib/network/metadata.js +6 -1
- package/lib/network/metadata.js.map +1 -1
- package/lib/network/network.d.ts +5 -3
- package/lib/network/network.d.ts.map +1 -0
- package/lib/network/network.js +92 -76
- package/lib/network/network.js.map +1 -1
- package/lib/network/networkConfig.d.ts.map +1 -0
- package/lib/network/options.d.ts.map +1 -0
- package/lib/network/options.js +1 -1
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/client.d.ts.map +1 -0
- package/lib/network/peers/datastore.d.ts +2 -2
- package/lib/network/peers/datastore.d.ts.map +1 -0
- package/lib/network/peers/datastore.js +10 -4
- package/lib/network/peers/datastore.js.map +1 -1
- package/lib/network/peers/discover.d.ts.map +1 -0
- package/lib/network/peers/discover.js +75 -66
- package/lib/network/peers/discover.js.map +1 -1
- package/lib/network/peers/index.d.ts.map +1 -0
- package/lib/network/peers/peerManager.d.ts.map +1 -0
- package/lib/network/peers/peerManager.js +156 -131
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/peersData.d.ts +1 -1
- package/lib/network/peers/peersData.d.ts.map +1 -0
- package/lib/network/peers/peersData.js +1 -3
- package/lib/network/peers/peersData.js.map +1 -1
- package/lib/network/peers/score/constants.d.ts.map +1 -0
- package/lib/network/peers/score/index.d.ts +1 -1
- package/lib/network/peers/score/index.d.ts.map +1 -0
- package/lib/network/peers/score/index.js +1 -1
- package/lib/network/peers/score/index.js.map +1 -1
- package/lib/network/peers/score/interface.d.ts.map +1 -0
- package/lib/network/peers/score/score.d.ts.map +1 -0
- package/lib/network/peers/score/score.js +6 -0
- package/lib/network/peers/score/score.js.map +1 -1
- package/lib/network/peers/score/store.d.ts.map +1 -0
- package/lib/network/peers/score/store.js +3 -0
- package/lib/network/peers/score/store.js.map +1 -1
- package/lib/network/peers/score/utils.d.ts.map +1 -0
- package/lib/network/peers/utils/assertPeerRelevance.d.ts.map +1 -0
- package/lib/network/peers/utils/enrSubnetsDeserialize.d.ts.map +1 -0
- package/lib/network/peers/utils/getConnectedPeerIds.d.ts.map +1 -0
- package/lib/network/peers/utils/index.d.ts.map +1 -0
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -0
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/peers/utils/subnetMap.d.ts.map +1 -0
- package/lib/network/peers/utils/subnetMap.js +2 -4
- package/lib/network/peers/utils/subnetMap.js.map +1 -1
- package/lib/network/processor/aggregatorTracker.d.ts.map +1 -0
- package/lib/network/processor/aggregatorTracker.js +1 -3
- package/lib/network/processor/aggregatorTracker.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -0
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -0
- package/lib/network/processor/gossipHandlers.js +145 -165
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -0
- package/lib/network/processor/gossipQueues/indexed.d.ts.map +1 -0
- package/lib/network/processor/gossipQueues/indexed.js +11 -9
- package/lib/network/processor/gossipQueues/indexed.js.map +1 -1
- package/lib/network/processor/gossipQueues/linear.d.ts.map +1 -0
- package/lib/network/processor/gossipQueues/linear.js +9 -8
- package/lib/network/processor/gossipQueues/linear.js.map +1 -1
- package/lib/network/processor/gossipQueues/types.d.ts.map +1 -0
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -0
- package/lib/network/processor/index.d.ts +2 -1
- package/lib/network/processor/index.d.ts.map +1 -0
- package/lib/network/processor/index.js +21 -8
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/processor/types.d.ts.map +1 -0
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js +11 -2
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/lightClientBootstrap.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/lightClientFinalityUpdate.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/lightClientOptimisticUpdate.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/index.d.ts +1 -3
- package/lib/network/reqresp/index.d.ts.map +1 -0
- package/lib/network/reqresp/index.js +1 -3
- package/lib/network/reqresp/index.js.map +1 -1
- package/lib/network/reqresp/interface.d.ts.map +1 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -0
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -0
- package/lib/network/reqresp/rateLimit.js +11 -5
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -0
- package/lib/network/reqresp/types.d.ts.map +1 -0
- package/lib/network/reqresp/utils/collect.d.ts.map +1 -0
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts.map +1 -0
- package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts.map +1 -0
- package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
- package/lib/network/statusCache.d.ts.map +1 -0
- package/lib/network/statusCache.js +1 -0
- package/lib/network/statusCache.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts.map +1 -0
- package/lib/network/subnets/attnetsService.js +73 -65
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/network/subnets/index.d.ts.map +1 -0
- package/lib/network/subnets/interface.d.ts.map +1 -0
- package/lib/network/subnets/interface.js +1 -1
- package/lib/network/subnets/interface.js.map +1 -1
- package/lib/network/subnets/syncnetsService.d.ts.map +1 -0
- package/lib/network/subnets/syncnetsService.js +29 -22
- package/lib/network/subnets/syncnetsService.js.map +1 -1
- package/lib/network/subnets/util.d.ts.map +1 -0
- package/lib/network/subnets/util.js +1 -2
- package/lib/network/subnets/util.js.map +1 -1
- package/lib/network/util.d.ts.map +1 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/nodejs.d.ts +1 -1
- package/lib/node/nodejs.d.ts.map +1 -0
- package/lib/node/nodejs.js +15 -0
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -0
- package/lib/node/notifier.js +2 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/node/options.d.ts.map +1 -0
- package/lib/node/options.js.map +1 -1
- package/lib/node/utils/interop/deposits.d.ts.map +1 -0
- package/lib/node/utils/interop/state.d.ts.map +1 -0
- package/lib/node/utils/interop/state.js +1 -2
- package/lib/node/utils/interop/state.js.map +1 -1
- package/lib/node/utils/lightclient.d.ts.map +1 -0
- package/lib/node/utils/state.d.ts.map +1 -0
- package/lib/sync/backfill/backfill.d.ts +1 -1
- package/lib/sync/backfill/backfill.d.ts.map +1 -0
- package/lib/sync/backfill/backfill.js +58 -16
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/backfill/errors.d.ts.map +1 -0
- package/lib/sync/backfill/index.d.ts.map +1 -0
- package/lib/sync/backfill/verify.d.ts.map +1 -0
- package/lib/sync/constants.d.ts +2 -1
- package/lib/sync/constants.d.ts.map +1 -0
- package/lib/sync/constants.js +2 -1
- package/lib/sync/constants.js.map +1 -1
- package/lib/sync/index.d.ts.map +1 -0
- package/lib/sync/interface.d.ts +1 -59
- package/lib/sync/interface.d.ts.map +1 -0
- package/lib/sync/interface.js +0 -20
- package/lib/sync/interface.js.map +1 -1
- package/lib/sync/options.d.ts +1 -1
- package/lib/sync/options.d.ts.map +1 -0
- package/lib/sync/range/batch.d.ts +48 -32
- package/lib/sync/range/batch.d.ts.map +1 -0
- package/lib/sync/range/batch.js +201 -55
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +15 -10
- package/lib/sync/range/chain.d.ts.map +1 -0
- package/lib/sync/range/chain.js +141 -70
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/range.d.ts +3 -3
- package/lib/sync/range/range.d.ts.map +1 -0
- package/lib/sync/range/range.js +86 -54
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/range/utils/batches.d.ts.map +1 -0
- package/lib/sync/range/utils/chainTarget.d.ts.map +1 -0
- package/lib/sync/range/utils/hashBlocks.d.ts +2 -2
- package/lib/sync/range/utils/hashBlocks.d.ts.map +1 -0
- package/lib/sync/range/utils/hashBlocks.js +6 -4
- package/lib/sync/range/utils/hashBlocks.js.map +1 -1
- package/lib/sync/range/utils/index.d.ts.map +1 -0
- package/lib/sync/range/utils/peerBalancer.d.ts.map +1 -0
- package/lib/sync/range/utils/peerBalancer.js +18 -13
- package/lib/sync/range/utils/peerBalancer.js.map +1 -1
- package/lib/sync/range/utils/updateChains.d.ts.map +1 -0
- package/lib/sync/sync.d.ts +1 -2
- package/lib/sync/sync.d.ts.map +1 -0
- package/lib/sync/sync.js +95 -87
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/types.d.ts +43 -0
- package/lib/sync/types.d.ts.map +1 -0
- package/lib/sync/types.js +34 -0
- package/lib/sync/types.js.map +1 -0
- package/lib/sync/unknownBlock.d.ts +42 -29
- package/lib/sync/unknownBlock.d.ts.map +1 -0
- package/lib/sync/unknownBlock.js +407 -462
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +186 -0
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -0
- package/lib/sync/utils/downloadByRange.js +457 -0
- package/lib/sync/utils/downloadByRange.js.map +1 -0
- package/lib/sync/utils/downloadByRoot.d.ts +121 -0
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -0
- package/lib/sync/utils/downloadByRoot.js +346 -0
- package/lib/sync/utils/downloadByRoot.js.map +1 -0
- package/lib/sync/utils/pendingBlocksTree.d.ts +14 -6
- package/lib/sync/utils/pendingBlocksTree.d.ts.map +1 -0
- package/lib/sync/utils/pendingBlocksTree.js +24 -18
- package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
- package/lib/sync/utils/remoteSyncType.d.ts.map +1 -0
- package/lib/util/address.d.ts.map +1 -0
- package/lib/util/array.d.ts.map +1 -0
- package/lib/util/array.js +7 -3
- package/lib/util/array.js.map +1 -1
- package/lib/util/asyncIterableToEvents.d.ts.map +1 -0
- package/lib/util/asyncIterableToEvents.js +6 -3
- package/lib/util/asyncIterableToEvents.js.map +1 -1
- package/lib/util/binarySearch.d.ts.map +1 -0
- package/lib/util/binarySearch.js +2 -0
- package/lib/util/binarySearch.js.map +1 -1
- package/lib/util/bitArray.d.ts.map +1 -0
- package/lib/util/blobs.d.ts +2 -2
- package/lib/util/blobs.d.ts.map +1 -0
- package/lib/util/blobs.js +9 -7
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/bufferPool.d.ts.map +1 -0
- package/lib/util/bufferPool.js +7 -2
- package/lib/util/bufferPool.js.map +1 -1
- package/lib/util/bytes.d.ts.map +1 -0
- package/lib/util/chunkify.d.ts.map +1 -0
- package/lib/util/clock.d.ts +9 -4
- package/lib/util/clock.d.ts.map +1 -0
- package/lib/util/clock.js +30 -22
- package/lib/util/clock.js.map +1 -1
- package/lib/util/dataColumns.d.ts +13 -10
- package/lib/util/dataColumns.d.ts.map +1 -0
- package/lib/util/dataColumns.js +92 -134
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/dependentRoot.d.ts.map +1 -0
- package/lib/util/enum.d.ts.map +1 -0
- package/lib/util/error.d.ts.map +1 -0
- package/lib/util/eventLoop.d.ts.map +1 -0
- package/lib/util/execution.d.ts +20 -0
- package/lib/util/execution.d.ts.map +1 -0
- package/lib/util/execution.js +165 -0
- package/lib/util/execution.js.map +1 -0
- package/lib/util/file.d.ts.map +1 -0
- package/lib/util/forkChoice.d.ts.map +1 -0
- package/lib/util/forkName.d.ts.map +1 -0
- package/lib/util/graffiti.d.ts.map +1 -0
- package/lib/util/hex.d.ts.map +1 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/ip.d.ts.map +1 -0
- package/lib/util/itTrigger.d.ts.map +1 -0
- package/lib/util/itTrigger.js +4 -4
- package/lib/util/itTrigger.js.map +1 -1
- package/lib/util/kzg.d.ts.map +1 -0
- package/lib/util/map.d.ts.map +1 -0
- package/lib/util/map.js +2 -0
- package/lib/util/map.js.map +1 -1
- package/lib/util/metadata.d.ts.map +1 -0
- package/lib/util/multifork.d.ts.map +1 -0
- package/lib/util/numpy.d.ts.map +1 -0
- package/lib/util/peerId.d.ts.map +1 -0
- package/lib/util/profile.d.ts.map +1 -0
- package/lib/util/promises.d.ts.map +1 -0
- package/lib/util/queue/errors.d.ts.map +1 -0
- package/lib/util/queue/fnQueue.d.ts.map +1 -0
- package/lib/util/queue/index.d.ts +1 -1
- package/lib/util/queue/index.d.ts.map +1 -0
- package/lib/util/queue/index.js +1 -1
- package/lib/util/queue/index.js.map +1 -1
- package/lib/util/queue/itemQueue.d.ts.map +1 -0
- package/lib/util/queue/itemQueue.js +52 -49
- package/lib/util/queue/itemQueue.js.map +1 -1
- package/lib/util/queue/options.d.ts.map +1 -0
- package/lib/util/serializedCache.d.ts.map +1 -0
- package/lib/util/serializedCache.js +1 -3
- package/lib/util/serializedCache.js.map +1 -1
- package/lib/util/set.d.ts.map +1 -0
- package/lib/util/set.js +2 -0
- package/lib/util/set.js.map +1 -1
- package/lib/util/shuffle.d.ts.map +1 -0
- package/lib/util/sortBy.d.ts.map +1 -0
- package/lib/util/sszBytes.d.ts +1 -0
- package/lib/util/sszBytes.d.ts.map +1 -0
- package/lib/util/sszBytes.js +1 -1
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/strictEvents.d.ts.map +1 -0
- package/lib/util/time.d.ts.map +1 -0
- package/lib/util/timeSeries.d.ts.map +1 -0
- package/lib/util/timeSeries.js +3 -1
- package/lib/util/timeSeries.js.map +1 -1
- package/lib/util/types.d.ts +1 -1
- package/lib/util/types.d.ts.map +1 -0
- package/lib/util/types.js +2 -2
- package/lib/util/types.js.map +1 -1
- package/lib/util/workerEvents.d.ts.map +1 -0
- package/lib/util/wrapError.d.ts +7 -0
- package/lib/util/wrapError.d.ts.map +1 -0
- package/package.json +40 -24
- package/src/api/impl/api.ts +26 -0
- package/src/api/impl/beacon/blocks/index.ts +744 -0
- package/src/api/impl/beacon/blocks/utils.ts +75 -0
- package/src/api/impl/beacon/index.ts +35 -0
- package/src/api/impl/beacon/pool/index.ts +314 -0
- package/src/api/impl/beacon/rewards/index.ts +30 -0
- package/src/api/impl/beacon/state/index.ts +406 -0
- package/src/api/impl/beacon/state/utils.ts +189 -0
- package/src/api/impl/config/constants.ts +127 -0
- package/src/api/impl/config/index.ts +59 -0
- package/src/api/impl/debug/index.ts +131 -0
- package/src/api/impl/errors.ts +50 -0
- package/src/api/impl/events/index.ts +33 -0
- package/src/api/impl/index.ts +6 -0
- package/src/api/impl/lightclient/index.ts +64 -0
- package/src/api/impl/lodestar/index.ts +257 -0
- package/src/api/impl/node/index.ts +88 -0
- package/src/api/impl/node/utils.ts +51 -0
- package/src/api/impl/proof/index.ts +60 -0
- package/src/api/impl/types.ts +17 -0
- package/src/api/impl/utils.ts +25 -0
- package/src/api/impl/validator/index.ts +1533 -0
- package/src/api/impl/validator/utils.ts +85 -0
- package/src/api/index.ts +2 -0
- package/src/api/options.ts +16 -0
- package/src/api/rest/activeSockets.ts +109 -0
- package/src/api/rest/base.ts +216 -0
- package/src/api/rest/index.ts +63 -0
- package/src/api/rest/swaggerUI.ts +80 -0
- package/src/bun-wrappers/prometheus-gc-stats.ts +7 -0
- package/src/chain/ColumnReconstructionTracker.ts +90 -0
- package/src/chain/GetBlobsTracker.ts +115 -0
- package/src/chain/archiveStore/archiveStore.ts +222 -0
- package/src/chain/archiveStore/constants.ts +5 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +116 -0
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +68 -0
- package/src/chain/archiveStore/historicalState/metrics.ts +214 -0
- package/src/chain/archiveStore/historicalState/types.ts +41 -0
- package/src/chain/archiveStore/historicalState/worker.ts +77 -0
- package/src/chain/archiveStore/index.ts +3 -0
- package/src/chain/archiveStore/interface.ts +75 -0
- package/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +138 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +437 -0
- package/src/chain/archiveStore/utils/pruneHistory.ts +56 -0
- package/src/chain/archiveStore/utils/updateBackfillRange.ts +50 -0
- package/src/chain/balancesCache.ts +52 -0
- package/src/chain/beaconProposerCache.ts +43 -0
- package/src/chain/blocks/blockInput/blockInput.ts +852 -0
- package/src/chain/blocks/blockInput/errors.ts +48 -0
- package/src/chain/blocks/blockInput/index.ts +4 -0
- package/src/chain/blocks/blockInput/types.ts +145 -0
- package/src/chain/blocks/blockInput/utils.ts +21 -0
- package/src/chain/blocks/importBlock.ts +599 -0
- package/src/chain/blocks/index.ts +179 -0
- package/src/chain/blocks/types.ts +101 -0
- package/src/chain/blocks/utils/blowfishBanner.ts +28 -0
- package/src/chain/blocks/utils/chainSegment.ts +29 -0
- package/src/chain/blocks/utils/checkpoint.ts +25 -0
- package/src/chain/blocks/utils/giraffeBanner.ts +30 -0
- package/src/chain/blocks/utils/ownBanner.ts +20 -0
- package/src/chain/blocks/utils/pandaMergeTransitionBanner.ts +43 -0
- package/src/chain/blocks/utils/zebraBanner.ts +45 -0
- package/src/chain/blocks/verifyBlock.ts +242 -0
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +42 -0
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +438 -0
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +129 -0
- package/src/chain/blocks/verifyBlocksSignatures.ts +105 -0
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +114 -0
- package/src/chain/blocks/writeBlockInputToDb.ts +120 -0
- package/src/chain/bls/index.ts +4 -0
- package/src/chain/bls/interface.ts +68 -0
- package/src/chain/bls/maybeBatch.ts +45 -0
- package/src/chain/bls/multithread/index.ts +582 -0
- package/src/chain/bls/multithread/jobItem.ts +119 -0
- package/src/chain/bls/multithread/poolSize.ts +16 -0
- package/src/chain/bls/multithread/types.ts +38 -0
- package/src/chain/bls/multithread/utils.ts +19 -0
- package/src/chain/bls/multithread/worker.ts +114 -0
- package/src/chain/bls/singleThread.ts +87 -0
- package/src/chain/bls/utils.ts +30 -0
- package/src/chain/chain.ts +1354 -0
- package/src/chain/emitter.ts +113 -0
- package/src/chain/errors/attestationError.ts +194 -0
- package/src/chain/errors/attesterSlashingError.ts +11 -0
- package/src/chain/errors/blobSidecarError.ts +60 -0
- package/src/chain/errors/blockError.ts +166 -0
- package/src/chain/errors/blsToExecutionChangeError.ts +13 -0
- package/src/chain/errors/dataColumnSidecarError.ts +80 -0
- package/src/chain/errors/gossipValidation.ts +20 -0
- package/src/chain/errors/index.ts +10 -0
- package/src/chain/errors/lightClientError.ts +30 -0
- package/src/chain/errors/proposerSlashingError.ts +11 -0
- package/src/chain/errors/syncCommitteeError.ts +36 -0
- package/src/chain/errors/voluntaryExitError.ts +13 -0
- package/src/chain/forkChoice/index.ts +112 -0
- package/src/chain/genesis/genesis.ts +190 -0
- package/src/chain/genesis/interface.ts +14 -0
- package/src/chain/index.ts +6 -0
- package/src/chain/initState.ts +221 -0
- package/src/chain/interface.ts +280 -0
- package/src/chain/lightClient/index.ts +764 -0
- package/src/chain/lightClient/proofs.ts +85 -0
- package/src/chain/lightClient/types.ts +33 -0
- package/src/chain/opPools/aggregatedAttestationPool.ts +1063 -0
- package/src/chain/opPools/attestationPool.ts +282 -0
- package/src/chain/opPools/index.ts +5 -0
- package/src/chain/opPools/opPool.ts +462 -0
- package/src/chain/opPools/syncCommitteeMessagePool.ts +169 -0
- package/src/chain/opPools/syncContributionAndProofPool.ts +240 -0
- package/src/chain/opPools/types.ts +35 -0
- package/src/chain/opPools/utils.ts +65 -0
- package/src/chain/options.ts +138 -0
- package/src/chain/prepareNextSlot.ts +277 -0
- package/src/chain/produceBlock/computeNewStateRoot.ts +55 -0
- package/src/chain/produceBlock/index.ts +2 -0
- package/src/chain/produceBlock/produceBlockBody.ts +797 -0
- package/src/chain/produceBlock/validateBlobsAndKzgCommitments.ts +54 -0
- package/src/chain/regen/errors.ts +30 -0
- package/src/chain/regen/index.ts +4 -0
- package/src/chain/regen/interface.ts +93 -0
- package/src/chain/regen/queued.ts +317 -0
- package/src/chain/regen/regen.ts +424 -0
- package/src/chain/reprocess.ts +161 -0
- package/src/chain/rewards/attestationsRewards.ts +196 -0
- package/src/chain/rewards/blockRewards.ts +150 -0
- package/src/chain/rewards/syncCommitteeRewards.ts +58 -0
- package/src/chain/seenCache/index.ts +5 -0
- package/src/chain/seenCache/seenAggregateAndProof.ts +120 -0
- package/src/chain/seenCache/seenAttestationData.ts +145 -0
- package/src/chain/seenCache/seenAttesters.ts +58 -0
- package/src/chain/seenCache/seenBlockAttesters.ts +18 -0
- package/src/chain/seenCache/seenBlockProposers.ts +48 -0
- package/src/chain/seenCache/seenCommittee.ts +43 -0
- package/src/chain/seenCache/seenCommitteeContribution.ts +104 -0
- package/src/chain/seenCache/seenGossipBlockInput.ts +373 -0
- package/src/chain/serializeState.ts +32 -0
- package/src/chain/shufflingCache.ts +238 -0
- package/src/chain/stateCache/blockStateCacheImpl.ts +150 -0
- package/src/chain/stateCache/datastore/db.ts +36 -0
- package/src/chain/stateCache/datastore/file.ts +53 -0
- package/src/chain/stateCache/datastore/index.ts +2 -0
- package/src/chain/stateCache/datastore/types.ts +13 -0
- package/src/chain/stateCache/fifoBlockStateCache.ts +208 -0
- package/src/chain/stateCache/inMemoryCheckpointsCache.ts +198 -0
- package/src/chain/stateCache/index.ts +3 -0
- package/src/chain/stateCache/mapMetrics.ts +52 -0
- package/src/chain/stateCache/persistentCheckpointsCache.ts +837 -0
- package/src/chain/stateCache/types.ts +86 -0
- package/src/chain/validation/aggregateAndProof.ts +258 -0
- package/src/chain/validation/attestation.ts +885 -0
- package/src/chain/validation/attesterSlashing.ts +61 -0
- package/src/chain/validation/blobSidecar.ts +301 -0
- package/src/chain/validation/block.ts +188 -0
- package/src/chain/validation/blsToExecutionChange.ts +61 -0
- package/src/chain/validation/dataColumnSidecar.ts +381 -0
- package/src/chain/validation/index.ts +9 -0
- package/src/chain/validation/lightClientFinalityUpdate.ts +46 -0
- package/src/chain/validation/lightClientOptimisticUpdate.ts +68 -0
- package/src/chain/validation/proposerSlashing.ts +54 -0
- package/src/chain/validation/signatureSets/aggregateAndProof.ts +38 -0
- package/src/chain/validation/signatureSets/contributionAndProof.ts +27 -0
- package/src/chain/validation/signatureSets/index.ts +6 -0
- package/src/chain/validation/signatureSets/selectionProof.ts +27 -0
- package/src/chain/validation/signatureSets/syncCommittee.ts +22 -0
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +18 -0
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +27 -0
- package/src/chain/validation/syncCommittee.ts +165 -0
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +122 -0
- package/src/chain/validation/voluntaryExit.ts +58 -0
- package/src/chain/validatorMonitor.ts +1310 -0
- package/src/constants/constants.ts +15 -0
- package/src/constants/index.ts +2 -0
- package/src/constants/network.ts +52 -0
- package/src/db/beacon.ts +113 -0
- package/src/db/buckets.ts +80 -0
- package/src/db/index.ts +2 -0
- package/src/db/interface.ts +76 -0
- package/src/db/options.ts +7 -0
- package/src/db/repositories/attesterSlashing.ts +38 -0
- package/src/db/repositories/backfilledRanges.ts +29 -0
- package/src/db/repositories/blobSidecars.ts +37 -0
- package/src/db/repositories/blobSidecarsArchive.ts +28 -0
- package/src/db/repositories/block.ts +33 -0
- package/src/db/repositories/blockArchive.ts +170 -0
- package/src/db/repositories/blockArchiveIndex.ts +45 -0
- package/src/db/repositories/blsToExecutionChange.ts +16 -0
- package/src/db/repositories/checkpointState.ts +31 -0
- package/src/db/repositories/dataColumnSidecar.ts +49 -0
- package/src/db/repositories/dataColumnSidecarArchive.ts +56 -0
- package/src/db/repositories/depositDataRoot.ts +80 -0
- package/src/db/repositories/depositEvent.ts +32 -0
- package/src/db/repositories/eth1Data.ts +33 -0
- package/src/db/repositories/index.ts +20 -0
- package/src/db/repositories/lightclientBestUpdate.ts +41 -0
- package/src/db/repositories/lightclientCheckpointHeader.ts +32 -0
- package/src/db/repositories/lightclientSyncCommittee.ts +16 -0
- package/src/db/repositories/lightclientSyncCommitteeWitness.ts +77 -0
- package/src/db/repositories/proposerSlashing.ts +15 -0
- package/src/db/repositories/stateArchive.ts +69 -0
- package/src/db/repositories/stateArchiveIndex.ts +18 -0
- package/src/db/repositories/voluntaryExit.ts +15 -0
- package/src/db/single/index.ts +2 -0
- package/src/db/single/preGenesisState.ts +37 -0
- package/src/db/single/preGenesisStateLastProcessedBlock.ts +34 -0
- package/src/eth1/errors.ts +40 -0
- package/src/eth1/eth1DataCache.ts +26 -0
- package/src/eth1/eth1DepositDataTracker.ts +410 -0
- package/src/eth1/eth1DepositsCache.ts +141 -0
- package/src/eth1/eth1MergeBlockTracker.ts +328 -0
- package/src/eth1/index.ts +157 -0
- package/src/eth1/interface.ts +131 -0
- package/src/eth1/options.ts +28 -0
- package/src/eth1/provider/eth1Provider.ts +229 -0
- package/src/eth1/provider/jsonRpcHttpClient.ts +390 -0
- package/src/eth1/provider/jwt.ts +36 -0
- package/src/eth1/provider/utils.ts +136 -0
- package/src/eth1/stream.ts +75 -0
- package/src/eth1/utils/depositContract.ts +37 -0
- package/src/eth1/utils/deposits.ts +70 -0
- package/src/eth1/utils/eth1Data.ts +100 -0
- package/src/eth1/utils/eth1DepositEvent.ts +12 -0
- package/src/eth1/utils/eth1Vote.ts +142 -0
- package/src/eth1/utils/groupDepositEventsByBlock.ts +19 -0
- package/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts +18 -0
- package/src/execution/builder/cache.ts +39 -0
- package/src/execution/builder/http.ts +229 -0
- package/src/execution/builder/index.ts +27 -0
- package/src/execution/builder/interface.ts +49 -0
- package/src/execution/builder/utils.ts +19 -0
- package/src/execution/engine/disabled.ts +35 -0
- package/src/execution/engine/http.ts +644 -0
- package/src/execution/engine/index.ts +63 -0
- package/src/execution/engine/interface.ts +199 -0
- package/src/execution/engine/mock.ts +493 -0
- package/src/execution/engine/payloadIdCache.ts +54 -0
- package/src/execution/engine/types.ts +640 -0
- package/src/execution/engine/utils.ts +136 -0
- package/src/execution/index.ts +4 -0
- package/src/index.ts +20 -0
- package/src/metrics/index.ts +4 -0
- package/src/metrics/metrics/beacon.ts +390 -0
- package/src/metrics/metrics/lodestar.ts +1870 -0
- package/src/metrics/metrics.ts +43 -0
- package/src/metrics/nodeJsMetrics.ts +19 -0
- package/src/metrics/options.ts +22 -0
- package/src/metrics/server/http.ts +114 -0
- package/src/metrics/server/index.ts +1 -0
- package/src/metrics/utils/avgMinMax.ts +87 -0
- package/src/metrics/utils/gauge.ts +22 -0
- package/src/metrics/utils/registryMetricCreator.ts +41 -0
- package/src/monitoring/clientStats.ts +297 -0
- package/src/monitoring/index.ts +2 -0
- package/src/monitoring/options.ts +19 -0
- package/src/monitoring/properties.ts +152 -0
- package/src/monitoring/service.ts +235 -0
- package/src/monitoring/system.ts +146 -0
- package/src/monitoring/types.ts +21 -0
- package/src/network/core/events.ts +59 -0
- package/src/network/core/index.ts +3 -0
- package/src/network/core/metrics.ts +304 -0
- package/src/network/core/networkCore.ts +599 -0
- package/src/network/core/networkCoreWorker.ts +176 -0
- package/src/network/core/networkCoreWorkerHandler.ts +284 -0
- package/src/network/core/types.ts +119 -0
- package/src/network/discv5/index.ts +132 -0
- package/src/network/discv5/types.ts +74 -0
- package/src/network/discv5/utils.ts +50 -0
- package/src/network/discv5/worker.ts +137 -0
- package/src/network/events.ts +51 -0
- package/src/network/forks.ts +94 -0
- package/src/network/gossip/constants.ts +15 -0
- package/src/network/gossip/encoding.ts +111 -0
- package/src/network/gossip/errors.ts +7 -0
- package/src/network/gossip/gossipsub.ts +384 -0
- package/src/network/gossip/index.ts +4 -0
- package/src/network/gossip/interface.ts +215 -0
- package/src/network/gossip/metrics.ts +71 -0
- package/src/network/gossip/scoringParameters.ts +333 -0
- package/src/network/gossip/topic.ts +332 -0
- package/src/network/index.ts +8 -0
- package/src/network/interface.ts +134 -0
- package/src/network/libp2p/error.ts +55 -0
- package/src/network/libp2p/index.ts +153 -0
- package/src/network/metadata.ts +162 -0
- package/src/network/network.ts +767 -0
- package/src/network/networkConfig.ts +12 -0
- package/src/network/options.ts +70 -0
- package/src/network/peers/client.ts +29 -0
- package/src/network/peers/datastore.ts +188 -0
- package/src/network/peers/discover.ts +647 -0
- package/src/network/peers/index.ts +2 -0
- package/src/network/peers/peerManager.ts +900 -0
- package/src/network/peers/peersData.ts +65 -0
- package/src/network/peers/score/constants.ts +34 -0
- package/src/network/peers/score/index.ts +4 -0
- package/src/network/peers/score/interface.ts +74 -0
- package/src/network/peers/score/score.ts +200 -0
- package/src/network/peers/score/store.ts +95 -0
- package/src/network/peers/score/utils.ts +37 -0
- package/src/network/peers/utils/assertPeerRelevance.ts +99 -0
- package/src/network/peers/utils/enrSubnetsDeserialize.ts +27 -0
- package/src/network/peers/utils/getConnectedPeerIds.ts +33 -0
- package/src/network/peers/utils/index.ts +4 -0
- package/src/network/peers/utils/prioritizePeers.ts +627 -0
- package/src/network/peers/utils/subnetMap.ts +88 -0
- package/src/network/processor/aggregatorTracker.ts +38 -0
- package/src/network/processor/extractSlotRootFns.ts +64 -0
- package/src/network/processor/gossipHandlers.ts +951 -0
- package/src/network/processor/gossipQueues/index.ts +114 -0
- package/src/network/processor/gossipQueues/indexed.ts +219 -0
- package/src/network/processor/gossipQueues/linear.ts +162 -0
- package/src/network/processor/gossipQueues/types.ts +57 -0
- package/src/network/processor/gossipValidatorFn.ts +142 -0
- package/src/network/processor/index.ts +496 -0
- package/src/network/processor/types.ts +27 -0
- package/src/network/reqresp/ReqRespBeaconNode.ts +373 -0
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +101 -0
- package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +49 -0
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +114 -0
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +62 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +144 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +88 -0
- package/src/network/reqresp/handlers/index.ts +78 -0
- package/src/network/reqresp/handlers/lightClientBootstrap.ts +31 -0
- package/src/network/reqresp/handlers/lightClientFinalityUpdate.ts +21 -0
- package/src/network/reqresp/handlers/lightClientOptimisticUpdate.ts +21 -0
- package/src/network/reqresp/handlers/lightClientUpdatesByRange.ts +39 -0
- package/src/network/reqresp/index.ts +2 -0
- package/src/network/reqresp/interface.ts +45 -0
- package/src/network/reqresp/protocols.ts +146 -0
- package/src/network/reqresp/rateLimit.ts +112 -0
- package/src/network/reqresp/score.ts +70 -0
- package/src/network/reqresp/types.ts +174 -0
- package/src/network/reqresp/utils/collect.ts +84 -0
- package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +57 -0
- package/src/network/reqresp/utils/dataColumnResponseValidation.ts +99 -0
- package/src/network/statusCache.ts +17 -0
- package/src/network/subnets/attnetsService.ts +382 -0
- package/src/network/subnets/index.ts +2 -0
- package/src/network/subnets/interface.ts +66 -0
- package/src/network/subnets/syncnetsService.ts +147 -0
- package/src/network/subnets/util.ts +63 -0
- package/src/network/util.ts +29 -0
- package/src/node/index.ts +2 -0
- package/src/node/nodejs.ts +349 -0
- package/src/node/notifier.ts +206 -0
- package/src/node/options.ts +51 -0
- package/src/node/utils/interop/deposits.ts +53 -0
- package/src/node/utils/interop/state.ts +59 -0
- package/src/node/utils/lightclient.ts +7 -0
- package/src/node/utils/state.ts +37 -0
- package/src/sync/backfill/backfill.ts +893 -0
- package/src/sync/backfill/errors.ts +23 -0
- package/src/sync/backfill/index.ts +1 -0
- package/src/sync/backfill/verify.ts +58 -0
- package/src/sync/constants.ts +71 -0
- package/src/sync/index.ts +2 -0
- package/src/sync/interface.ts +55 -0
- package/src/sync/options.ts +45 -0
- package/src/sync/range/batch.ts +455 -0
- package/src/sync/range/chain.ts +715 -0
- package/src/sync/range/range.ts +354 -0
- package/src/sync/range/utils/batches.ts +119 -0
- package/src/sync/range/utils/chainTarget.ts +62 -0
- package/src/sync/range/utils/hashBlocks.ts +27 -0
- package/src/sync/range/utils/index.ts +5 -0
- package/src/sync/range/utils/peerBalancer.ts +184 -0
- package/src/sync/range/utils/updateChains.ts +66 -0
- package/src/sync/sync.ts +290 -0
- package/src/sync/types.ts +57 -0
- package/src/sync/unknownBlock.ts +860 -0
- package/src/sync/utils/downloadByRange.ts +808 -0
- package/src/sync/utils/downloadByRoot.ts +560 -0
- package/src/sync/utils/pendingBlocksTree.ts +97 -0
- package/src/sync/utils/remoteSyncType.ts +144 -0
- package/src/util/address.ts +3 -0
- package/src/util/array.ts +311 -0
- package/src/util/asyncIterableToEvents.ts +164 -0
- package/src/util/binarySearch.ts +48 -0
- package/src/util/bitArray.ts +84 -0
- package/src/util/blobs.ts +210 -0
- package/src/util/bufferPool.ts +95 -0
- package/src/util/bytes.ts +11 -0
- package/src/util/chunkify.ts +27 -0
- package/src/util/clock.ts +212 -0
- package/src/util/dataColumns.ts +415 -0
- package/src/util/dependentRoot.ts +47 -0
- package/src/util/enum.ts +17 -0
- package/src/util/error.ts +56 -0
- package/src/util/eventLoop.ts +22 -0
- package/src/util/execution.ts +223 -0
- package/src/util/file.ts +52 -0
- package/src/util/forkChoice.ts +5 -0
- package/src/util/forkName.ts +20 -0
- package/src/util/graffiti.ts +39 -0
- package/src/util/hex.ts +9 -0
- package/src/util/index.ts +2 -0
- package/src/util/ip.ts +6 -0
- package/src/util/itTrigger.ts +49 -0
- package/src/util/kzg.ts +3 -0
- package/src/util/map.ts +77 -0
- package/src/util/metadata.ts +22 -0
- package/src/util/multifork.ts +69 -0
- package/src/util/numpy.ts +8 -0
- package/src/util/peerId.ts +16 -0
- package/src/util/profile.ts +54 -0
- package/src/util/promises.ts +14 -0
- package/src/util/queue/errors.ts +14 -0
- package/src/util/queue/fnQueue.ts +16 -0
- package/src/util/queue/index.ts +4 -0
- package/src/util/queue/itemQueue.ts +128 -0
- package/src/util/queue/options.ts +37 -0
- package/src/util/serializedCache.ts +20 -0
- package/src/util/set.ts +62 -0
- package/src/util/shuffle.ts +21 -0
- package/src/util/sortBy.ts +19 -0
- package/src/util/sszBytes.ts +481 -0
- package/src/util/strictEvents.ts +8 -0
- package/src/util/time.ts +13 -0
- package/src/util/timeSeries.ts +118 -0
- package/src/util/types.ts +31 -0
- package/src/util/workerEvents.ts +142 -0
- package/src/util/wrapError.ts +27 -0
- package/lib/chain/seenCache/seenBlockInput.d.ts +0 -84
- package/lib/chain/seenCache/seenBlockInput.js +0 -225
- package/lib/chain/seenCache/seenBlockInput.js.map +0 -1
- package/lib/network/reqresp/beaconBlocksMaybeBlobsByRange.d.ts +0 -28
- package/lib/network/reqresp/beaconBlocksMaybeBlobsByRange.js +0 -328
- package/lib/network/reqresp/beaconBlocksMaybeBlobsByRange.js.map +0 -1
- package/lib/network/reqresp/beaconBlocksMaybeBlobsByRoot.d.ts +0 -49
- package/lib/network/reqresp/beaconBlocksMaybeBlobsByRoot.js +0 -499
- package/lib/network/reqresp/beaconBlocksMaybeBlobsByRoot.js.map +0 -1
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PeerScoreParams,
|
|
3
|
+
PeerScoreThresholds,
|
|
4
|
+
TopicScoreParams,
|
|
5
|
+
defaultTopicScoreParams,
|
|
6
|
+
} from "@chainsafe/libp2p-gossipsub/score";
|
|
7
|
+
import {BeaconConfig} from "@lodestar/config";
|
|
8
|
+
import {ATTESTATION_SUBNET_COUNT, SLOTS_PER_EPOCH, TARGET_AGGREGATORS_PER_COMMITTEE} from "@lodestar/params";
|
|
9
|
+
import {computeCommitteeCount} from "@lodestar/state-transition";
|
|
10
|
+
import {getActiveForkBoundaries} from "../forks.js";
|
|
11
|
+
import {Eth2Context} from "./gossipsub.js";
|
|
12
|
+
import {GossipType} from "./interface.js";
|
|
13
|
+
import {stringifyGossipTopic} from "./topic.js";
|
|
14
|
+
|
|
15
|
+
export const GOSSIP_D = 8;
|
|
16
|
+
export const GOSSIP_D_LOW = 6;
|
|
17
|
+
export const GOSSIP_D_HIGH = 12;
|
|
18
|
+
|
|
19
|
+
const MAX_IN_MESH_SCORE = 10.0;
|
|
20
|
+
const MAX_FIRST_MESSAGE_DELIVERIES_SCORE = 40.0;
|
|
21
|
+
const BEACON_BLOCK_WEIGHT = 0.5;
|
|
22
|
+
const BEACON_AGGREGATE_PROOF_WEIGHT = 0.5;
|
|
23
|
+
const VOLUNTARY_EXIT_WEIGHT = 0.05;
|
|
24
|
+
const PROPOSER_SLASHING_WEIGHT = 0.05;
|
|
25
|
+
const ATTESTER_SLASHING_WEIGHT = 0.05;
|
|
26
|
+
const BLS_TO_EXECUTION_CHANGE_WEIGHT = 0.05;
|
|
27
|
+
|
|
28
|
+
const beaconAttestationSubnetWeight = 1 / ATTESTATION_SUBNET_COUNT;
|
|
29
|
+
const maxPositiveScore =
|
|
30
|
+
(MAX_IN_MESH_SCORE + MAX_FIRST_MESSAGE_DELIVERIES_SCORE) *
|
|
31
|
+
(BEACON_BLOCK_WEIGHT +
|
|
32
|
+
+BEACON_AGGREGATE_PROOF_WEIGHT +
|
|
33
|
+
beaconAttestationSubnetWeight * ATTESTATION_SUBNET_COUNT +
|
|
34
|
+
VOLUNTARY_EXIT_WEIGHT +
|
|
35
|
+
PROPOSER_SLASHING_WEIGHT +
|
|
36
|
+
ATTESTER_SLASHING_WEIGHT +
|
|
37
|
+
BLS_TO_EXECUTION_CHANGE_WEIGHT);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The following params is implemented by Lighthouse at
|
|
41
|
+
* https://github.com/sigp/lighthouse/blob/b0ac3464ca5fb1e9d75060b56c83bfaf990a3d25/beacon_node/eth2_libp2p/src/behaviour/gossipsub_scoring_parameters.rs#L83
|
|
42
|
+
*/
|
|
43
|
+
export const gossipScoreThresholds: PeerScoreThresholds = {
|
|
44
|
+
gossipThreshold: -4000,
|
|
45
|
+
publishThreshold: -8000,
|
|
46
|
+
graylistThreshold: -16000,
|
|
47
|
+
acceptPXThreshold: 100,
|
|
48
|
+
opportunisticGraftThreshold: 5,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Peer may sometimes has negative gossipsub score and we give it time to recover, however gossipsub score comes below this we need to take into account.
|
|
53
|
+
* Given gossipsubThresold = -4000, it's comfortable to only ignore negative score gossip peer score > -1000
|
|
54
|
+
*/
|
|
55
|
+
export const negativeGossipScoreIgnoreThreshold = -1000;
|
|
56
|
+
|
|
57
|
+
type MeshMessageInfo = {
|
|
58
|
+
decaySlots: number;
|
|
59
|
+
capFactor: number;
|
|
60
|
+
activationWindow: number;
|
|
61
|
+
currentSlot: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type PreComputedParams = {
|
|
65
|
+
scoreParameterDecayFn: (decayTimeMs: number) => number;
|
|
66
|
+
epochDurationMs: number;
|
|
67
|
+
slotDurationMs: number;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
type TopicScoreInput = {
|
|
71
|
+
topicWeight: number;
|
|
72
|
+
expectedMessageRate: number;
|
|
73
|
+
firstMessageDecayTime: number;
|
|
74
|
+
meshMessageInfo?: MeshMessageInfo;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Explanation of each param https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md#peer-scoring
|
|
79
|
+
*/
|
|
80
|
+
export function computeGossipPeerScoreParams({
|
|
81
|
+
config,
|
|
82
|
+
eth2Context,
|
|
83
|
+
}: {
|
|
84
|
+
config: BeaconConfig;
|
|
85
|
+
eth2Context: Eth2Context;
|
|
86
|
+
}): Partial<PeerScoreParams> {
|
|
87
|
+
const decayIntervalMs = config.SLOT_DURATION_MS;
|
|
88
|
+
const decayToZero = 0.01;
|
|
89
|
+
const epochDurationMs = config.SLOT_DURATION_MS * SLOTS_PER_EPOCH;
|
|
90
|
+
const slotDurationMs = config.SLOT_DURATION_MS;
|
|
91
|
+
const scoreParameterDecayFn = (decayTimeMs: number): number => {
|
|
92
|
+
return scoreParameterDecayWithBase(decayTimeMs, decayIntervalMs, decayToZero);
|
|
93
|
+
};
|
|
94
|
+
const behaviourPenaltyDecay = scoreParameterDecayFn(epochDurationMs * 10);
|
|
95
|
+
const behaviourPenaltyThreshold = 6;
|
|
96
|
+
const targetValue = decayConvergence(behaviourPenaltyDecay, 10 / SLOTS_PER_EPOCH) - behaviourPenaltyThreshold;
|
|
97
|
+
const topicScoreCap = maxPositiveScore * 0.5;
|
|
98
|
+
|
|
99
|
+
const params = {
|
|
100
|
+
topics: getAllTopicsScoreParams(config, eth2Context, {
|
|
101
|
+
epochDurationMs,
|
|
102
|
+
slotDurationMs,
|
|
103
|
+
scoreParameterDecayFn,
|
|
104
|
+
}),
|
|
105
|
+
decayInterval: decayIntervalMs,
|
|
106
|
+
decayToZero,
|
|
107
|
+
// time to remember counters for a disconnected peer, should be in ms
|
|
108
|
+
retainScore: epochDurationMs * 100,
|
|
109
|
+
appSpecificWeight: 1,
|
|
110
|
+
IPColocationFactorThreshold: 3,
|
|
111
|
+
// js-gossipsub doesn't have behaviourPenaltiesThreshold
|
|
112
|
+
behaviourPenaltyDecay,
|
|
113
|
+
behaviourPenaltyWeight: gossipScoreThresholds.gossipThreshold / (targetValue * targetValue),
|
|
114
|
+
behaviourPenaltyThreshold,
|
|
115
|
+
topicScoreCap,
|
|
116
|
+
IPColocationFactorWeight: -1 * topicScoreCap,
|
|
117
|
+
};
|
|
118
|
+
return params;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function getAllTopicsScoreParams(
|
|
122
|
+
config: BeaconConfig,
|
|
123
|
+
eth2Context: Eth2Context,
|
|
124
|
+
precomputedParams: PreComputedParams
|
|
125
|
+
): Record<string, TopicScoreParams> {
|
|
126
|
+
const {epochDurationMs, slotDurationMs} = precomputedParams;
|
|
127
|
+
const epoch = eth2Context.currentEpoch;
|
|
128
|
+
const topicsParams: Record<string, TopicScoreParams> = {};
|
|
129
|
+
const boundaries = getActiveForkBoundaries(config, epoch);
|
|
130
|
+
const beaconAttestationSubnetWeight = 1 / ATTESTATION_SUBNET_COUNT;
|
|
131
|
+
for (const boundary of boundaries) {
|
|
132
|
+
//first all fixed topics
|
|
133
|
+
topicsParams[
|
|
134
|
+
stringifyGossipTopic(config, {
|
|
135
|
+
type: GossipType.voluntary_exit,
|
|
136
|
+
boundary,
|
|
137
|
+
})
|
|
138
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
139
|
+
topicWeight: VOLUNTARY_EXIT_WEIGHT,
|
|
140
|
+
expectedMessageRate: 4 / SLOTS_PER_EPOCH,
|
|
141
|
+
firstMessageDecayTime: epochDurationMs * 100,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
topicsParams[
|
|
145
|
+
stringifyGossipTopic(config, {
|
|
146
|
+
type: GossipType.bls_to_execution_change,
|
|
147
|
+
boundary,
|
|
148
|
+
})
|
|
149
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
150
|
+
topicWeight: BLS_TO_EXECUTION_CHANGE_WEIGHT,
|
|
151
|
+
expectedMessageRate: 4 / SLOTS_PER_EPOCH,
|
|
152
|
+
firstMessageDecayTime: epochDurationMs * 100,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
topicsParams[
|
|
156
|
+
stringifyGossipTopic(config, {
|
|
157
|
+
type: GossipType.attester_slashing,
|
|
158
|
+
boundary,
|
|
159
|
+
})
|
|
160
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
161
|
+
topicWeight: ATTESTER_SLASHING_WEIGHT,
|
|
162
|
+
expectedMessageRate: 1 / 5 / SLOTS_PER_EPOCH,
|
|
163
|
+
firstMessageDecayTime: epochDurationMs * 100,
|
|
164
|
+
});
|
|
165
|
+
topicsParams[
|
|
166
|
+
stringifyGossipTopic(config, {
|
|
167
|
+
type: GossipType.proposer_slashing,
|
|
168
|
+
boundary,
|
|
169
|
+
})
|
|
170
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
171
|
+
topicWeight: PROPOSER_SLASHING_WEIGHT,
|
|
172
|
+
expectedMessageRate: 1 / 5 / SLOTS_PER_EPOCH,
|
|
173
|
+
firstMessageDecayTime: epochDurationMs * 100,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// other topics
|
|
177
|
+
topicsParams[
|
|
178
|
+
stringifyGossipTopic(config, {
|
|
179
|
+
type: GossipType.beacon_block,
|
|
180
|
+
boundary,
|
|
181
|
+
})
|
|
182
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
183
|
+
topicWeight: BEACON_BLOCK_WEIGHT,
|
|
184
|
+
expectedMessageRate: 1,
|
|
185
|
+
firstMessageDecayTime: epochDurationMs * 20,
|
|
186
|
+
meshMessageInfo: {
|
|
187
|
+
decaySlots: SLOTS_PER_EPOCH * 5,
|
|
188
|
+
capFactor: 3,
|
|
189
|
+
activationWindow: epochDurationMs,
|
|
190
|
+
currentSlot: eth2Context.currentSlot,
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const activeValidatorCount = eth2Context.activeValidatorCount;
|
|
195
|
+
const {aggregatorsPerslot, committeesPerSlot} = expectedAggregatorCountPerSlot(activeValidatorCount);
|
|
196
|
+
|
|
197
|
+
// Checks to prevent unwanted errors in gossipsub
|
|
198
|
+
// Error: invalid score parameters for topic /eth2/4a26c58b/beacon_attestation_0/ssz_snappy: invalid FirstMessageDeliveriesCap; must be positive
|
|
199
|
+
// at Object.validatePeerScoreParams (/usr/app/node_modules/libp2p-gossipsub/src/score/peer-score-params.js:62:27)
|
|
200
|
+
if (activeValidatorCount === 0) throw Error("activeValidatorCount === 0");
|
|
201
|
+
if (aggregatorsPerslot === 0) throw Error("aggregatorsPerslot === 0");
|
|
202
|
+
|
|
203
|
+
const multipleBurstsPerSubnetPerEpoch = committeesPerSlot >= (2 * ATTESTATION_SUBNET_COUNT) / SLOTS_PER_EPOCH;
|
|
204
|
+
topicsParams[
|
|
205
|
+
stringifyGossipTopic(config, {
|
|
206
|
+
type: GossipType.beacon_aggregate_and_proof,
|
|
207
|
+
boundary,
|
|
208
|
+
})
|
|
209
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
210
|
+
topicWeight: BEACON_AGGREGATE_PROOF_WEIGHT,
|
|
211
|
+
expectedMessageRate: aggregatorsPerslot,
|
|
212
|
+
firstMessageDecayTime: epochDurationMs,
|
|
213
|
+
meshMessageInfo: {
|
|
214
|
+
decaySlots: SLOTS_PER_EPOCH * 2,
|
|
215
|
+
capFactor: 4,
|
|
216
|
+
activationWindow: epochDurationMs,
|
|
217
|
+
currentSlot: eth2Context.currentSlot,
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
const beaconAttestationParams = getTopicScoreParams(config, precomputedParams, {
|
|
222
|
+
topicWeight: beaconAttestationSubnetWeight,
|
|
223
|
+
expectedMessageRate: activeValidatorCount / ATTESTATION_SUBNET_COUNT / SLOTS_PER_EPOCH,
|
|
224
|
+
firstMessageDecayTime: multipleBurstsPerSubnetPerEpoch ? epochDurationMs : epochDurationMs * 4,
|
|
225
|
+
meshMessageInfo: {
|
|
226
|
+
decaySlots: multipleBurstsPerSubnetPerEpoch ? SLOTS_PER_EPOCH * 4 : SLOTS_PER_EPOCH * 16,
|
|
227
|
+
capFactor: 16,
|
|
228
|
+
activationWindow: multipleBurstsPerSubnetPerEpoch
|
|
229
|
+
? slotDurationMs * (SLOTS_PER_EPOCH / 2 + 1)
|
|
230
|
+
: epochDurationMs,
|
|
231
|
+
currentSlot: eth2Context.currentSlot,
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
for (let subnet = 0; subnet < ATTESTATION_SUBNET_COUNT; subnet++) {
|
|
235
|
+
const topicStr = stringifyGossipTopic(config, {
|
|
236
|
+
type: GossipType.beacon_attestation,
|
|
237
|
+
subnet,
|
|
238
|
+
boundary,
|
|
239
|
+
});
|
|
240
|
+
topicsParams[topicStr] = beaconAttestationParams;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return topicsParams;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function getTopicScoreParams(
|
|
247
|
+
config: BeaconConfig,
|
|
248
|
+
{epochDurationMs, slotDurationMs, scoreParameterDecayFn}: PreComputedParams,
|
|
249
|
+
{topicWeight, expectedMessageRate, firstMessageDecayTime, meshMessageInfo}: TopicScoreInput
|
|
250
|
+
): TopicScoreParams {
|
|
251
|
+
const params = {...defaultTopicScoreParams};
|
|
252
|
+
|
|
253
|
+
params.topicWeight = topicWeight;
|
|
254
|
+
|
|
255
|
+
params.timeInMeshQuantum = slotDurationMs;
|
|
256
|
+
params.timeInMeshCap = 3600 / (params.timeInMeshQuantum / 1000);
|
|
257
|
+
params.timeInMeshWeight = 10 / params.timeInMeshCap;
|
|
258
|
+
|
|
259
|
+
params.firstMessageDeliveriesDecay = scoreParameterDecayFn(firstMessageDecayTime);
|
|
260
|
+
params.firstMessageDeliveriesCap = decayConvergence(
|
|
261
|
+
params.firstMessageDeliveriesDecay,
|
|
262
|
+
(2 * expectedMessageRate) / GOSSIP_D
|
|
263
|
+
);
|
|
264
|
+
params.firstMessageDeliveriesWeight = 40 / params.firstMessageDeliveriesCap;
|
|
265
|
+
|
|
266
|
+
if (meshMessageInfo) {
|
|
267
|
+
const {decaySlots, capFactor, activationWindow, currentSlot} = meshMessageInfo;
|
|
268
|
+
const decayTimeMs = config.SLOT_DURATION_MS * decaySlots;
|
|
269
|
+
params.meshMessageDeliveriesDecay = scoreParameterDecayFn(decayTimeMs);
|
|
270
|
+
params.meshMessageDeliveriesThreshold = threshold(params.meshMessageDeliveriesDecay, expectedMessageRate / 50);
|
|
271
|
+
params.meshMessageDeliveriesCap = Math.max(capFactor * params.meshMessageDeliveriesThreshold, 2);
|
|
272
|
+
params.meshMessageDeliveriesActivation = activationWindow;
|
|
273
|
+
// the default in gossipsub is 2s is not enough since lodestar suffers from I/O lag
|
|
274
|
+
params.meshMessageDeliveriesWindow = 12 * 1000; // 12s
|
|
275
|
+
params.meshFailurePenaltyDecay = params.meshMessageDeliveriesDecay;
|
|
276
|
+
params.meshMessageDeliveriesWeight =
|
|
277
|
+
(-1 * maxPositiveScore) / (params.topicWeight * Math.pow(params.meshMessageDeliveriesThreshold, 2));
|
|
278
|
+
params.meshFailurePenaltyWeight = params.meshMessageDeliveriesWeight;
|
|
279
|
+
if (decaySlots >= currentSlot) {
|
|
280
|
+
params.meshMessageDeliveriesThreshold = 0;
|
|
281
|
+
params.meshMessageDeliveriesWeight = 0;
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
params.meshMessageDeliveriesWeight = 0;
|
|
285
|
+
params.meshMessageDeliveriesThreshold = 0;
|
|
286
|
+
params.meshMessageDeliveriesDecay = 0;
|
|
287
|
+
params.meshMessageDeliveriesCap = 0;
|
|
288
|
+
params.meshMessageDeliveriesWindow = 0;
|
|
289
|
+
params.meshMessageDeliveriesActivation = 0;
|
|
290
|
+
params.meshFailurePenaltyDecay = 0;
|
|
291
|
+
params.meshFailurePenaltyWeight = 0;
|
|
292
|
+
}
|
|
293
|
+
params.invalidMessageDeliveriesWeight = (-1 * maxPositiveScore) / params.topicWeight;
|
|
294
|
+
params.invalidMessageDeliveriesDecay = scoreParameterDecayFn(epochDurationMs * 50);
|
|
295
|
+
return params;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function scoreParameterDecayWithBase(decayTimeMs: number, decayIntervalMs: number, decayToZero: number): number {
|
|
299
|
+
const ticks = decayTimeMs / decayIntervalMs;
|
|
300
|
+
return Math.pow(decayToZero, 1 / ticks);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function expectedAggregatorCountPerSlot(activeValidatorCount: number): {
|
|
304
|
+
aggregatorsPerslot: number;
|
|
305
|
+
committeesPerSlot: number;
|
|
306
|
+
} {
|
|
307
|
+
const committeesPerSlot = computeCommitteeCount(activeValidatorCount);
|
|
308
|
+
const committeesPerEpoch = committeesPerSlot * SLOTS_PER_EPOCH;
|
|
309
|
+
const smallerCommitteeSize = Math.floor(activeValidatorCount / committeesPerEpoch);
|
|
310
|
+
const largerCommiteeeSize = smallerCommitteeSize + 1;
|
|
311
|
+
const largeCommitteesPerEpoch = activeValidatorCount - smallerCommitteeSize * committeesPerEpoch;
|
|
312
|
+
const smallCommiteesPerEpoch = committeesPerEpoch - largeCommitteesPerEpoch;
|
|
313
|
+
const moduloSmaller = Math.max(1, Math.floor(smallerCommitteeSize / TARGET_AGGREGATORS_PER_COMMITTEE));
|
|
314
|
+
const moduloLarger = Math.max(1, Math.floor((smallerCommitteeSize + 1) / TARGET_AGGREGATORS_PER_COMMITTEE));
|
|
315
|
+
const smallCommitteeAggregatorPerEpoch = Math.floor((smallerCommitteeSize / moduloSmaller) * smallCommiteesPerEpoch);
|
|
316
|
+
const largeCommitteeAggregatorPerEpoch = Math.floor((largerCommiteeeSize / moduloLarger) * largeCommitteesPerEpoch);
|
|
317
|
+
|
|
318
|
+
return {
|
|
319
|
+
aggregatorsPerslot: Math.max(
|
|
320
|
+
1,
|
|
321
|
+
Math.floor((smallCommitteeAggregatorPerEpoch + largeCommitteeAggregatorPerEpoch) / SLOTS_PER_EPOCH)
|
|
322
|
+
),
|
|
323
|
+
committeesPerSlot,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function threshold(decay: number, rate: number): number {
|
|
328
|
+
return decayConvergence(decay, rate) * decay;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function decayConvergence(decay: number, rate: number): number {
|
|
332
|
+
return rate / (1 - decay);
|
|
333
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import {ForkDigestContext} from "@lodestar/config";
|
|
2
|
+
import {
|
|
3
|
+
ATTESTATION_SUBNET_COUNT,
|
|
4
|
+
ForkName,
|
|
5
|
+
ForkSeq,
|
|
6
|
+
SYNC_COMMITTEE_SUBNET_COUNT,
|
|
7
|
+
isForkPostAltair,
|
|
8
|
+
isForkPostElectra,
|
|
9
|
+
} from "@lodestar/params";
|
|
10
|
+
import {Attestation, SingleAttestation, ssz, sszTypesFor} from "@lodestar/types";
|
|
11
|
+
import {GossipAction, GossipActionError, GossipErrorCode} from "../../chain/errors/gossipValidation.js";
|
|
12
|
+
import {NetworkConfig} from "../networkConfig.js";
|
|
13
|
+
import {DEFAULT_ENCODING} from "./constants.js";
|
|
14
|
+
import {GossipEncoding, GossipTopic, GossipTopicTypeMap, GossipType, SSZTypeOfGossipTopic} from "./interface.js";
|
|
15
|
+
|
|
16
|
+
export interface IGossipTopicCache {
|
|
17
|
+
getTopic(topicStr: string): GossipTopic;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class GossipTopicCache implements IGossipTopicCache {
|
|
21
|
+
private topicsByTopicStr = new Map<string, Required<GossipTopic>>();
|
|
22
|
+
|
|
23
|
+
constructor(private readonly forkDigestContext: ForkDigestContext) {}
|
|
24
|
+
|
|
25
|
+
/** Returns cached GossipTopic, otherwise attempts to parse it from the str */
|
|
26
|
+
getTopic(topicStr: string): GossipTopic {
|
|
27
|
+
let topic = this.topicsByTopicStr.get(topicStr);
|
|
28
|
+
if (topic === undefined) {
|
|
29
|
+
topic = parseGossipTopic(this.forkDigestContext, topicStr);
|
|
30
|
+
// TODO: Consider just throwing here. We should only receive messages from known subscribed topics
|
|
31
|
+
this.topicsByTopicStr.set(topicStr, topic);
|
|
32
|
+
}
|
|
33
|
+
return topic;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Returns cached GossipTopic, otherwise returns undefined */
|
|
37
|
+
getKnownTopic(topicStr: string): GossipTopic | undefined {
|
|
38
|
+
return this.topicsByTopicStr.get(topicStr);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setTopic(topicStr: string, topic: GossipTopic): void {
|
|
42
|
+
if (!this.topicsByTopicStr.has(topicStr)) {
|
|
43
|
+
this.topicsByTopicStr.set(topicStr, {encoding: DEFAULT_ENCODING, ...topic});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Stringify a GossipTopic into a spec-ed formated topic string
|
|
50
|
+
*/
|
|
51
|
+
export function stringifyGossipTopic(forkDigestContext: ForkDigestContext, topic: GossipTopic): string {
|
|
52
|
+
const forkDigestHexNoPrefix = forkDigestContext.forkBoundary2ForkDigestHex(topic.boundary);
|
|
53
|
+
const topicType = stringifyGossipTopicType(topic);
|
|
54
|
+
const encoding = topic.encoding ?? DEFAULT_ENCODING;
|
|
55
|
+
return `/eth2/${forkDigestHexNoPrefix}/${topicType}/${encoding}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Stringify a GossipTopic into a spec-ed formated partial topic string
|
|
60
|
+
*/
|
|
61
|
+
function stringifyGossipTopicType(topic: GossipTopic): string {
|
|
62
|
+
switch (topic.type) {
|
|
63
|
+
case GossipType.beacon_block:
|
|
64
|
+
case GossipType.beacon_aggregate_and_proof:
|
|
65
|
+
case GossipType.voluntary_exit:
|
|
66
|
+
case GossipType.proposer_slashing:
|
|
67
|
+
case GossipType.attester_slashing:
|
|
68
|
+
case GossipType.sync_committee_contribution_and_proof:
|
|
69
|
+
case GossipType.light_client_finality_update:
|
|
70
|
+
case GossipType.light_client_optimistic_update:
|
|
71
|
+
case GossipType.bls_to_execution_change:
|
|
72
|
+
return topic.type;
|
|
73
|
+
case GossipType.beacon_attestation:
|
|
74
|
+
case GossipType.sync_committee:
|
|
75
|
+
return `${topic.type}_${topic.subnet}`;
|
|
76
|
+
case GossipType.blob_sidecar:
|
|
77
|
+
return `${topic.type}_${topic.subnet}`;
|
|
78
|
+
case GossipType.data_column_sidecar:
|
|
79
|
+
return `${topic.type}_${topic.subnet}`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function getGossipSSZType(topic: GossipTopic) {
|
|
84
|
+
const {fork} = topic.boundary;
|
|
85
|
+
switch (topic.type) {
|
|
86
|
+
case GossipType.beacon_block:
|
|
87
|
+
// beacon_block is updated in altair to support the updated SignedBeaconBlock type
|
|
88
|
+
return ssz[fork].SignedBeaconBlock;
|
|
89
|
+
case GossipType.blob_sidecar:
|
|
90
|
+
return ssz.deneb.BlobSidecar;
|
|
91
|
+
case GossipType.data_column_sidecar:
|
|
92
|
+
return ssz.fulu.DataColumnSidecar;
|
|
93
|
+
case GossipType.beacon_aggregate_and_proof:
|
|
94
|
+
return sszTypesFor(fork).SignedAggregateAndProof;
|
|
95
|
+
case GossipType.beacon_attestation:
|
|
96
|
+
return sszTypesFor(fork).SingleAttestation;
|
|
97
|
+
case GossipType.proposer_slashing:
|
|
98
|
+
return ssz.phase0.ProposerSlashing;
|
|
99
|
+
case GossipType.attester_slashing:
|
|
100
|
+
return sszTypesFor(fork).AttesterSlashing;
|
|
101
|
+
case GossipType.voluntary_exit:
|
|
102
|
+
return ssz.phase0.SignedVoluntaryExit;
|
|
103
|
+
case GossipType.sync_committee_contribution_and_proof:
|
|
104
|
+
return ssz.altair.SignedContributionAndProof;
|
|
105
|
+
case GossipType.sync_committee:
|
|
106
|
+
return ssz.altair.SyncCommitteeMessage;
|
|
107
|
+
case GossipType.light_client_optimistic_update:
|
|
108
|
+
return isForkPostAltair(fork)
|
|
109
|
+
? sszTypesFor(fork).LightClientOptimisticUpdate
|
|
110
|
+
: ssz.altair.LightClientOptimisticUpdate;
|
|
111
|
+
case GossipType.light_client_finality_update:
|
|
112
|
+
return isForkPostAltair(fork)
|
|
113
|
+
? sszTypesFor(fork).LightClientFinalityUpdate
|
|
114
|
+
: ssz.altair.LightClientFinalityUpdate;
|
|
115
|
+
case GossipType.bls_to_execution_change:
|
|
116
|
+
return ssz.capella.SignedBLSToExecutionChange;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Deserialize a gossip serialized data into an ssz object.
|
|
122
|
+
*/
|
|
123
|
+
export function sszDeserialize<T extends GossipTopic>(topic: T, serializedData: Uint8Array): SSZTypeOfGossipTopic<T> {
|
|
124
|
+
const sszType = getGossipSSZType(topic);
|
|
125
|
+
try {
|
|
126
|
+
return sszType.deserialize(serializedData) as SSZTypeOfGossipTopic<T>;
|
|
127
|
+
} catch (_e) {
|
|
128
|
+
throw new GossipActionError(GossipAction.REJECT, {code: GossipErrorCode.INVALID_SERIALIZED_BYTES_ERROR_CODE});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated
|
|
134
|
+
* Deserialize a gossip serialized data into an Attestation object.
|
|
135
|
+
* No longer used post-electra. Use `sszDeserializeSingleAttestation` instead
|
|
136
|
+
*/
|
|
137
|
+
export function sszDeserializeAttestation(fork: ForkName, serializedData: Uint8Array): Attestation {
|
|
138
|
+
try {
|
|
139
|
+
return sszTypesFor(fork).Attestation.deserialize(serializedData);
|
|
140
|
+
} catch (_e) {
|
|
141
|
+
throw new GossipActionError(GossipAction.REJECT, {code: GossipErrorCode.INVALID_SERIALIZED_BYTES_ERROR_CODE});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Deserialize a gossip seralized data into an SingleAttestation object.
|
|
147
|
+
*/
|
|
148
|
+
export function sszDeserializeSingleAttestation(fork: ForkName, serializedData: Uint8Array): SingleAttestation {
|
|
149
|
+
try {
|
|
150
|
+
if (isForkPostElectra(fork)) {
|
|
151
|
+
return sszTypesFor(fork).SingleAttestation.deserialize(serializedData);
|
|
152
|
+
}
|
|
153
|
+
return sszTypesFor(fork).Attestation.deserialize(serializedData) as SingleAttestation;
|
|
154
|
+
} catch (_e) {
|
|
155
|
+
throw new GossipActionError(GossipAction.REJECT, {code: GossipErrorCode.INVALID_SERIALIZED_BYTES_ERROR_CODE});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Parsing
|
|
160
|
+
|
|
161
|
+
const gossipTopicRegex = /^\/eth2\/(\w+)\/(\w+)\/(\w+)/;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Parse a `GossipTopic` object from its stringified form.
|
|
165
|
+
* A gossip topic has the format
|
|
166
|
+
* ```ts
|
|
167
|
+
* /eth2/$FORK_DIGEST/$GOSSIP_TYPE/$ENCODING
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export function parseGossipTopic(forkDigestContext: ForkDigestContext, topicStr: string): Required<GossipTopic> {
|
|
171
|
+
try {
|
|
172
|
+
const matches = topicStr.match(gossipTopicRegex);
|
|
173
|
+
if (matches === null) {
|
|
174
|
+
throw Error(`Must match regex ${gossipTopicRegex}`);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const [, forkDigestHexNoPrefix, gossipTypeStr, encodingStr] = matches;
|
|
178
|
+
|
|
179
|
+
const boundary = forkDigestContext.forkDigest2ForkBoundary(forkDigestHexNoPrefix);
|
|
180
|
+
const encoding = parseEncodingStr(encodingStr);
|
|
181
|
+
|
|
182
|
+
// Inline-d the parseGossipTopicType() function since spreading the resulting object x4 the time to parse a topicStr
|
|
183
|
+
switch (gossipTypeStr) {
|
|
184
|
+
case GossipType.beacon_block:
|
|
185
|
+
case GossipType.beacon_aggregate_and_proof:
|
|
186
|
+
case GossipType.voluntary_exit:
|
|
187
|
+
case GossipType.proposer_slashing:
|
|
188
|
+
case GossipType.attester_slashing:
|
|
189
|
+
case GossipType.sync_committee_contribution_and_proof:
|
|
190
|
+
case GossipType.light_client_finality_update:
|
|
191
|
+
case GossipType.light_client_optimistic_update:
|
|
192
|
+
case GossipType.bls_to_execution_change:
|
|
193
|
+
return {type: gossipTypeStr, boundary, encoding};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
for (const gossipType of [GossipType.beacon_attestation as const, GossipType.sync_committee as const]) {
|
|
197
|
+
if (gossipTypeStr.startsWith(gossipType)) {
|
|
198
|
+
const subnetStr = gossipTypeStr.slice(gossipType.length + 1); // +1 for '_' concatenating the topic name and the subnet
|
|
199
|
+
const subnet = parseInt(subnetStr, 10);
|
|
200
|
+
if (Number.isNaN(subnet)) throw Error(`Subnet ${subnetStr} is not a number`);
|
|
201
|
+
return {type: gossipType, subnet, boundary, encoding};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (gossipTypeStr.startsWith(GossipType.blob_sidecar)) {
|
|
206
|
+
const subnetStr = gossipTypeStr.slice(GossipType.blob_sidecar.length + 1); // +1 for '_' concatenating the topic name and the subnet
|
|
207
|
+
const subnet = parseInt(subnetStr, 10);
|
|
208
|
+
if (Number.isNaN(subnet)) throw Error(`subnet ${subnetStr} is not a number`);
|
|
209
|
+
return {type: GossipType.blob_sidecar, subnet, boundary, encoding};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (gossipTypeStr.startsWith(GossipType.data_column_sidecar)) {
|
|
213
|
+
const subnetStr = gossipTypeStr.slice(GossipType.data_column_sidecar.length + 1); // +1 for '_' concatenating the topic name and the subnet
|
|
214
|
+
const subnet = parseInt(subnetStr, 10);
|
|
215
|
+
if (Number.isNaN(subnet)) throw Error(`subnet ${subnetStr} is not a number`);
|
|
216
|
+
return {type: GossipType.data_column_sidecar, subnet, boundary, encoding};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
throw Error(`Unknown gossip type ${gossipTypeStr}`);
|
|
220
|
+
} catch (e) {
|
|
221
|
+
(e as Error).message = `Invalid gossip topic ${topicStr}: ${(e as Error).message}`;
|
|
222
|
+
throw e;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* De-duplicate logic to pick fork topics between subscribeCoreTopicsAtFork and unsubscribeCoreTopicsAtFork
|
|
228
|
+
*/
|
|
229
|
+
export function getCoreTopicsAtFork(
|
|
230
|
+
networkConfig: NetworkConfig,
|
|
231
|
+
fork: ForkName,
|
|
232
|
+
opts: {subscribeAllSubnets?: boolean; disableLightClientServer?: boolean}
|
|
233
|
+
): GossipTopicTypeMap[keyof GossipTopicTypeMap][] {
|
|
234
|
+
// Common topics for all forks
|
|
235
|
+
const topics: GossipTopicTypeMap[keyof GossipTopicTypeMap][] = [
|
|
236
|
+
{type: GossipType.beacon_block},
|
|
237
|
+
{type: GossipType.beacon_aggregate_and_proof},
|
|
238
|
+
{type: GossipType.voluntary_exit},
|
|
239
|
+
{type: GossipType.proposer_slashing},
|
|
240
|
+
{type: GossipType.attester_slashing},
|
|
241
|
+
];
|
|
242
|
+
|
|
243
|
+
// After fulu also track data_column_sidecar_{index}
|
|
244
|
+
if (ForkSeq[fork] >= ForkSeq.fulu) {
|
|
245
|
+
topics.push(...getDataColumnSidecarTopics(networkConfig));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// After Deneb also track blob_sidecar_{subnet_id}
|
|
249
|
+
if (ForkSeq[fork] >= ForkSeq.deneb) {
|
|
250
|
+
const {config} = networkConfig;
|
|
251
|
+
const subnetCount = isForkPostElectra(fork)
|
|
252
|
+
? config.BLOB_SIDECAR_SUBNET_COUNT_ELECTRA
|
|
253
|
+
: config.BLOB_SIDECAR_SUBNET_COUNT;
|
|
254
|
+
|
|
255
|
+
for (let subnet = 0; subnet < subnetCount; subnet++) {
|
|
256
|
+
topics.push({type: GossipType.blob_sidecar, subnet});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// capella
|
|
261
|
+
if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
262
|
+
topics.push({type: GossipType.bls_to_execution_change});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Any fork after altair included
|
|
266
|
+
if (ForkSeq[fork] >= ForkSeq.altair) {
|
|
267
|
+
topics.push({type: GossipType.sync_committee_contribution_and_proof});
|
|
268
|
+
if (!opts.disableLightClientServer) {
|
|
269
|
+
topics.push({type: GossipType.light_client_optimistic_update});
|
|
270
|
+
topics.push({type: GossipType.light_client_finality_update});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (opts.subscribeAllSubnets) {
|
|
275
|
+
for (let subnet = 0; subnet < ATTESTATION_SUBNET_COUNT; subnet++) {
|
|
276
|
+
topics.push({type: GossipType.beacon_attestation, subnet});
|
|
277
|
+
}
|
|
278
|
+
if (ForkSeq[fork] >= ForkSeq.altair) {
|
|
279
|
+
for (let subnet = 0; subnet < SYNC_COMMITTEE_SUBNET_COUNT; subnet++) {
|
|
280
|
+
topics.push({type: GossipType.sync_committee, subnet});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return topics;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Pick data column subnets to subscribe to post-fulu.
|
|
290
|
+
*/
|
|
291
|
+
export function getDataColumnSidecarTopics(
|
|
292
|
+
networkConfig: NetworkConfig
|
|
293
|
+
): GossipTopicTypeMap[keyof GossipTopicTypeMap][] {
|
|
294
|
+
const topics: GossipTopicTypeMap[keyof GossipTopicTypeMap][] = [];
|
|
295
|
+
|
|
296
|
+
const subnets = networkConfig.custodyConfig.sampledSubnets;
|
|
297
|
+
for (const subnet of subnets) {
|
|
298
|
+
topics.push({type: GossipType.data_column_sidecar, subnet});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return topics;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Validate that a `encodingStr` is a known `GossipEncoding`
|
|
306
|
+
*/
|
|
307
|
+
function parseEncodingStr(encodingStr: string): GossipEncoding {
|
|
308
|
+
switch (encodingStr) {
|
|
309
|
+
case GossipEncoding.ssz_snappy:
|
|
310
|
+
return encodingStr;
|
|
311
|
+
|
|
312
|
+
default:
|
|
313
|
+
throw Error(`Unknown encoding ${encodingStr}`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// TODO: Review which yes, and which not
|
|
318
|
+
export const gossipTopicIgnoreDuplicatePublishError: Record<GossipType, boolean> = {
|
|
319
|
+
[GossipType.beacon_block]: true,
|
|
320
|
+
[GossipType.blob_sidecar]: true,
|
|
321
|
+
[GossipType.data_column_sidecar]: true,
|
|
322
|
+
[GossipType.beacon_aggregate_and_proof]: true,
|
|
323
|
+
[GossipType.beacon_attestation]: true,
|
|
324
|
+
[GossipType.voluntary_exit]: true,
|
|
325
|
+
[GossipType.proposer_slashing]: false, // Why not this ones?
|
|
326
|
+
[GossipType.attester_slashing]: false,
|
|
327
|
+
[GossipType.sync_committee_contribution_and_proof]: true,
|
|
328
|
+
[GossipType.sync_committee]: true,
|
|
329
|
+
[GossipType.light_client_finality_update]: false,
|
|
330
|
+
[GossipType.light_client_optimistic_update]: false,
|
|
331
|
+
[GossipType.bls_to_execution_change]: true,
|
|
332
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./events.js";
|
|
2
|
+
export * from "./gossip/index.js";
|
|
3
|
+
export * from "./interface.js";
|
|
4
|
+
export * from "./libp2p/index.js";
|
|
5
|
+
export * from "./network.js";
|
|
6
|
+
export * from "./peers/index.js";
|
|
7
|
+
export * from "./reqresp/ReqRespBeaconNode.js";
|
|
8
|
+
export * from "./util.js";
|