@lodestar/beacon-node 1.51.0-dev.f8eff664d2 → 1.51.0-dev.f921fbf6b7
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.js +1 -1
- package/lib/api/impl/api.js.map +1 -1
- package/lib/api/impl/beacon/blocks/index.d.ts +2 -1
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +48 -95
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/index.d.ts +2 -1
- package/lib/api/impl/beacon/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/index.js +2 -2
- package/lib/api/impl/beacon/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +22 -2
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +8 -2
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +3 -2
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +17 -9
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +3 -0
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts +6 -0
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +143 -35
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/options.d.ts +2 -0
- package/lib/api/options.d.ts.map +1 -1
- package/lib/api/options.js +1 -0
- package/lib/api/options.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +13 -2
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +69 -35
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +4 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +61 -97
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +11 -56
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +5 -241
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.d.ts +2 -4
- package/lib/chain/blocks/blockInput/errors.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/errors.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +2 -18
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +0 -1
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +42 -57
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -11
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +82 -20
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +4 -4
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +12 -9
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +24 -19
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +7 -19
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +5 -24
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +18 -7
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +14 -2
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +7 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +4 -0
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +10 -5
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +3 -3
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +11 -6
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts +0 -2
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +6 -24
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/bls/interface.d.ts +2 -0
- package/lib/chain/bls/interface.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts +1 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +50 -22
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/types.d.ts +1 -1
- package/lib/chain/bls/multithread/types.d.ts.map +1 -1
- package/lib/chain/bls/multithread/worker.js +1 -1
- package/lib/chain/bls/multithread/worker.js.map +1 -1
- package/lib/chain/bls/singleThread.js +1 -1
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.js +1 -1
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +26 -4
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +127 -43
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +7 -7
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -5
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +1 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +1 -1
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +11 -1
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +2 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +7 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/inclusionList.d.ts +60 -0
- package/lib/chain/errors/inclusionList.d.ts.map +1 -0
- package/lib/chain/errors/inclusionList.js +19 -0
- package/lib/chain/errors/inclusionList.js.map +1 -0
- package/lib/chain/errors/index.d.ts +1 -1
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +1 -1
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +11 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +11 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.d.ts +51 -0
- package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -0
- package/lib/chain/forkChoiceExecutionEngine.js +117 -0
- package/lib/chain/forkChoiceExecutionEngine.js.map +1 -0
- package/lib/chain/interface.d.ts +10 -7
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +17 -4
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +199 -46
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/attestationPool.d.ts +1 -1
- package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/attestationPool.js +15 -4
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/chain/opPools/inclusionListStore.d.ts +63 -0
- package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -0
- package/lib/chain/opPools/inclusionListStore.js +171 -0
- package/lib/chain/opPools/inclusionListStore.js.map +1 -0
- package/lib/chain/opPools/index.d.ts +2 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +2 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js +17 -7
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/opPools/singleAttestationPool.d.ts +77 -0
- package/lib/chain/opPools/singleAttestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/singleAttestationPool.js +209 -0
- package/lib/chain/opPools/singleAttestationPool.js.map +1 -0
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.js +9 -3
- package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.js +11 -3
- package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +1 -1
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +5 -3
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +0 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +6 -3
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +32 -11
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/proposerTracker.d.ts +31 -0
- package/lib/chain/proposerTracker.d.ts.map +1 -0
- package/lib/chain/proposerTracker.js +75 -0
- package/lib/chain/proposerTracker.js.map +1 -0
- package/lib/chain/regen/interface.d.ts +2 -2
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -1
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.d.ts +1 -1
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +5 -3
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -14
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +6 -65
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts +0 -15
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +37 -158
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts +6 -0
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +53 -0
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/inclusionList.d.ts +14 -0
- package/lib/chain/validation/inclusionList.d.ts.map +1 -0
- package/lib/chain/validation/inclusionList.js +150 -0
- package/lib/chain/validation/inclusionList.js.map +1 -0
- package/lib/chain/validation/index.d.ts +1 -0
- package/lib/chain/validation/index.d.ts.map +1 -1
- package/lib/chain/validation/index.js +1 -0
- package/lib/chain/validation/index.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +1 -2
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +0 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/beacon.d.ts +7 -0
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +34 -0
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +1 -1
- package/lib/db/dataColumnStore.d.ts.map +1 -1
- package/lib/db/dataColumnStore.js +1 -4
- package/lib/db/dataColumnStore.js.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.js +5 -5
- package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
- package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -1
- package/lib/db/flatFileStore/slotIndex.js +2 -2
- package/lib/db/flatFileStore/slotIndex.js.map +1 -1
- package/lib/db/interface.d.ts +1 -0
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.d.ts +0 -1
- package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.js +0 -1
- package/lib/db/repositories/blobSidecars.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts +6 -0
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +19 -0
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/execution/builder/apiClient.d.ts +14 -8
- package/lib/execution/builder/apiClient.d.ts.map +1 -1
- package/lib/execution/builder/apiClient.js +12 -10
- package/lib/execution/builder/apiClient.js.map +1 -1
- package/lib/execution/builder/http.d.ts +2 -0
- package/lib/execution/builder/http.d.ts.map +1 -1
- package/lib/execution/builder/http.js +2 -0
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/execution/builder/validateBid.d.ts.map +1 -1
- package/lib/execution/builder/validateBid.js +14 -1
- package/lib/execution/builder/validateBid.js.map +1 -1
- package/lib/execution/engine/blobVersionedHashes.d.ts +1 -1
- package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -1
- package/lib/execution/engine/blobVersionedHashes.js.map +1 -1
- package/lib/execution/engine/disabled.d.ts +1 -0
- package/lib/execution/engine/disabled.d.ts.map +1 -1
- package/lib/execution/engine/disabled.js +3 -0
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +12 -8
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +35 -14
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.d.ts +1 -1
- package/lib/execution/engine/index.d.ts.map +1 -1
- package/lib/execution/engine/index.js +1 -1
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +29 -8
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +5 -6
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +34 -20
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +31 -11
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +5 -3
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js +15 -4
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +4 -5
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +4 -15
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +38 -47
- package/lib/execution/engine/sszTypes.d.ts.map +1 -1
- package/lib/execution/engine/sszTypes.js +0 -5
- package/lib/execution/engine/sszTypes.js.map +1 -1
- package/lib/execution/engine/transport.d.ts +4 -14
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +25 -9
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +19 -14
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts.map +1 -1
- package/lib/execution/engine/utils.js +3 -2
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +16 -9
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +35 -30
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +42 -8
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +104 -18
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/server/http.js +5 -5
- package/lib/metrics/server/http.js.map +1 -1
- package/lib/monitoring/service.js +1 -1
- package/lib/monitoring/service.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +4 -1
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +7 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +2 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +4 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +6 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +6 -1
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +1 -0
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +10 -0
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +8 -9
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +1 -1
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +13 -21
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +13 -24
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +5 -5
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +5 -1
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +9 -7
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +58 -35
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts +2 -0
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +2 -0
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts +2 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +28 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.d.ts +9 -1
- package/lib/network/peers/utils/assertPeerRelevance.d.ts.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.js +32 -21
- package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
- package/lib/network/peers/utils/enrSubnetsDeserialize.d.ts.map +1 -1
- package/lib/network/peers/utils/enrSubnetsDeserialize.js +5 -2
- package/lib/network/peers/utils/enrSubnetsDeserialize.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +4 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +8 -16
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/peers/utils/subnetMap.d.ts +5 -2
- package/lib/network/peers/utils/subnetMap.d.ts.map +1 -1
- package/lib/network/peers/utils/subnetMap.js +6 -3
- package/lib/network/peers/utils/subnetMap.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +1 -8
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +118 -149
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +6 -6
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +5 -5
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts +11 -0
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +66 -30
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +6 -3
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts +10 -0
- package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/inclusionListsByIndices.js +30 -0
- package/lib/network/reqresp/handlers/inclusionListsByIndices.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +6 -12
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +1 -2
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +5 -10
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +5 -17
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +6 -9
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +4 -7
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts +35 -5
- package/lib/network/subnets/attnetsService.d.ts.map +1 -1
- package/lib/network/subnets/attnetsService.js +84 -6
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/network/subnets/interface.d.ts +7 -0
- package/lib/network/subnets/interface.d.ts.map +1 -1
- package/lib/network/subnets/interface.js.map +1 -1
- package/lib/node/nodejs.d.ts +3 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +47 -21
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/options.d.ts +3 -1
- package/lib/node/options.d.ts.map +1 -1
- package/lib/node/options.js +4 -2
- package/lib/node/options.js.map +1 -1
- package/lib/sync/interface.d.ts.map +1 -1
- package/lib/sync/interface.js.map +1 -1
- package/lib/sync/range/batch.d.ts +2 -3
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +9 -22
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +2 -15
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/sync.d.ts +7 -0
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +61 -3
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +43 -25
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +6 -34
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +24 -128
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +2 -18
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +14 -99
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +1 -7
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +0 -19
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/execution.d.ts +3 -4
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +1 -73
- package/lib/util/execution.js.map +1 -1
- package/lib/util/file.d.ts.map +1 -1
- package/lib/util/file.js +8 -9
- package/lib/util/file.js.map +1 -1
- package/lib/util/queue/itemQueue.js +1 -1
- package/lib/util/queue/itemQueue.js.map +1 -1
- package/lib/util/sszBytes.d.ts +5 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +36 -19
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +0 -5
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -2
- package/lib/util/types.js.map +1 -1
- package/package.json +31 -32
- package/src/api/impl/api.ts +1 -1
- package/src/api/impl/beacon/blocks/index.ts +81 -126
- package/src/api/impl/beacon/index.ts +3 -1
- package/src/api/impl/beacon/pool/index.ts +31 -1
- package/src/api/impl/beacon/state/index.ts +10 -1
- package/src/api/impl/beacon/state/utils.ts +20 -10
- package/src/api/impl/debug/index.ts +4 -0
- package/src/api/impl/validator/index.ts +178 -39
- package/src/api/options.ts +3 -0
- package/src/chain/GetBlobsTracker.ts +82 -52
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +76 -130
- package/src/chain/blocks/blockInput/blockInput.ts +11 -343
- package/src/chain/blocks/blockInput/errors.ts +1 -2
- package/src/chain/blocks/blockInput/types.ts +2 -20
- package/src/chain/blocks/importBlock.ts +58 -77
- package/src/chain/blocks/importExecutionPayload.ts +123 -36
- package/src/chain/blocks/index.ts +11 -4
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +35 -24
- package/src/chain/blocks/types.ts +8 -29
- package/src/chain/blocks/verifyBlock.ts +31 -16
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +16 -2
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -6
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +4 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +10 -5
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +14 -6
- package/src/chain/blocks/writeBlockInputToDb.ts +6 -29
- package/src/chain/bls/interface.ts +2 -0
- package/src/chain/bls/multithread/index.ts +48 -24
- package/src/chain/bls/multithread/types.ts +1 -1
- package/src/chain/bls/multithread/worker.ts +1 -5
- package/src/chain/bls/singleThread.ts +1 -1
- package/src/chain/bls/utils.ts +1 -1
- package/src/chain/chain.ts +144 -42
- package/src/chain/emitter.ts +8 -8
- package/src/chain/errors/blockError.ts +1 -1
- package/src/chain/errors/executionPayloadBid.ts +12 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +8 -0
- package/src/chain/errors/inclusionList.ts +38 -0
- package/src/chain/errors/index.ts +1 -1
- package/src/chain/forkChoice/index.ts +11 -0
- package/src/chain/forkChoiceExecutionEngine.ts +183 -0
- package/src/chain/interface.ts +11 -6
- package/src/chain/opPools/aggregatedAttestationPool.ts +246 -43
- package/src/chain/opPools/attestationPool.ts +16 -4
- package/src/chain/opPools/inclusionListStore.ts +208 -0
- package/src/chain/opPools/index.ts +2 -0
- package/src/chain/opPools/payloadAttestationPool.ts +18 -7
- package/src/chain/opPools/singleAttestationPool.ts +287 -0
- package/src/chain/opPools/syncCommitteeMessagePool.ts +10 -3
- package/src/chain/opPools/syncContributionAndProofPool.ts +13 -3
- package/src/chain/opPools/utils.ts +1 -1
- package/src/chain/options.ts +5 -4
- package/src/chain/produceBlock/produceBlockBody.ts +67 -22
- package/src/chain/proposerTracker.ts +94 -0
- package/src/chain/regen/interface.ts +2 -2
- package/src/chain/regen/queued.ts +6 -4
- package/src/chain/seenCache/seenGossipBlockInput.ts +9 -93
- package/src/chain/validation/executionPayloadBid.ts +54 -183
- package/src/chain/validation/executionPayloadEnvelope.ts +68 -1
- package/src/chain/validation/inclusionList.ts +192 -0
- package/src/chain/validation/index.ts +1 -0
- package/src/chain/validatorMonitor.ts +0 -6
- package/src/db/beacon.ts +44 -0
- package/src/db/dataColumnStore.ts +2 -4
- package/src/db/flatFileStore/flatFileStore.ts +7 -7
- package/src/db/flatFileStore/slotIndex.ts +4 -3
- package/src/db/interface.ts +2 -0
- package/src/db/repositories/blobSidecars.ts +0 -1
- package/src/db/repositories/dataColumnSidecarArchive.ts +20 -0
- package/src/execution/builder/apiClient.ts +16 -13
- package/src/execution/builder/http.ts +4 -0
- package/src/execution/builder/validateBid.ts +23 -2
- package/src/execution/engine/blobVersionedHashes.ts +1 -1
- package/src/execution/engine/disabled.ts +4 -0
- package/src/execution/engine/http.ts +59 -47
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +46 -13
- package/src/execution/engine/jsonRpcTransport.ts +56 -31
- package/src/execution/engine/mock.ts +32 -14
- package/src/execution/engine/payloadIdCache.ts +24 -6
- package/src/execution/engine/restTransport.ts +18 -23
- package/src/execution/engine/sszTypes.ts +0 -9
- package/src/execution/engine/transport.ts +13 -17
- package/src/execution/engine/types.ts +44 -24
- package/src/execution/engine/utils.ts +4 -2
- package/src/index.ts +2 -0
- package/src/metrics/metrics/beacon.ts +37 -30
- package/src/metrics/metrics/lodestar.ts +106 -18
- package/src/metrics/server/http.ts +5 -5
- package/src/monitoring/service.ts +1 -1
- package/src/network/core/networkCore.ts +11 -1
- package/src/network/core/networkCoreWorker.ts +2 -0
- package/src/network/core/networkCoreWorkerHandler.ts +8 -1
- package/src/network/core/types.ts +6 -1
- package/src/network/gossip/gossipsub.ts +11 -0
- package/src/network/gossip/interface.ts +5 -5
- package/src/network/gossip/topic.ts +14 -25
- package/src/network/interface.ts +4 -5
- package/src/network/libp2p/index.ts +5 -1
- package/src/network/network.ts +66 -58
- package/src/network/options.ts +4 -0
- package/src/network/peers/peerManager.ts +28 -3
- package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
- package/src/network/peers/utils/enrSubnetsDeserialize.ts +5 -2
- package/src/network/peers/utils/prioritizePeers.ts +14 -22
- package/src/network/peers/utils/subnetMap.ts +6 -3
- package/src/network/processor/extractSlotRootFns.ts +0 -9
- package/src/network/processor/gossipHandlers.ts +150 -183
- package/src/network/processor/gossipQueues/index.ts +6 -6
- package/src/network/processor/gossipValidatorFn.ts +5 -5
- package/src/network/processor/index.ts +58 -28
- package/src/network/processor/types.ts +1 -1
- package/src/network/reqresp/ReqRespBeaconNode.ts +7 -7
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -2
- package/src/network/reqresp/handlers/inclusionListsByIndices.ts +44 -0
- package/src/network/reqresp/handlers/index.ts +5 -17
- package/src/network/reqresp/protocols.ts +6 -12
- package/src/network/reqresp/rateLimit.ts +5 -17
- package/src/network/reqresp/types.ts +6 -13
- package/src/network/subnets/attnetsService.ts +94 -6
- package/src/network/subnets/interface.ts +7 -0
- package/src/node/nodejs.ts +58 -22
- package/src/node/options.ts +9 -6
- package/src/sync/interface.ts +1 -0
- package/src/sync/range/batch.ts +9 -21
- package/src/sync/range/chain.ts +2 -14
- package/src/sync/sync.ts +65 -4
- package/src/sync/unknownBlock.ts +48 -36
- package/src/sync/utils/downloadByRange.ts +31 -230
- package/src/sync/utils/downloadByRoot.ts +15 -142
- package/src/util/blobs.ts +0 -34
- package/src/util/execution.ts +8 -102
- package/src/util/file.ts +8 -9
- package/src/util/queue/itemQueue.ts +1 -1
- package/src/util/sszBytes.ts +42 -24
- package/src/util/types.ts +1 -8
- package/lib/chain/errors/blobSidecarError.d.ts +0 -108
- package/lib/chain/errors/blobSidecarError.d.ts.map +0 -1
- package/lib/chain/errors/blobSidecarError.js +0 -38
- package/lib/chain/errors/blobSidecarError.js.map +0 -1
- package/lib/chain/validation/blobSidecar.d.ts +0 -16
- package/lib/chain/validation/blobSidecar.d.ts.map +0 -1
- package/lib/chain/validation/blobSidecar.js +0 -276
- package/lib/chain/validation/blobSidecar.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +0 -9
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +0 -91
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts +0 -5
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +0 -46
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +0 -1
- package/src/chain/errors/blobSidecarError.ts +0 -70
- package/src/chain/validation/blobSidecar.ts +0 -357
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +0 -133
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +0 -69
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
|
|
2
1
|
import {BitArray} from "@chainsafe/ssz";
|
|
3
2
|
import {BeaconConfig} from "@lodestar/config";
|
|
4
3
|
import {IForkChoice} from "@lodestar/fork-choice";
|
|
4
|
+
import {Signature, aggregateSignatures} from "@lodestar/native/blst";
|
|
5
5
|
import {
|
|
6
6
|
ForkName,
|
|
7
7
|
ForkSeq,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from "@lodestar/params";
|
|
21
21
|
import {
|
|
22
22
|
EffectiveBalanceIncrements,
|
|
23
|
+
G2_POINT_AT_INFINITY,
|
|
23
24
|
IBeaconStateView,
|
|
24
25
|
RootCache,
|
|
25
26
|
computeEpochAtSlot,
|
|
@@ -30,11 +31,12 @@ import {
|
|
|
30
31
|
isStatePostGloas,
|
|
31
32
|
} from "@lodestar/state-transition";
|
|
32
33
|
import {Attestation, Epoch, RootHex, Slot, electra, isElectraAttestation, phase0, ssz} from "@lodestar/types";
|
|
33
|
-
import {Logger, MapDef, assert, toRootHex} from "@lodestar/utils";
|
|
34
|
+
import {Logger, MapDef, assert, byteArrayEquals, toRootHex} from "@lodestar/utils";
|
|
34
35
|
import {Metrics} from "../../metrics/metrics.js";
|
|
35
36
|
import {IntersectResult, intersectUint8Arrays} from "../../util/bitArray.js";
|
|
36
37
|
import {getShufflingDependentRoot} from "../../util/dependentRoot.js";
|
|
37
38
|
import {ShufflingCache} from "../shufflingCache.js";
|
|
39
|
+
import {SingleAttestationPool, SinglesForCommittee} from "./singleAttestationPool.js";
|
|
38
40
|
import {InsertOutcome} from "./types.js";
|
|
39
41
|
import {pruneBySlot, signatureFromBytesNoCheck} from "./utils.js";
|
|
40
42
|
|
|
@@ -48,12 +50,23 @@ type CommitteeIndex = number;
|
|
|
48
50
|
*/
|
|
49
51
|
export type AttestationsConsolidation = {
|
|
50
52
|
byCommittee: Map<CommitteeIndex, AttestationNonParticipant>;
|
|
53
|
+
/**
|
|
54
|
+
* Single attestations of committee members that no aggregate in `byCommittee` covers, a committee may have both.
|
|
55
|
+
* Disjoint from `byCommittee` by construction so the signatures can be aggregated together
|
|
56
|
+
*/
|
|
57
|
+
singlesByCommittee: Map<CommitteeIndex, SinglesForCommittee>;
|
|
51
58
|
attData: phase0.AttestationData;
|
|
52
59
|
totalNewSeenEffectiveBalance: number;
|
|
53
60
|
newSeenAttesters: number;
|
|
54
61
|
notSeenAttesters: number;
|
|
55
62
|
/** total number of attesters across all committees in this consolidation */
|
|
56
63
|
totalAttesters: number;
|
|
64
|
+
/** part of `totalNewSeenEffectiveBalance` contributed by `singlesByCommittee` */
|
|
65
|
+
singlesNewSeenEffectiveBalance: number;
|
|
66
|
+
/** part of `newSeenAttesters` contributed by `singlesByCommittee` */
|
|
67
|
+
singlesNewSeenAttesters: number;
|
|
68
|
+
/** sum of participation flag weights this consolidation earns, set when scoring */
|
|
69
|
+
weight: number;
|
|
57
70
|
};
|
|
58
71
|
|
|
59
72
|
/**
|
|
@@ -109,6 +122,14 @@ const MAX_ATTESTATIONS_PER_GROUP_ELECTRA = Math.min(
|
|
|
109
122
|
MAX_ATTESTATIONS_ELECTRA
|
|
110
123
|
);
|
|
111
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Bounds the single attestation signatures decoded and aggregated synchronously in block production. Without
|
|
127
|
+
* aggregates (e.g. during non-finality) the pool can hold far more uncovered singles than a block needs.
|
|
128
|
+
* The budget is spent in scan order, also by candidates that later miss the top MAX_ATTESTATIONS_ELECTRA
|
|
129
|
+
* As tested on Nov 2026, we never this many not-seen attesters on mainnet.
|
|
130
|
+
*/
|
|
131
|
+
const MAX_SINGLE_ATTESTATIONS_PER_BLOCK = 1024;
|
|
132
|
+
|
|
112
133
|
/** Same to https://github.com/ethereum/consensus-specs/blob/v1.5.0/specs/altair/beacon-chain.md#has_flag */
|
|
113
134
|
const TIMELY_SOURCE = 1 << TIMELY_SOURCE_FLAG_INDEX;
|
|
114
135
|
const TIMELY_TARGET = 1 << TIMELY_TARGET_FLAG_INDEX;
|
|
@@ -212,24 +233,27 @@ export class AggregatedAttestationPool {
|
|
|
212
233
|
fork: ForkName,
|
|
213
234
|
forkChoice: IForkChoice,
|
|
214
235
|
shufflingCache: ShufflingCache,
|
|
215
|
-
state: IBeaconStateView
|
|
236
|
+
state: IBeaconStateView,
|
|
237
|
+
singleAttestationPool: SingleAttestationPool
|
|
216
238
|
): Attestation[] {
|
|
217
239
|
const forkSeq = ForkSeq[fork];
|
|
218
240
|
if (forkSeq < ForkSeq.electra) {
|
|
219
241
|
throw new Error("Does not support producing blocks for pre-electra forks anymore");
|
|
220
242
|
}
|
|
221
243
|
|
|
222
|
-
return this.getAttestationsForBlockElectra(fork, forkChoice, shufflingCache, state);
|
|
244
|
+
return this.getAttestationsForBlockElectra(fork, forkChoice, shufflingCache, state, singleAttestationPool);
|
|
223
245
|
}
|
|
224
246
|
|
|
225
247
|
/**
|
|
226
|
-
* Get attestations to be included in an electra block. Returns up to $MAX_ATTESTATIONS_ELECTRA items
|
|
248
|
+
* Get attestations to be included in an electra block. Returns up to $MAX_ATTESTATIONS_ELECTRA items.
|
|
249
|
+
* Single attestations fill committee members that no picked aggregate covers, see `addSinglesToConsolidation`
|
|
227
250
|
*/
|
|
228
251
|
getAttestationsForBlockElectra(
|
|
229
252
|
fork: ForkName,
|
|
230
253
|
forkChoice: IForkChoice,
|
|
231
254
|
shufflingCache: ShufflingCache,
|
|
232
|
-
state: IBeaconStateView
|
|
255
|
+
state: IBeaconStateView,
|
|
256
|
+
singleAttestationPool: SingleAttestationPool
|
|
233
257
|
): electra.Attestation[] {
|
|
234
258
|
const stateSlot = state.slot;
|
|
235
259
|
const stateEpoch = state.epoch;
|
|
@@ -240,18 +264,27 @@ export class AggregatedAttestationPool {
|
|
|
240
264
|
const notSeenValidatorsFn = getNotSeenValidatorsFn(this.config, shufflingCache, state);
|
|
241
265
|
const validateAttestationDataFn = getValidateAttestationDataFn(forkChoice, state);
|
|
242
266
|
|
|
243
|
-
const slots = Array.from(
|
|
267
|
+
const slots = Array.from(
|
|
268
|
+
new Set([...this.attestationGroupByIndexByDataHexBySlot.keys(), ...singleAttestationPool.getStoredSlots()])
|
|
269
|
+
).sort((a, b) => b - a);
|
|
244
270
|
// Track score of each `AttestationsConsolidation`
|
|
245
271
|
const consolidations = new Map<AttestationsConsolidation, number>();
|
|
272
|
+
let remainingSingles = MAX_SINGLE_ATTESTATIONS_PER_BLOCK;
|
|
246
273
|
let scannedSlots = 0;
|
|
247
274
|
let stopReason: ScannedSlotsTerminationReason | null = null;
|
|
248
275
|
const missingShufflingCommitteesByEpoch = new Map<Epoch, number>();
|
|
276
|
+
// reset so that inclusion distances not scanned for this block do not keep values of a previous block
|
|
277
|
+
this.metrics?.opPool.aggregatedAttestationPool.packedAttestations.returnedAttestations.reset();
|
|
278
|
+
this.metrics?.opPool.aggregatedAttestationPool.packedAttestations.scannedAttestations.reset();
|
|
249
279
|
slot: for (const slot of slots) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
280
|
+
// a slot may only have single attestations, e.g. votes for a minority head that nobody aggregated
|
|
281
|
+
const attestationGroupByIndexByDataHash =
|
|
282
|
+
this.attestationGroupByIndexByDataHexBySlot.get(slot) ??
|
|
283
|
+
new Map<DataRootHex, Map<CommitteeIndex, MatchingDataAttestationGroup>>();
|
|
284
|
+
const singlesDataBySlot =
|
|
285
|
+
remainingSingles > 0
|
|
286
|
+
? singleAttestationPool.getDataRoots(slot)
|
|
287
|
+
: new Map<DataRootHex, phase0.AttestationData>();
|
|
255
288
|
|
|
256
289
|
const epoch = computeEpochAtSlot(slot);
|
|
257
290
|
if (epoch < statePrevEpoch) {
|
|
@@ -278,16 +311,22 @@ export class AggregatedAttestationPool {
|
|
|
278
311
|
// Attestations att00 --- att10 --- att20 --- 0 (att 00 10 20)
|
|
279
312
|
// att01 --- - --- att21 --- 1 (att 01 __ 21)
|
|
280
313
|
// - --- - --- att22 --- 2 (att __ __ 22)
|
|
281
|
-
|
|
314
|
+
const dataRootHexes = new Set([...attestationGroupByIndexByDataHash.keys(), ...singlesDataBySlot.keys()]);
|
|
315
|
+
for (const dataRootHex of dataRootHexes) {
|
|
316
|
+
if (remainingSingles === 0 && !attestationGroupByIndexByDataHash.has(dataRootHex)) {
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
const attestationGroupByIndex =
|
|
320
|
+
attestationGroupByIndexByDataHash.get(dataRootHex) ?? new Map<CommitteeIndex, MatchingDataAttestationGroup>();
|
|
282
321
|
// sameAttDataCons could be up to MAX_ATTESTATIONS_PER_GROUP_ELECTRA
|
|
283
322
|
const sameAttDataCons: AttestationsConsolidation[] = [];
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
323
|
+
const attData = attestationGroupByIndex.values().next().value?.data ?? singlesDataBySlot.get(dataRootHex);
|
|
324
|
+
if (attData === undefined) {
|
|
286
325
|
this.metrics?.opPool.aggregatedAttestationPool.packedAttestations.emptyAttestationData.inc();
|
|
287
326
|
continue;
|
|
288
327
|
}
|
|
289
328
|
|
|
290
|
-
const invalidAttDataReason = validateAttestationDataFn(
|
|
329
|
+
const invalidAttDataReason = validateAttestationDataFn(attData);
|
|
291
330
|
if (invalidAttDataReason !== null) {
|
|
292
331
|
this.metrics?.opPool.aggregatedAttestationPool.packedAttestations.invalidAttestationData.inc({
|
|
293
332
|
reason: invalidAttDataReason,
|
|
@@ -295,6 +334,8 @@ export class AggregatedAttestationPool {
|
|
|
295
334
|
continue;
|
|
296
335
|
}
|
|
297
336
|
|
|
337
|
+
// committee members not on chain and not covered by any picked aggregate, owned by this loop
|
|
338
|
+
const remainingNotSeenByCommittee = new Map<CommitteeIndex, Set<number>>();
|
|
298
339
|
for (const [committeeIndex, attestationGroup] of attestationGroupByIndex.entries()) {
|
|
299
340
|
const notSeenCommitteeMembers = notSeenValidatorsFn(epoch, slot, committeeIndex);
|
|
300
341
|
if (notSeenCommitteeMembers === null) {
|
|
@@ -326,18 +367,16 @@ export class AggregatedAttestationPool {
|
|
|
326
367
|
const attestationsSameGroup = getAttestationGroupResult.result;
|
|
327
368
|
returnedAttestationsPerSlot += attestationsSameGroup.length;
|
|
328
369
|
totalAttestationsPerSlot += getAttestationGroupResult.totalAttestations;
|
|
370
|
+
// notSeenCommitteeMembers of the last pick are the ones no pick covers, it's a new Set (not the cached one)
|
|
371
|
+
remainingNotSeenByCommittee.set(
|
|
372
|
+
committeeIndex,
|
|
373
|
+
attestationsSameGroup.at(-1)?.notSeenCommitteeMembers ?? notSeenCommitteeMembers
|
|
374
|
+
);
|
|
329
375
|
|
|
330
376
|
for (const [i, attestationNonParticipation] of attestationsSameGroup.entries()) {
|
|
331
377
|
// sameAttDataCons shares the same index for different committees so we use index `i` here
|
|
332
378
|
if (sameAttDataCons[i] === undefined) {
|
|
333
|
-
sameAttDataCons[i] =
|
|
334
|
-
byCommittee: new Map(),
|
|
335
|
-
attData: attestationNonParticipation.attestation.data,
|
|
336
|
-
totalNewSeenEffectiveBalance: 0,
|
|
337
|
-
newSeenAttesters: 0,
|
|
338
|
-
notSeenAttesters: 0,
|
|
339
|
-
totalAttesters: 0,
|
|
340
|
-
};
|
|
379
|
+
sameAttDataCons[i] = newConsolidation(attestationNonParticipation.attestation.data);
|
|
341
380
|
}
|
|
342
381
|
const sameAttDataCon = sameAttDataCons[i];
|
|
343
382
|
// committeeIndex was from a map so it should be unique, but just in case
|
|
@@ -351,6 +390,34 @@ export class AggregatedAttestationPool {
|
|
|
351
390
|
}
|
|
352
391
|
} // all committees are processed
|
|
353
392
|
|
|
393
|
+
for (const committeeIndex of singleAttestationPool.getCommitteeIndices(slot, dataRootHex)) {
|
|
394
|
+
if (remainingSingles === 0) {
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
// a committee with no aggregate for this data starts from on chain participation (cached set, read only)
|
|
398
|
+
const notSeenCommitteeMembers =
|
|
399
|
+
remainingNotSeenByCommittee.get(committeeIndex) ?? notSeenValidatorsFn(epoch, slot, committeeIndex);
|
|
400
|
+
if (notSeenCommitteeMembers === null || notSeenCommitteeMembers.size === 0) {
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const singles = singleAttestationPool.getUncovered(
|
|
405
|
+
slot,
|
|
406
|
+
dataRootHex,
|
|
407
|
+
committeeIndex,
|
|
408
|
+
notSeenCommitteeMembers,
|
|
409
|
+
state.effectiveBalanceIncrements,
|
|
410
|
+
remainingSingles
|
|
411
|
+
);
|
|
412
|
+
if (singles !== null) {
|
|
413
|
+
// the first consolidation holds the best aggregate of every committee, adding singles to it costs no
|
|
414
|
+
// extra attestation in the block. It's created if this data has no aggregate at all
|
|
415
|
+
sameAttDataCons[0] ??= newConsolidation(attData);
|
|
416
|
+
addSinglesToConsolidation(sameAttDataCons[0], committeeIndex, singles, notSeenCommitteeMembers.size);
|
|
417
|
+
remainingSingles -= singles.newSeenAttesters;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
354
421
|
this.metrics?.opPool.aggregatedAttestationPool.packedAttestations.returnedAttestations.set(
|
|
355
422
|
{inclusionDistance},
|
|
356
423
|
returnedAttestationsPerSlot
|
|
@@ -373,16 +440,16 @@ export class AggregatedAttestationPool {
|
|
|
373
440
|
gloasState?.latestBlockHeader.slot ?? null
|
|
374
441
|
);
|
|
375
442
|
|
|
376
|
-
|
|
443
|
+
consolidation.weight =
|
|
377
444
|
((flags & TIMELY_SOURCE) === TIMELY_SOURCE ? TIMELY_SOURCE_WEIGHT : 0) +
|
|
378
445
|
((flags & TIMELY_TARGET) === TIMELY_TARGET ? TIMELY_TARGET_WEIGHT : 0) +
|
|
379
446
|
((flags & TIMELY_HEAD) === TIMELY_HEAD ? TIMELY_HEAD_WEIGHT : 0);
|
|
380
447
|
|
|
381
|
-
const score = consolidation.totalNewSeenEffectiveBalance * weight;
|
|
448
|
+
const score = consolidation.totalNewSeenEffectiveBalance * consolidation.weight;
|
|
382
449
|
|
|
383
450
|
consolidations.set(consolidation, score);
|
|
384
|
-
//
|
|
385
|
-
if (consolidations.size >= MAX_ATTESTATIONS_ELECTRA *
|
|
451
|
+
// bound the max consolidation candidates, does not likely happen on mainnet through
|
|
452
|
+
if (consolidations.size >= MAX_ATTESTATIONS_ELECTRA * 4) {
|
|
386
453
|
stopReason = ScannedSlotsTerminationReason.MaxConsolidationReached;
|
|
387
454
|
break slot;
|
|
388
455
|
}
|
|
@@ -409,27 +476,104 @@ export class AggregatedAttestationPool {
|
|
|
409
476
|
|
|
410
477
|
const sortedConsolidationsByScore = Array.from(consolidations.entries())
|
|
411
478
|
.sort((a, b) => b[1] - a[1])
|
|
412
|
-
.map(([consolidation, _]) => consolidation)
|
|
413
|
-
.slice(0, MAX_ATTESTATIONS_ELECTRA);
|
|
479
|
+
.map(([consolidation, _]) => consolidation);
|
|
414
480
|
|
|
415
481
|
// on chain aggregation is expensive, only do it after all
|
|
416
482
|
const packedAttestationsMetrics = this.metrics?.opPool.aggregatedAttestationPool.packedAttestations;
|
|
417
|
-
const packedAttestations: electra.Attestation[] =
|
|
418
|
-
|
|
419
|
-
|
|
483
|
+
const packedAttestations: electra.Attestation[] = [];
|
|
484
|
+
const packedConsolidations: AttestationsConsolidation[] = [];
|
|
485
|
+
// reset so that indexes beyond the packed attestations of this block do not keep values of a previous block
|
|
486
|
+
packedAttestationsMetrics?.committeeCount.reset();
|
|
487
|
+
packedAttestationsMetrics?.totalAttesters.reset();
|
|
488
|
+
packedAttestationsMetrics?.nonParticipation.reset();
|
|
489
|
+
packedAttestationsMetrics?.inclusionDistance.reset();
|
|
490
|
+
packedAttestationsMetrics?.newSeenAttesters.reset();
|
|
491
|
+
packedAttestationsMetrics?.totalEffectiveBalance.reset();
|
|
492
|
+
for (const consolidation of sortedConsolidationsByScore) {
|
|
493
|
+
if (packedAttestations.length >= MAX_ATTESTATIONS_ELECTRA) {
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const attestation = aggregateConsolidation(consolidation);
|
|
498
|
+
const committeeCount = attestation.committeeBits.getTrueBitIndexes().length;
|
|
499
|
+
// The point at infinity is not a valid aggregate signature, exclude it from the block
|
|
500
|
+
if (byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY)) {
|
|
501
|
+
this.logger?.debug("Excluding aggregate with infinity signature", {
|
|
502
|
+
slot: stateSlot,
|
|
503
|
+
attestationSlot: attestation.data.slot,
|
|
504
|
+
committees: committeeCount,
|
|
505
|
+
});
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const i = packedAttestations.push(attestation) - 1;
|
|
510
|
+
packedConsolidations.push(consolidation);
|
|
420
511
|
|
|
421
512
|
// record metrics of packed attestations
|
|
422
|
-
packedAttestationsMetrics?.committeeCount.set({index: i},
|
|
513
|
+
packedAttestationsMetrics?.committeeCount.set({index: i}, committeeCount);
|
|
423
514
|
packedAttestationsMetrics?.totalAttesters.set({index: i}, consolidation.totalAttesters);
|
|
424
515
|
packedAttestationsMetrics?.nonParticipation.set({index: i}, consolidation.notSeenAttesters);
|
|
425
|
-
packedAttestationsMetrics?.inclusionDistance.set({index: i}, stateSlot -
|
|
516
|
+
packedAttestationsMetrics?.inclusionDistance.set({index: i}, stateSlot - attestation.data.slot);
|
|
426
517
|
packedAttestationsMetrics?.newSeenAttesters.set({index: i}, consolidation.newSeenAttesters);
|
|
427
518
|
packedAttestationsMetrics?.totalEffectiveBalance.set({index: i}, consolidation.totalNewSeenEffectiveBalance);
|
|
428
519
|
}
|
|
429
520
|
|
|
521
|
+
// value is proportional to the proposer reward of the attestations, singles are disjoint from aggregates
|
|
522
|
+
// so their part is exactly what they add on top of an aggregates only block
|
|
523
|
+
let totalValue = 0;
|
|
524
|
+
let singlesValue = 0;
|
|
525
|
+
let newSeenAttesters = 0;
|
|
526
|
+
let singlesNewSeenAttesters = 0;
|
|
527
|
+
let singlesNewSeenEffectiveBalance = 0;
|
|
528
|
+
let singlesOnlyConsolidations = 0;
|
|
529
|
+
let singlesCommittees = 0;
|
|
530
|
+
const singlesNewSeenAttestersByInclusionDistance = new Map<number, number>();
|
|
531
|
+
for (const consolidation of packedConsolidations) {
|
|
532
|
+
totalValue += consolidation.totalNewSeenEffectiveBalance * consolidation.weight;
|
|
533
|
+
singlesValue += consolidation.singlesNewSeenEffectiveBalance * consolidation.weight;
|
|
534
|
+
newSeenAttesters += consolidation.newSeenAttesters;
|
|
535
|
+
singlesNewSeenAttesters += consolidation.singlesNewSeenAttesters;
|
|
536
|
+
if (consolidation.singlesNewSeenAttesters > 0) {
|
|
537
|
+
const inclusionDistance = stateSlot - consolidation.attData.slot;
|
|
538
|
+
singlesNewSeenAttestersByInclusionDistance.set(
|
|
539
|
+
inclusionDistance,
|
|
540
|
+
(singlesNewSeenAttestersByInclusionDistance.get(inclusionDistance) ?? 0) +
|
|
541
|
+
consolidation.singlesNewSeenAttesters
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
singlesNewSeenEffectiveBalance += consolidation.singlesNewSeenEffectiveBalance;
|
|
545
|
+
singlesCommittees += consolidation.singlesByCommittee.size;
|
|
546
|
+
if (consolidation.byCommittee.size === 0) {
|
|
547
|
+
singlesOnlyConsolidations++;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
packedAttestationsMetrics?.attestationValue.inc({source: "aggregate"}, totalValue - singlesValue);
|
|
551
|
+
packedAttestationsMetrics?.attestationValue.inc({source: "single"}, singlesValue);
|
|
552
|
+
packedAttestationsMetrics?.blockNewSeenAttesters.set(newSeenAttesters);
|
|
553
|
+
packedAttestationsMetrics?.singlesValueRatio.observe(totalValue > 0 ? singlesValue / totalValue : 0);
|
|
554
|
+
packedAttestationsMetrics?.singlesNewSeenAttesters.observe(singlesNewSeenAttesters);
|
|
555
|
+
// reset so that distances of a previous block do not keep stale values, the gauge then sums to the last block
|
|
556
|
+
packedAttestationsMetrics?.singlesNewSeenAttestersByInclusionDistance.reset();
|
|
557
|
+
for (const [inclusionDistance, count] of singlesNewSeenAttestersByInclusionDistance) {
|
|
558
|
+
packedAttestationsMetrics?.singlesNewSeenAttestersByInclusionDistance.set({inclusionDistance}, count);
|
|
559
|
+
}
|
|
560
|
+
packedAttestationsMetrics?.singlesNewSeenEffectiveBalance.observe(singlesNewSeenEffectiveBalance);
|
|
561
|
+
packedAttestationsMetrics?.singlesOnlyConsolidations.observe(singlesOnlyConsolidations);
|
|
562
|
+
packedAttestationsMetrics?.singlesFoldedCommittees.observe(singlesCommittees);
|
|
563
|
+
this.logger?.debug("Packed single attestations into block", {
|
|
564
|
+
slot: stateSlot,
|
|
565
|
+
singlesNewSeenAttesters,
|
|
566
|
+
singlesNewSeenEffectiveBalance,
|
|
567
|
+
singlesCommittees,
|
|
568
|
+
singlesOnlyConsolidations,
|
|
569
|
+
packedAttestations: packedAttestations.length,
|
|
570
|
+
});
|
|
571
|
+
|
|
430
572
|
if (stopReason === null) {
|
|
431
573
|
stopReason = ScannedSlotsTerminationReason.ScannedAllSlots;
|
|
432
574
|
}
|
|
575
|
+
// only one reason per block, reset so that other reasons do not keep values of a previous block
|
|
576
|
+
packedAttestationsMetrics?.scannedSlots.reset();
|
|
433
577
|
packedAttestationsMetrics?.scannedSlots.set({reason: stopReason}, scannedSlots);
|
|
434
578
|
packedAttestationsMetrics?.poolSlots.set(slots.length);
|
|
435
579
|
|
|
@@ -462,7 +606,8 @@ export class AggregatedAttestationPool {
|
|
|
462
606
|
attestations.push(...attestationGroup.getAttestations());
|
|
463
607
|
}
|
|
464
608
|
}
|
|
465
|
-
|
|
609
|
+
// The point at infinity is not a valid aggregate signature, do not serve such an aggregate
|
|
610
|
+
return attestations.filter((attestation) => !byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY));
|
|
466
611
|
}
|
|
467
612
|
|
|
468
613
|
private onScrapeMetrics(metrics: Metrics): void {
|
|
@@ -729,20 +874,38 @@ export function aggregateInto(attestation1: AttestationWithIndex, attestation2:
|
|
|
729
874
|
* attestation data from different committee into a single attestation
|
|
730
875
|
* https://github.com/ethereum/consensus-specs/blob/aba6345776aa876dad368cab27fbbb23fae20455/specs/_features/eip7549/validator.md?plain=1#L39
|
|
731
876
|
*/
|
|
732
|
-
export function aggregateConsolidation({
|
|
877
|
+
export function aggregateConsolidation({
|
|
878
|
+
byCommittee,
|
|
879
|
+
singlesByCommittee,
|
|
880
|
+
attData,
|
|
881
|
+
}: AttestationsConsolidation): electra.Attestation {
|
|
733
882
|
const committeeBits = BitArray.fromBitLen(MAX_COMMITTEES_PER_SLOT);
|
|
734
883
|
// TODO: can we improve this?
|
|
735
884
|
let aggregationBits: boolean[] = [];
|
|
736
885
|
const signatures: Signature[] = [];
|
|
737
|
-
const sortedCommittees = Array.from(byCommittee.keys()).sort(
|
|
886
|
+
const sortedCommittees = Array.from(new Set([...byCommittee.keys(), ...singlesByCommittee.keys()])).sort(
|
|
887
|
+
(a, b) => a - b
|
|
888
|
+
);
|
|
738
889
|
for (const committeeIndex of sortedCommittees) {
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
890
|
+
const attestation = byCommittee.get(committeeIndex)?.attestation;
|
|
891
|
+
const singles = singlesByCommittee.get(committeeIndex);
|
|
892
|
+
let committeeAggregationBits: boolean[];
|
|
893
|
+
if (attestation !== undefined) {
|
|
894
|
+
committeeAggregationBits = attestation.aggregationBits.toBoolArray();
|
|
744
895
|
signatures.push(signatureFromBytesNoCheck(attestation.signature));
|
|
896
|
+
} else if (singles !== undefined) {
|
|
897
|
+
committeeAggregationBits = new Array<boolean>(singles.committeeSize).fill(false);
|
|
898
|
+
} else {
|
|
899
|
+
continue;
|
|
745
900
|
}
|
|
901
|
+
|
|
902
|
+
// singles are disjoint from the aggregate of the same committee, see addSinglesToConsolidation
|
|
903
|
+
for (const {validatorCommitteeIndex, single} of singles?.singles ?? []) {
|
|
904
|
+
committeeAggregationBits[validatorCommitteeIndex] = true;
|
|
905
|
+
signatures.push(signatureFromBytesNoCheck(single.signature));
|
|
906
|
+
}
|
|
907
|
+
committeeBits.set(committeeIndex, true);
|
|
908
|
+
aggregationBits = [...aggregationBits, ...committeeAggregationBits];
|
|
746
909
|
}
|
|
747
910
|
return {
|
|
748
911
|
aggregationBits: BitArray.fromBoolArray(aggregationBits),
|
|
@@ -752,6 +915,46 @@ export function aggregateConsolidation({byCommittee, attData}: AttestationsConso
|
|
|
752
915
|
};
|
|
753
916
|
}
|
|
754
917
|
|
|
918
|
+
function newConsolidation(attData: phase0.AttestationData): AttestationsConsolidation {
|
|
919
|
+
return {
|
|
920
|
+
byCommittee: new Map(),
|
|
921
|
+
singlesByCommittee: new Map(),
|
|
922
|
+
attData,
|
|
923
|
+
totalNewSeenEffectiveBalance: 0,
|
|
924
|
+
newSeenAttesters: 0,
|
|
925
|
+
notSeenAttesters: 0,
|
|
926
|
+
totalAttesters: 0,
|
|
927
|
+
singlesNewSeenEffectiveBalance: 0,
|
|
928
|
+
singlesNewSeenAttesters: 0,
|
|
929
|
+
weight: 0,
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* Add single attestations of committee members that no picked aggregate covers. They are disjoint from every picked
|
|
935
|
+
* aggregate of the same committee, so their signatures can be aggregated with the committee's aggregate.
|
|
936
|
+
* @param notSeenCommitteeMembersCount committee members still not seen before adding these singles
|
|
937
|
+
*/
|
|
938
|
+
function addSinglesToConsolidation(
|
|
939
|
+
consolidation: AttestationsConsolidation,
|
|
940
|
+
committeeIndex: CommitteeIndex,
|
|
941
|
+
singles: SinglesForCommittee,
|
|
942
|
+
notSeenCommitteeMembersCount: number
|
|
943
|
+
): void {
|
|
944
|
+
consolidation.singlesByCommittee.set(committeeIndex, singles);
|
|
945
|
+
consolidation.totalNewSeenEffectiveBalance += singles.newSeenEffectiveBalance;
|
|
946
|
+
consolidation.newSeenAttesters += singles.newSeenAttesters;
|
|
947
|
+
consolidation.singlesNewSeenEffectiveBalance += singles.newSeenEffectiveBalance;
|
|
948
|
+
consolidation.singlesNewSeenAttesters += singles.newSeenAttesters;
|
|
949
|
+
if (consolidation.byCommittee.has(committeeIndex)) {
|
|
950
|
+
// these members were counted as not seen by the aggregate of this committee
|
|
951
|
+
consolidation.notSeenAttesters -= singles.newSeenAttesters;
|
|
952
|
+
} else {
|
|
953
|
+
consolidation.totalAttesters += singles.committeeSize;
|
|
954
|
+
consolidation.notSeenAttesters += notSeenCommitteeMembersCount - singles.newSeenAttesters;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
|
|
755
958
|
/**
|
|
756
959
|
* Pre-compute participation from a IBeaconStateView, for use to check if an attestation's committee
|
|
757
960
|
* has already attested or not.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
|
|
2
1
|
import {BitArray} from "@chainsafe/ssz";
|
|
3
2
|
import {ChainForkConfig} from "@lodestar/config";
|
|
3
|
+
import {Signature, aggregateSignatures} from "@lodestar/native/blst";
|
|
4
4
|
import {MAX_COMMITTEES_PER_SLOT, isForkPostElectra} from "@lodestar/params";
|
|
5
|
+
import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition";
|
|
5
6
|
import {Attestation, RootHex, SingleAttestation, Slot, isElectraSingleAttestation} from "@lodestar/types";
|
|
6
|
-
import {MapDef, assert} from "@lodestar/utils";
|
|
7
|
+
import {MapDef, assert, byteArrayEquals} from "@lodestar/utils";
|
|
7
8
|
import {Metrics} from "../../metrics/metrics.js";
|
|
8
9
|
import {IClock} from "../../util/clock.js";
|
|
9
10
|
import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js";
|
|
@@ -180,7 +181,13 @@ export class AttestationPool {
|
|
|
180
181
|
assert.true(!isElectraAggregate(aggregate), "Aggregate should be type AggregateFastPhase0");
|
|
181
182
|
}
|
|
182
183
|
|
|
183
|
-
|
|
184
|
+
const attestation = fastToAttestation(aggregate);
|
|
185
|
+
// The point at infinity is not a valid aggregate signature, do not serve such an aggregate
|
|
186
|
+
if (byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY)) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return attestation;
|
|
184
191
|
}
|
|
185
192
|
|
|
186
193
|
/**
|
|
@@ -209,7 +216,12 @@ export class AttestationPool {
|
|
|
209
216
|
if (aggregateByRoot) {
|
|
210
217
|
for (const aggFastByIndex of aggregateByRoot.values()) {
|
|
211
218
|
for (const aggFast of aggFastByIndex.values()) {
|
|
212
|
-
|
|
219
|
+
const attestation = fastToAttestation(aggFast);
|
|
220
|
+
// The point at infinity is not a valid aggregate signature, do not serve such an aggregate
|
|
221
|
+
if (byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY)) {
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
attestations.push(attestation);
|
|
213
225
|
}
|
|
214
226
|
}
|
|
215
227
|
}
|