@lodestar/beacon-node 1.51.0-dev.c99cf49add → 1.51.0-dev.e1237a8b1d
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 +29 -34
- 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 +5 -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.map +1 -1
- package/lib/api/impl/validator/index.js +105 -10
- 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/ColumnReconstructionTracker.d.ts +11 -11
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +46 -40
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +11 -0
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +85 -27
- 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/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +9 -7
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +4 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +57 -4
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.js +2 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +5 -5
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +7 -7
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +4 -0
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +5 -0
- 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 +1 -1
- 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 +8 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.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 +13 -6
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
- package/lib/chain/bls/multithread/index.js +5 -5
- 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 +3 -2
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +9 -5
- package/lib/chain/chain.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/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 -0
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +1 -0
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/interface.d.ts +4 -4
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +23 -10
- 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 +1 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +1 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/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/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 +0 -1
- 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 +3 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +30 -10
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +1 -1
- 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/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/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/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/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/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 +8 -2
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +27 -4
- 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 +12 -3
- 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 +3 -2
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +33 -9
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +1 -0
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +31 -7
- 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 +2 -1
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +3 -0
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +38 -38
- package/lib/execution/engine/transport.d.ts +5 -2
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +25 -1
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +19 -6
- package/lib/execution/engine/types.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 -0
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +35 -0
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +22 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +54 -0
- package/lib/metrics/metrics/lodestar.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 +2 -0
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +3 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +1 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +2 -0
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +3 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +2 -0
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/gossip/interface.d.ts +8 -2
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +1 -0
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +13 -5
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +13 -1
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +4 -1
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +4 -1
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +11 -1
- package/lib/network/network.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.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/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +73 -24
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +6 -0
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +5 -1
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts +5 -0
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +37 -26
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +6 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.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 +5 -0
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +1 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +5 -0
- 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 +4 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +5 -2
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +3 -0
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +10 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/options.d.ts +1 -1
- package/lib/node/options.d.ts.map +1 -1
- package/lib/node/options.js +1 -1
- 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/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 +42 -18
- package/lib/sync/unknownBlock.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.js +2 -2
- package/lib/util/sszBytes.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 +57 -62
- package/src/api/impl/beacon/index.ts +3 -1
- package/src/api/impl/beacon/pool/index.ts +5 -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 +135 -10
- package/src/api/options.ts +3 -0
- package/src/chain/ColumnReconstructionTracker.ts +60 -41
- package/src/chain/GetBlobsTracker.ts +97 -38
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +76 -130
- package/src/chain/blocks/importBlock.ts +11 -14
- package/src/chain/blocks/importExecutionPayload.ts +80 -4
- package/src/chain/blocks/index.ts +6 -2
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +7 -7
- package/src/chain/blocks/types.ts +5 -0
- package/src/chain/blocks/verifyBlock.ts +1 -0
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +10 -1
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +16 -6
- package/src/chain/bls/multithread/index.ts +5 -5
- 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 +10 -5
- package/src/chain/errors/blockError.ts +1 -1
- package/src/chain/errors/executionPayloadBid.ts +12 -0
- package/src/chain/errors/inclusionList.ts +38 -0
- package/src/chain/errors/index.ts +1 -0
- package/src/chain/interface.ts +4 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +25 -9
- package/src/chain/opPools/attestationPool.ts +16 -4
- package/src/chain/opPools/inclusionListStore.ts +208 -0
- package/src/chain/opPools/index.ts +1 -0
- package/src/chain/opPools/payloadAttestationPool.ts +18 -7
- 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 +0 -2
- package/src/chain/produceBlock/produceBlockBody.ts +60 -19
- package/src/chain/regen/interface.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +54 -183
- package/src/chain/validation/inclusionList.ts +192 -0
- package/src/chain/validation/index.ts +1 -0
- 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/dataColumnSidecarArchive.ts +20 -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 +40 -5
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +28 -4
- package/src/execution/engine/jsonRpcTransport.ts +46 -9
- package/src/execution/engine/mock.ts +32 -7
- package/src/execution/engine/payloadIdCache.ts +24 -6
- package/src/execution/engine/restTransport.ts +15 -1
- package/src/execution/engine/transport.ts +7 -2
- package/src/execution/engine/types.ts +44 -7
- package/src/index.ts +2 -0
- package/src/metrics/metrics/beacon.ts +37 -0
- package/src/metrics/metrics/lodestar.ts +56 -0
- package/src/monitoring/service.ts +1 -1
- package/src/network/core/networkCore.ts +5 -0
- package/src/network/core/networkCoreWorker.ts +1 -0
- package/src/network/core/networkCoreWorkerHandler.ts +4 -0
- package/src/network/core/types.ts +2 -0
- package/src/network/gossip/interface.ts +5 -0
- package/src/network/gossip/topic.ts +14 -0
- package/src/network/interface.ts +4 -0
- package/src/network/network.ts +19 -1
- package/src/network/peers/peerManager.ts +1 -1
- package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
- package/src/network/peers/utils/enrSubnetsDeserialize.ts +5 -2
- package/src/network/processor/gossipHandlers.ts +93 -26
- package/src/network/processor/gossipQueues/index.ts +6 -0
- package/src/network/processor/gossipValidatorFn.ts +5 -0
- package/src/network/processor/index.ts +33 -24
- package/src/network/processor/types.ts +1 -1
- package/src/network/reqresp/ReqRespBeaconNode.ts +7 -0
- package/src/network/reqresp/handlers/inclusionListsByIndices.ts +44 -0
- package/src/network/reqresp/handlers/index.ts +5 -0
- package/src/network/reqresp/protocols.ts +6 -0
- package/src/network/reqresp/rateLimit.ts +4 -0
- package/src/network/reqresp/types.ts +6 -0
- package/src/node/nodejs.ts +24 -7
- package/src/node/options.ts +4 -5
- package/src/sync/interface.ts +1 -0
- package/src/sync/sync.ts +65 -4
- package/src/sync/unknownBlock.ts +47 -28
- package/src/util/file.ts +8 -9
- package/src/util/queue/itemQueue.ts +1 -1
- package/src/util/sszBytes.ts +2 -2
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.51.0-dev.
|
|
14
|
+
"version": "1.51.0-dev.e1237a8b1d",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -105,39 +105,39 @@
|
|
|
105
105
|
"@chainsafe/enr": "^6.0.2",
|
|
106
106
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
107
107
|
"@chainsafe/libp2p-quic": "^2.1.5",
|
|
108
|
-
"@chainsafe/lodestar-z": "catalog:",
|
|
109
108
|
"@chainsafe/persistent-merkle-tree": "^1.3.1",
|
|
110
109
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
111
110
|
"@chainsafe/snappy-wasm": "^0.5.2",
|
|
112
|
-
"@chainsafe/ssz": "^1.
|
|
111
|
+
"@chainsafe/ssz": "^1.9.0",
|
|
113
112
|
"@chainsafe/threads": "^1.11.3",
|
|
114
113
|
"@crate-crypto/node-eth-kzg": "0.9.1",
|
|
115
114
|
"@fastify/bearer-auth": "^10.0.1",
|
|
116
115
|
"@fastify/cors": "^10.0.1",
|
|
117
116
|
"@fastify/swagger": "^9.0.0",
|
|
118
117
|
"@fastify/swagger-ui": "^5.0.1",
|
|
119
|
-
"@libp2p/bootstrap": "^12.0.
|
|
120
|
-
"@libp2p/crypto": "^5.1.
|
|
121
|
-
"@libp2p/gossipsub": "^17.1.
|
|
122
|
-
"@libp2p/identify": "^4.1.
|
|
123
|
-
"@libp2p/interface": "^3.
|
|
124
|
-
"@libp2p/mdns": "^12.0.
|
|
125
|
-
"@libp2p/mplex": "^12.0.
|
|
126
|
-
"@libp2p/peer-id": "^6.0.
|
|
127
|
-
"@libp2p/prometheus-metrics": "^5.0.
|
|
128
|
-
"@libp2p/tcp": "^11.0.
|
|
129
|
-
"@libp2p/utils": "^7.4.
|
|
130
|
-
"@lodestar/api": "^1.51.0-dev.
|
|
131
|
-
"@lodestar/config": "^1.51.0-dev.
|
|
132
|
-
"@lodestar/db": "^1.51.0-dev.
|
|
133
|
-
"@lodestar/fork-choice": "^1.51.0-dev.
|
|
134
|
-
"@lodestar/logger": "^1.51.0-dev.
|
|
135
|
-
"@lodestar/
|
|
136
|
-
"@lodestar/
|
|
137
|
-
"@lodestar/
|
|
138
|
-
"@lodestar/
|
|
139
|
-
"@lodestar/
|
|
140
|
-
"@lodestar/
|
|
118
|
+
"@libp2p/bootstrap": "^12.0.34",
|
|
119
|
+
"@libp2p/crypto": "^5.1.25",
|
|
120
|
+
"@libp2p/gossipsub": "^17.1.4",
|
|
121
|
+
"@libp2p/identify": "^4.1.16",
|
|
122
|
+
"@libp2p/interface": "^3.4.0",
|
|
123
|
+
"@libp2p/mdns": "^12.0.34",
|
|
124
|
+
"@libp2p/mplex": "^12.0.34",
|
|
125
|
+
"@libp2p/peer-id": "^6.0.17",
|
|
126
|
+
"@libp2p/prometheus-metrics": "^5.0.31",
|
|
127
|
+
"@libp2p/tcp": "^11.0.30",
|
|
128
|
+
"@libp2p/utils": "^7.4.3",
|
|
129
|
+
"@lodestar/api": "^1.51.0-dev.e1237a8b1d",
|
|
130
|
+
"@lodestar/config": "^1.51.0-dev.e1237a8b1d",
|
|
131
|
+
"@lodestar/db": "^1.51.0-dev.e1237a8b1d",
|
|
132
|
+
"@lodestar/fork-choice": "^1.51.0-dev.e1237a8b1d",
|
|
133
|
+
"@lodestar/logger": "^1.51.0-dev.e1237a8b1d",
|
|
134
|
+
"@lodestar/native": "^1.51.0-dev.e1237a8b1d",
|
|
135
|
+
"@lodestar/params": "^1.51.0-dev.e1237a8b1d",
|
|
136
|
+
"@lodestar/reqresp": "^1.51.0-dev.e1237a8b1d",
|
|
137
|
+
"@lodestar/state-transition": "^1.51.0-dev.e1237a8b1d",
|
|
138
|
+
"@lodestar/types": "^1.51.0-dev.e1237a8b1d",
|
|
139
|
+
"@lodestar/utils": "^1.51.0-dev.e1237a8b1d",
|
|
140
|
+
"@lodestar/validator": "^1.51.0-dev.e1237a8b1d",
|
|
141
141
|
"@multiformats/multiaddr": "^13.0.1",
|
|
142
142
|
"datastore-core": "^12.0.1",
|
|
143
143
|
"datastore-level": "^13.0.1",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"fastify": "^5.8.1",
|
|
146
146
|
"interface-datastore": "^10.0.1",
|
|
147
147
|
"jwt-simple": "0.5.6",
|
|
148
|
-
"libp2p": "3.
|
|
148
|
+
"libp2p": "3.4.0",
|
|
149
149
|
"multiformats": "^13.4.2",
|
|
150
150
|
"prom-client": "^15.1.0",
|
|
151
151
|
"qs": "^6.14.2",
|
|
@@ -157,16 +157,15 @@
|
|
|
157
157
|
},
|
|
158
158
|
"devDependencies": {
|
|
159
159
|
"@ethereumjs/rlp": "^4.0.1",
|
|
160
|
-
"@libp2p/interface-internal": "^3.
|
|
161
|
-
"@libp2p/logger": "^6.2.
|
|
162
|
-
"@lodestar/spec-test-util": "^1.51.0-dev.
|
|
163
|
-
"@lodestar/test-utils": "^1.51.0-dev.
|
|
160
|
+
"@libp2p/interface-internal": "^3.2.0",
|
|
161
|
+
"@libp2p/logger": "^6.2.15",
|
|
162
|
+
"@lodestar/spec-test-util": "^1.51.0-dev.e1237a8b1d",
|
|
163
|
+
"@lodestar/test-utils": "^1.51.0-dev.e1237a8b1d",
|
|
164
164
|
"@types/js-yaml": "^4.0.5",
|
|
165
165
|
"@types/qs": "^6.9.7",
|
|
166
166
|
"@types/tmp": "^0.2.3",
|
|
167
167
|
"dotenv": "^16.4.5",
|
|
168
168
|
"js-yaml": "^4.1.0",
|
|
169
|
-
"rimraf": "^4.4.1",
|
|
170
169
|
"tmp": "^0.2.1"
|
|
171
170
|
},
|
|
172
171
|
"keywords": [
|
|
@@ -175,5 +174,5 @@
|
|
|
175
174
|
"beacon",
|
|
176
175
|
"blockchain"
|
|
177
176
|
],
|
|
178
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "d4bd443fe6c94bcf369b0940359ec11204f2e594"
|
|
179
178
|
}
|
package/src/api/impl/api.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {getValidatorApi} from "./validator/index.js";
|
|
|
13
13
|
|
|
14
14
|
export function getApi(opts: ApiOptions, modules: ApiModules): BeaconApiMethods {
|
|
15
15
|
return {
|
|
16
|
-
beacon: getBeaconApi(modules),
|
|
16
|
+
beacon: getBeaconApi(opts, modules),
|
|
17
17
|
config: getConfigApi(modules),
|
|
18
18
|
debug: getDebugApi(modules),
|
|
19
19
|
events: getEventsApi(modules),
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
} from "../../../../chain/produceBlock/index.js";
|
|
63
63
|
import {RegenCaller} from "../../../../chain/regen/index.js";
|
|
64
64
|
import {validateGossipBlock, verifyBlockProposerSignature} from "../../../../chain/validation/block.js";
|
|
65
|
-
import {
|
|
65
|
+
import {validateGossipExecutionPayloadBid} from "../../../../chain/validation/executionPayloadBid.js";
|
|
66
66
|
import {validateApiExecutionPayloadEnvelope} from "../../../../chain/validation/executionPayloadEnvelope.js";
|
|
67
67
|
import {OpSource} from "../../../../chain/validatorMonitor.js";
|
|
68
68
|
import {
|
|
@@ -79,6 +79,7 @@ import {
|
|
|
79
79
|
import {isOptimisticBlock} from "../../../../util/forkChoice.js";
|
|
80
80
|
import {kzg} from "../../../../util/kzg.js";
|
|
81
81
|
import {promiseAllMaybeAsync} from "../../../../util/promises.js";
|
|
82
|
+
import {ApiOptions} from "../../../options.js";
|
|
82
83
|
import {ApiModules} from "../../types.js";
|
|
83
84
|
import {assertUniqueItems} from "../../utils.js";
|
|
84
85
|
import {getBlockResponse, toBeaconHeaderResponse} from "./utils.js";
|
|
@@ -96,16 +97,10 @@ const MAX_API_CLOCK_DISPARITY_MS = 1000;
|
|
|
96
97
|
*/
|
|
97
98
|
const IDENTITY_PEER_ID = ""; // TODO: Compute identity keypair
|
|
98
99
|
|
|
99
|
-
export function getBeaconBlockApi(
|
|
100
|
-
|
|
101
|
-
config,
|
|
102
|
-
|
|
103
|
-
network,
|
|
104
|
-
db,
|
|
105
|
-
}: Pick<
|
|
106
|
-
ApiModules,
|
|
107
|
-
"chain" | "config" | "metrics" | "network" | "db"
|
|
108
|
-
>): ApplicationMethods<routes.beacon.block.Endpoints> {
|
|
100
|
+
export function getBeaconBlockApi(
|
|
101
|
+
opts: ApiOptions,
|
|
102
|
+
{chain, config, metrics, network, db}: Pick<ApiModules, "chain" | "config" | "metrics" | "network" | "db">
|
|
103
|
+
): ApplicationMethods<routes.beacon.block.Endpoints> {
|
|
109
104
|
const publishBlockV2: ApplicationMethods<routes.beacon.block.Endpoints>["publishBlockV2"] = async (
|
|
110
105
|
{signedBlockContents, broadcastValidation, builderUrl},
|
|
111
106
|
context,
|
|
@@ -321,18 +316,8 @@ export function getBeaconBlockApi({
|
|
|
321
316
|
break;
|
|
322
317
|
}
|
|
323
318
|
|
|
324
|
-
case routes.beacon.BroadcastValidation.none: {
|
|
325
|
-
chain.logger.debug("Skipping broadcast validation", valLogMeta);
|
|
326
|
-
break;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
319
|
default: {
|
|
330
|
-
|
|
331
|
-
const message = `Broadcast validation of ${broadcastValidation} type not implemented yet`;
|
|
332
|
-
if (chain.opts.broadcastValidationStrictness === "error") {
|
|
333
|
-
throw Error(message);
|
|
334
|
-
}
|
|
335
|
-
chain.logger.warn(message, valLogMeta);
|
|
320
|
+
throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
|
|
336
321
|
}
|
|
337
322
|
}
|
|
338
323
|
|
|
@@ -402,26 +387,24 @@ export function getBeaconBlockApi({
|
|
|
402
387
|
...blobSidecars.map((blobSidecar) => () => network.publishBlobSidecar(blobSidecar)),
|
|
403
388
|
() =>
|
|
404
389
|
// there is no rush to persist block since we published it to gossip anyway
|
|
405
|
-
chain
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
source: BlockInputSource.api,
|
|
420
|
-
});
|
|
421
|
-
}
|
|
390
|
+
chain.processBlock(blockForImport, opts).catch((e) => {
|
|
391
|
+
if (e instanceof BlockError) {
|
|
392
|
+
switch (e.type.code) {
|
|
393
|
+
case BlockErrorCode.ALREADY_KNOWN:
|
|
394
|
+
// Block was imported while publishing, e.g. received via gossip
|
|
395
|
+
chain.logger.debug("Ignoring already-known block during publishing", valLogMeta);
|
|
396
|
+
return;
|
|
397
|
+
case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
|
|
398
|
+
case BlockErrorCode.PARENT_PAYLOAD_UNKNOWN:
|
|
399
|
+
chain.emitter.emit(ChainEvent.blockUnknownParent, {
|
|
400
|
+
blockInput: blockForImport,
|
|
401
|
+
peer: IDENTITY_PEER_ID,
|
|
402
|
+
source: BlockInputSource.api,
|
|
403
|
+
});
|
|
422
404
|
}
|
|
423
|
-
|
|
424
|
-
|
|
405
|
+
}
|
|
406
|
+
throw e;
|
|
407
|
+
}),
|
|
425
408
|
];
|
|
426
409
|
const sentPeersArr = await promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
|
|
427
410
|
publishPromises
|
|
@@ -809,11 +792,6 @@ export function getBeaconBlockApi({
|
|
|
809
792
|
};
|
|
810
793
|
try {
|
|
811
794
|
switch (broadcastValidation) {
|
|
812
|
-
case routes.beacon.BroadcastValidation.none: {
|
|
813
|
-
chain.logger.debug("Skipping broadcast validation of execution payload envelope", valLogMeta);
|
|
814
|
-
break;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
795
|
case routes.beacon.BroadcastValidation.gossip: {
|
|
818
796
|
await validateApiExecutionPayloadEnvelope(chain, signedExecutionPayloadEnvelope);
|
|
819
797
|
break;
|
|
@@ -852,11 +830,7 @@ export function getBeaconBlockApi({
|
|
|
852
830
|
}
|
|
853
831
|
|
|
854
832
|
default: {
|
|
855
|
-
|
|
856
|
-
if (chain.opts.broadcastValidationStrictness === "error") {
|
|
857
|
-
throw Error(message);
|
|
858
|
-
}
|
|
859
|
-
chain.logger.warn(message, valLogMeta);
|
|
833
|
+
throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
|
|
860
834
|
}
|
|
861
835
|
}
|
|
862
836
|
} catch (error) {
|
|
@@ -1008,9 +982,13 @@ export function getBeaconBlockApi({
|
|
|
1008
982
|
() => network.publishSignedExecutionPayloadEnvelope(signedExecutionPayloadEnvelope),
|
|
1009
983
|
// Publish all data column sidecars
|
|
1010
984
|
...dataColumnSidecars.map((dataColumnSidecar) => () => network.publishDataColumnSidecar(dataColumnSidecar)),
|
|
1011
|
-
// Import execution payload
|
|
1012
|
-
|
|
1013
|
-
|
|
985
|
+
// Import execution payload
|
|
986
|
+
() =>
|
|
987
|
+
chain.processExecutionPayload(payloadInput, {
|
|
988
|
+
// Signature is verified during broadcast validation only for the submitted envelope,
|
|
989
|
+
// an envelope cached by another source is verified at import
|
|
990
|
+
validSignature: payloadInput.getPayloadEnvelope() === signedExecutionPayloadEnvelope,
|
|
991
|
+
}),
|
|
1014
992
|
];
|
|
1015
993
|
|
|
1016
994
|
const publishPromise = promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
|
|
@@ -1077,15 +1055,25 @@ export function getBeaconBlockApi({
|
|
|
1077
1055
|
throw new ApiError(400, `publishExecutionPayloadBid not supported for pre-gloas fork=${fork}`);
|
|
1078
1056
|
}
|
|
1079
1057
|
|
|
1080
|
-
const validationTimer = metrics?.opPool.executionPayloadBidPool.apiValidationTime.startTimer();
|
|
1081
|
-
// TODO: once the builder is tested and can be trusted, skip this local validation
|
|
1082
|
-
// to publish faster, accepting peer-score risk if it ever emits an invalid bid.
|
|
1083
|
-
await validateApiExecutionPayloadBid(chain, signedExecutionPayloadBid);
|
|
1084
|
-
validationTimer?.();
|
|
1085
|
-
|
|
1086
1058
|
const elapsedSec = chain.clock.secFromSlot(slot, seenTimestampSec);
|
|
1087
1059
|
metrics?.gossipExecutionPayloadBid.elapsedTimeTillReceived.observe({source: OpSource.api}, elapsedSec);
|
|
1088
1060
|
|
|
1061
|
+
if (!opts.disableBidValidation) {
|
|
1062
|
+
const validationTimer = metrics?.opPool.executionPayloadBidPool.apiValidationTime.startTimer();
|
|
1063
|
+
const {proposerIndex} = await validateGossipExecutionPayloadBid(chain, signedExecutionPayloadBid);
|
|
1064
|
+
validationTimer?.();
|
|
1065
|
+
|
|
1066
|
+
// Gossip does not deliver our own messages back to us, so a validated bid is added to the
|
|
1067
|
+
// pool here to allow a proposer on this node to select it
|
|
1068
|
+
const insertOutcome = chain.executionPayloadBidPool.add(
|
|
1069
|
+
signedExecutionPayloadBid,
|
|
1070
|
+
Math.floor(elapsedSec * 1000)
|
|
1071
|
+
);
|
|
1072
|
+
metrics?.opPool.executionPayloadBidPool.apiInsertOutcome.inc({insertOutcome});
|
|
1073
|
+
|
|
1074
|
+
chain.validatorMonitor?.registerExecutionPayloadBid(OpSource.api, proposerIndex, bid);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1089
1077
|
const sentPeers = await network.publishSignedExecutionPayloadBid(signedExecutionPayloadBid);
|
|
1090
1078
|
|
|
1091
1079
|
chain.emitter.emit(routes.events.EventType.executionPayloadBid, {
|
|
@@ -1104,7 +1092,7 @@ export function getBeaconBlockApi({
|
|
|
1104
1092
|
},
|
|
1105
1093
|
|
|
1106
1094
|
async getSignedExecutionPayloadEnvelope({blockId}, context) {
|
|
1107
|
-
const {block,
|
|
1095
|
+
const {block, finalized} = await getBlockResponse(chain, blockId);
|
|
1108
1096
|
const slot = block.message.slot;
|
|
1109
1097
|
const fork = config.getForkName(slot);
|
|
1110
1098
|
|
|
@@ -1118,6 +1106,13 @@ export function getBeaconBlockApi({
|
|
|
1118
1106
|
const blockRoot = config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block.message);
|
|
1119
1107
|
const blockRootHex = toRootHex(blockRoot);
|
|
1120
1108
|
|
|
1109
|
+
// The block's own flag is the status of the payload it builds on, the envelope's is that of its
|
|
1110
|
+
// FULL variant. An unfinalized block without one has not imported its envelope yet.
|
|
1111
|
+
const payload = finalized ? null : chain.forkChoice.getBlockHex(blockRootHex, PayloadStatus.FULL);
|
|
1112
|
+
if (!finalized && payload === null) {
|
|
1113
|
+
throw new ApiError(404, `Execution payload envelope not found for slot=${slot}, blockRoot=${blockRootHex}`);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1121
1116
|
let data: Uint8Array | gloas.SignedExecutionPayloadEnvelope | null;
|
|
1122
1117
|
try {
|
|
1123
1118
|
data = context?.returnBytes
|
|
@@ -1142,7 +1137,7 @@ export function getBeaconBlockApi({
|
|
|
1142
1137
|
|
|
1143
1138
|
return {
|
|
1144
1139
|
data,
|
|
1145
|
-
meta: {executionOptimistic, finalized, version: fork},
|
|
1140
|
+
meta: {executionOptimistic: payload !== null && isOptimisticBlock(payload), finalized, version: fork},
|
|
1146
1141
|
};
|
|
1147
1142
|
},
|
|
1148
1143
|
|
|
@@ -3,6 +3,7 @@ import {ApplicationMethods} from "@lodestar/api/server";
|
|
|
3
3
|
import {isForkPostGloas} from "@lodestar/params";
|
|
4
4
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
5
5
|
import {toRootHex} from "@lodestar/utils";
|
|
6
|
+
import {ApiOptions} from "../../options.js";
|
|
6
7
|
import {ApiError} from "../errors.js";
|
|
7
8
|
import {ApiModules} from "../types.js";
|
|
8
9
|
import {getBeaconBlockApi} from "./blocks/index.js";
|
|
@@ -11,9 +12,10 @@ import {getBeaconRewardsApi} from "./rewards/index.js";
|
|
|
11
12
|
import {getBeaconStateApi} from "./state/index.js";
|
|
12
13
|
|
|
13
14
|
export function getBeaconApi(
|
|
15
|
+
opts: ApiOptions,
|
|
14
16
|
modules: Pick<ApiModules, "chain" | "config" | "logger" | "metrics" | "network" | "db" | "sync">
|
|
15
17
|
): ApplicationMethods<routes.beacon.Endpoints> {
|
|
16
|
-
const block = getBeaconBlockApi(modules);
|
|
18
|
+
const block = getBeaconBlockApi(opts, modules);
|
|
17
19
|
const pool = getBeaconPoolApi(modules);
|
|
18
20
|
const state = getBeaconStateApi(modules);
|
|
19
21
|
const rewards = getBeaconRewardsApi(modules);
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
PayloadAttestationError,
|
|
18
18
|
PayloadAttestationErrorCode,
|
|
19
19
|
SyncCommitteeError,
|
|
20
|
+
SyncCommitteeErrorCode,
|
|
20
21
|
} from "../../../../chain/errors/index.js";
|
|
21
22
|
import {validateApiAttesterSlashing} from "../../../../chain/validation/attesterSlashing.js";
|
|
22
23
|
import {validateApiBlsToExecutionChange} from "../../../../chain/validation/blsToExecutionChange.js";
|
|
@@ -340,7 +341,10 @@ export function getBeaconPoolApi({
|
|
|
340
341
|
const synCommittee = state.getIndexedSyncCommittee(signature.slot);
|
|
341
342
|
const indexesInCommittee = synCommittee.validatorIndexMap.get(signature.validatorIndex);
|
|
342
343
|
if (indexesInCommittee === undefined || indexesInCommittee.length === 0) {
|
|
343
|
-
|
|
344
|
+
throw new SyncCommitteeError(GossipAction.REJECT, {
|
|
345
|
+
code: SyncCommitteeErrorCode.VALIDATOR_NOT_IN_SYNC_COMMITTEE,
|
|
346
|
+
validatorIndex: signature.validatorIndex,
|
|
347
|
+
});
|
|
344
348
|
}
|
|
345
349
|
|
|
346
350
|
// Verify signature only, all other data is very likely to be correct, since the `signature` object is created by this node.
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
isStatePostGloas,
|
|
18
18
|
} from "@lodestar/state-transition";
|
|
19
19
|
import {
|
|
20
|
+
BuilderIndex,
|
|
20
21
|
ValidatorIndex,
|
|
21
22
|
getBuilderStatus,
|
|
22
23
|
getValidatorStatus,
|
|
@@ -29,6 +30,7 @@ import {ApiModules} from "../../types.js";
|
|
|
29
30
|
import {assertUniqueItems} from "../../utils.js";
|
|
30
31
|
import {
|
|
31
32
|
filterStateValidatorsByStatus,
|
|
33
|
+
getBuilderIndexByPubkey,
|
|
32
34
|
getStateBuilderIndex,
|
|
33
35
|
getStateResponseWithRegen,
|
|
34
36
|
getStateValidatorIndex,
|
|
@@ -170,8 +172,15 @@ export function getBeaconStateApi({
|
|
|
170
172
|
if (builderIds.length) {
|
|
171
173
|
assertUniqueItems(builderIds, "Duplicate builder IDs provided");
|
|
172
174
|
|
|
175
|
+
// There is no builder pubkey cache, scan the registry at most once per request
|
|
176
|
+
let builderIndexByPubkey: Map<string, BuilderIndex> | null = null;
|
|
177
|
+
const getBuilderIndexByPubkeyMap = () => {
|
|
178
|
+
builderIndexByPubkey ??= getBuilderIndexByPubkey(state);
|
|
179
|
+
return builderIndexByPubkey;
|
|
180
|
+
};
|
|
181
|
+
|
|
173
182
|
for (const id of builderIds) {
|
|
174
|
-
const resp = getStateBuilderIndex(id, state);
|
|
183
|
+
const resp = getStateBuilderIndex(id, state, getBuilderIndexByPubkeyMap);
|
|
175
184
|
if (resp.valid) {
|
|
176
185
|
const builderIndex = resp.builderIndex;
|
|
177
186
|
const builder = state.getBuilder(builderIndex);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {type PubkeyCache} from "@chainsafe/lodestar-z/pubkeys";
|
|
2
1
|
import {routes} from "@lodestar/api";
|
|
3
2
|
import {CheckpointWithHex, IForkChoice} from "@lodestar/fork-choice";
|
|
3
|
+
import {type PubkeyCache} from "@lodestar/native/pubkeys";
|
|
4
4
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
5
5
|
import {IBeaconStateView, IBeaconStateViewGloas} from "@lodestar/state-transition";
|
|
6
6
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getValidatorStatus,
|
|
14
14
|
phase0,
|
|
15
15
|
} from "@lodestar/types";
|
|
16
|
-
import {
|
|
16
|
+
import {fromHex, toHex} from "@lodestar/utils";
|
|
17
17
|
import {IBeaconChain} from "../../../../chain/index.js";
|
|
18
18
|
import {GENESIS_EPOCH} from "../../../../constants/index.js";
|
|
19
19
|
import {IBeaconSync} from "../../../../sync/index.js";
|
|
@@ -118,9 +118,22 @@ type StateBuilderIndexResponse =
|
|
|
118
118
|
| {valid: true; builderIndex: BuilderIndex}
|
|
119
119
|
| {valid: false; code: number; reason: string};
|
|
120
120
|
|
|
121
|
+
export function getBuilderIndexByPubkey(state: IBeaconStateViewGloas): Map<string, BuilderIndex> {
|
|
122
|
+
const builderIndexByPubkey = new Map<string, BuilderIndex>();
|
|
123
|
+
const buildersLength = state.getBuildersLength();
|
|
124
|
+
for (let builderIndex = 0; builderIndex < buildersLength; builderIndex++) {
|
|
125
|
+
const pubkeyHex = toHex(state.getBuilder(builderIndex).pubkey);
|
|
126
|
+
if (!builderIndexByPubkey.has(pubkeyHex)) {
|
|
127
|
+
builderIndexByPubkey.set(pubkeyHex, builderIndex);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return builderIndexByPubkey;
|
|
131
|
+
}
|
|
132
|
+
|
|
121
133
|
export function getStateBuilderIndex(
|
|
122
134
|
id: routes.beacon.BuilderId | BLSPubkey,
|
|
123
|
-
state: IBeaconStateViewGloas
|
|
135
|
+
state: IBeaconStateViewGloas,
|
|
136
|
+
getBuilderIndexByPubkeyMap: () => Map<string, BuilderIndex>
|
|
124
137
|
): StateBuilderIndexResponse {
|
|
125
138
|
if (typeof id === "string") {
|
|
126
139
|
// mutate `id` and fallthrough to below
|
|
@@ -148,14 +161,11 @@ export function getStateBuilderIndex(
|
|
|
148
161
|
}
|
|
149
162
|
|
|
150
163
|
// typeof id === Uint8Array
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (byteArrayEquals(state.getBuilder(builderIndex).pubkey, id)) {
|
|
155
|
-
return {valid: true, builderIndex};
|
|
156
|
-
}
|
|
164
|
+
const builderIndex = getBuilderIndexByPubkeyMap().get(toHex(id));
|
|
165
|
+
if (builderIndex === undefined) {
|
|
166
|
+
return {valid: false, code: 404, reason: "Builder pubkey not found in state"};
|
|
157
167
|
}
|
|
158
|
-
return {valid:
|
|
168
|
+
return {valid: true, builderIndex};
|
|
159
169
|
}
|
|
160
170
|
|
|
161
171
|
export function filterStateValidatorsByStatus(
|
|
@@ -114,6 +114,10 @@ export function getDebugApi({
|
|
|
114
114
|
unrealizedJustifiedRoot: node.unrealizedJustifiedRoot,
|
|
115
115
|
unrealizedFinalizedEpoch: node.unrealizedFinalizedEpoch,
|
|
116
116
|
unrealizedFinalizedRoot: node.unrealizedFinalizedRoot,
|
|
117
|
+
inclusionListSatisfied:
|
|
118
|
+
node.payloadStatus === PayloadStatus.FULL
|
|
119
|
+
? forkChoice.getPayloadInclusionListSatisfaction(node.blockRoot)
|
|
120
|
+
: null,
|
|
117
121
|
},
|
|
118
122
|
};
|
|
119
123
|
}),
|