@lodestar/beacon-node 1.51.0 → 1.52.0-dev.03eb33e6f1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +99 -127
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +25 -3
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +2 -1
- 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 +6 -2
- 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 +55 -32
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +4 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +4 -0
- package/lib/chain/ColumnReconstructionTracker.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 +4 -4
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +7 -0
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +12 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +17 -2
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts +9 -2
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +19 -7
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +11 -56
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +8 -242
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.d.ts +2 -4
- package/lib/chain/blocks/blockInput/errors.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/errors.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +2 -18
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +0 -1
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +36 -53
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +11 -12
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +56 -22
- 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 +5 -19
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +10 -7
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +22 -17
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +4 -20
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +0 -24
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +29 -14
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +17 -5
- 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 +14 -8
- 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 +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +12 -6
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +2 -2
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +12 -7
- 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 +2 -2
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +31 -9
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +193 -64
- 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/attestationError.d.ts +15 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +8 -0
- package/lib/chain/errors/attestationError.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 +3 -2
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -1
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +55 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +8 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/index.d.ts +0 -1
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +0 -1
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +8 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +8 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.d.ts +53 -0
- package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -0
- package/lib/chain/forkChoiceExecutionEngine.js +140 -0
- package/lib/chain/forkChoiceExecutionEngine.js.map +1 -0
- package/lib/chain/interface.d.ts +10 -8
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +13 -6
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +95 -115
- package/lib/chain/lightClient/index.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 +4 -1
- package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -1
- package/lib/chain/opPools/inclusionListStore.js +5 -2
- package/lib/chain/opPools/inclusionListStore.js.map +1 -1
- package/lib/chain/opPools/index.d.ts +1 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +1 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/opPool.js +6 -6
- package/lib/chain/opPools/opPool.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 +2 -3
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +3 -2
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/proposerTracker.d.ts +31 -0
- package/lib/chain/proposerTracker.d.ts.map +1 -0
- package/lib/chain/proposerTracker.js +75 -0
- package/lib/chain/proposerTracker.js.map +1 -0
- package/lib/chain/regen/interface.d.ts +1 -1
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +1 -1
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +5 -3
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts +1 -0
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js +1 -1
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.d.ts +8 -2
- package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.js +43 -6
- package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +13 -4
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.js +13 -12
- package/lib/chain/seenCache/seenExecutionPayloadBids.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/shufflingCache.d.ts +5 -0
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +39 -1
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +38 -10
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +33 -17
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +9 -1
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +8 -1
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +36 -46
- 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 +132 -4
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +9 -0
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +16 -10
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +11 -0
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +1 -2
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +0 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +3 -2
- package/lib/db/dataColumnStore.d.ts.map +1 -1
- package/lib/db/dataColumnStore.js +3 -3
- package/lib/db/dataColumnStore.js.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.d.ts +1 -1
- package/lib/db/flatFileStore/flatFileStore.d.ts.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.js +10 -9
- package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
- package/lib/db/flatFileStore/interface.d.ts +2 -1
- package/lib/db/flatFileStore/interface.d.ts.map +1 -1
- package/lib/db/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/repositories/blobSidecars.d.ts +0 -1
- package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.js +0 -1
- package/lib/db/repositories/blobSidecars.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts +2 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +14 -4
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/execution/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/engine/http.d.ts +4 -6
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +8 -10
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/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 +18 -6
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -4
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +2 -12
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +0 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +0 -4
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -4
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +1 -15
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +0 -9
- package/lib/execution/engine/sszTypes.d.ts.map +1 -1
- package/lib/execution/engine/sszTypes.js +0 -5
- package/lib/execution/engine/sszTypes.js.map +1 -1
- package/lib/execution/engine/transport.d.ts +1 -14
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +0 -8
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +2 -10
- 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 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +4 -9
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +11 -32
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +32 -8
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +116 -46
- 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 +23 -6
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +1 -8
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +0 -1
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +1 -23
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +0 -36
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +4 -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 +73 -46
- 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/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 +72 -138
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +0 -6
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +4 -5
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts +6 -0
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +33 -6
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +0 -3
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByHead.js +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByHead.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +1 -12
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +0 -2
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +0 -10
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +1 -17
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +2 -8
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +1 -7
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/network/reqresp/utils/collect.d.ts +4 -4
- package/lib/network/reqresp/utils/collect.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collect.js +9 -8
- package/lib/network/reqresp/utils/collect.js.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +2 -2
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.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 +38 -20
- 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 +8 -3
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +26 -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 +10 -16
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +43 -3
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/sync.d.ts +15 -0
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +103 -25
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/types.d.ts +12 -1
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +2 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +28 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +257 -31
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +20 -35
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +36 -130
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +23 -17
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +57 -100
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/bitArray.d.ts +6 -6
- package/lib/util/bitArray.d.ts.map +1 -1
- package/lib/util/bitArray.js +25 -50
- package/lib/util/bitArray.js.map +1 -1
- package/lib/util/blobs.d.ts +1 -7
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +0 -19
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/eventLoop.d.ts +5 -0
- package/lib/util/eventLoop.d.ts.map +1 -1
- package/lib/util/eventLoop.js +7 -0
- package/lib/util/eventLoop.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 +27 -28
- package/src/api/impl/beacon/blocks/index.ts +133 -156
- package/src/api/impl/beacon/pool/index.ts +40 -8
- package/src/api/impl/beacon/state/utils.ts +3 -2
- package/src/api/impl/debug/index.ts +6 -2
- package/src/api/impl/validator/index.ts +62 -36
- package/src/chain/ColumnReconstructionTracker.ts +5 -0
- package/src/chain/GetBlobsTracker.ts +82 -52
- package/src/chain/archiveStore/archiveStore.ts +6 -4
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +9 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +21 -2
- package/src/chain/archiveStore/utils/pruneHistory.ts +24 -9
- package/src/chain/blocks/blockInput/blockInput.ts +15 -344
- package/src/chain/blocks/blockInput/errors.ts +1 -2
- package/src/chain/blocks/blockInput/types.ts +2 -20
- package/src/chain/blocks/importBlock.ts +56 -72
- package/src/chain/blocks/importExecutionPayload.ts +85 -38
- package/src/chain/blocks/index.ts +8 -33
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +33 -22
- package/src/chain/blocks/types.ts +5 -31
- package/src/chain/blocks/verifyBlock.ts +47 -26
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +20 -6
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +16 -10
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +4 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +13 -5
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +16 -8
- 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 +2 -2
- package/src/chain/chain.ts +243 -81
- package/src/chain/emitter.ts +8 -8
- package/src/chain/errors/attestationError.ts +11 -1
- package/src/chain/errors/blockError.ts +1 -1
- package/src/chain/errors/executionPayloadBid.ts +3 -2
- package/src/chain/errors/executionPayloadEnvelope.ts +58 -0
- package/src/chain/errors/index.ts +0 -1
- package/src/chain/forkChoice/index.ts +8 -0
- package/src/chain/forkChoiceExecutionEngine.ts +216 -0
- package/src/chain/interface.ts +10 -7
- package/src/chain/lightClient/index.ts +108 -142
- package/src/chain/opPools/aggregatedAttestationPool.ts +246 -43
- package/src/chain/opPools/attestationPool.ts +16 -4
- package/src/chain/opPools/inclusionListStore.ts +5 -2
- package/src/chain/opPools/index.ts +1 -0
- package/src/chain/opPools/opPool.ts +6 -6
- 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 +7 -6
- package/src/chain/produceBlock/produceBlockBody.ts +7 -3
- package/src/chain/proposerTracker.ts +94 -0
- package/src/chain/regen/interface.ts +1 -1
- package/src/chain/regen/queued.ts +6 -4
- package/src/chain/seenCache/seenAttesters.ts +1 -1
- package/src/chain/seenCache/seenBlockAttesters.ts +48 -6
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +35 -15
- package/src/chain/seenCache/seenGossipBlockInput.ts +9 -93
- package/src/chain/shufflingCache.ts +40 -1
- package/src/chain/validation/aggregateAndProof.ts +44 -15
- package/src/chain/validation/attestation.ts +32 -21
- package/src/chain/validation/block.ts +9 -1
- package/src/chain/validation/dataColumnSidecar.ts +7 -1
- package/src/chain/validation/executionPayloadBid.ts +47 -48
- package/src/chain/validation/executionPayloadEnvelope.ts +155 -4
- package/src/chain/validation/payloadAttestationMessage.ts +10 -0
- package/src/chain/validation/syncCommittee.ts +31 -15
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +13 -0
- package/src/chain/validatorMonitor.ts +0 -6
- package/src/db/dataColumnStore.ts +5 -4
- package/src/db/flatFileStore/flatFileStore.ts +12 -11
- package/src/db/flatFileStore/interface.ts +2 -1
- package/src/db/flatFileStore/slotIndex.ts +4 -3
- package/src/db/repositories/blobSidecars.ts +0 -1
- package/src/db/repositories/dataColumnSidecarArchive.ts +14 -4
- package/src/execution/builder/apiClient.ts +16 -13
- package/src/execution/builder/http.ts +4 -0
- package/src/execution/engine/http.ts +19 -42
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +19 -10
- package/src/execution/engine/jsonRpcTransport.ts +10 -22
- package/src/execution/engine/mock.ts +0 -7
- package/src/execution/engine/restTransport.ts +3 -22
- package/src/execution/engine/sszTypes.ts +0 -9
- package/src/execution/engine/transport.ts +8 -17
- package/src/execution/engine/types.ts +3 -18
- package/src/execution/engine/utils.ts +4 -2
- package/src/index.ts +1 -1
- package/src/metrics/metrics/beacon.ts +11 -32
- package/src/metrics/metrics/lodestar.ts +117 -46
- 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 +24 -6
- package/src/network/gossip/interface.ts +0 -5
- package/src/network/gossip/topic.ts +1 -39
- package/src/network/interface.ts +2 -5
- package/src/network/libp2p/index.ts +5 -1
- package/src/network/network.ts +88 -69
- 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/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 +91 -178
- package/src/network/processor/gossipQueues/index.ts +0 -6
- package/src/network/processor/gossipValidatorFn.ts +4 -5
- package/src/network/processor/index.ts +32 -6
- package/src/network/reqresp/ReqRespBeaconNode.ts +0 -7
- package/src/network/reqresp/handlers/beaconBlocksByHead.ts +1 -1
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -2
- package/src/network/reqresp/handlers/index.ts +0 -17
- package/src/network/reqresp/protocols.ts +0 -12
- package/src/network/reqresp/rateLimit.ts +1 -17
- package/src/network/reqresp/types.ts +0 -13
- package/src/network/reqresp/utils/collect.ts +16 -8
- package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +3 -2
- package/src/network/subnets/attnetsService.ts +94 -6
- package/src/network/subnets/interface.ts +7 -0
- package/src/node/nodejs.ts +40 -21
- package/src/node/options.ts +9 -6
- package/src/sync/interface.ts +1 -0
- package/src/sync/range/batch.ts +29 -21
- package/src/sync/range/chain.ts +10 -14
- package/src/sync/range/range.ts +56 -3
- package/src/sync/sync.ts +108 -26
- package/src/sync/types.ts +11 -0
- package/src/sync/unknownBlock.ts +296 -32
- package/src/sync/utils/downloadByRange.ts +60 -233
- package/src/sync/utils/downloadByRoot.ts +78 -139
- package/src/util/bitArray.ts +22 -43
- package/src/util/blobs.ts +0 -34
- package/src/util/eventLoop.ts +8 -0
- 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
|
@@ -16,33 +16,6 @@ import {ExecutionPayloadBidError, ExecutionPayloadBidErrorCode, GossipAction} fr
|
|
|
16
16
|
import {IBeaconChain} from "../index.js";
|
|
17
17
|
import {RegenCaller} from "../regen/index.js";
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* Relative increment over the current highest bid required to forward a bid, in basis points.
|
|
21
|
-
* With 3%, laddering from 1 gwei to 1 ETH takes ~256 bids given the floor and cap below, see
|
|
22
|
-
* https://github.com/ethereum/consensus-specs/pull/4792#issuecomment-3714553549.
|
|
23
|
-
*/
|
|
24
|
-
const BID_INCREMENT_BPS = 300;
|
|
25
|
-
/**
|
|
26
|
-
* Minimum absolute increment (0.0001 ETH). Covers low bid values where the relative increment
|
|
27
|
-
* is tiny and provides weak spam protection.
|
|
28
|
-
*/
|
|
29
|
-
const BID_INCREMENT_FLOOR_GWEI = 100_000;
|
|
30
|
-
/**
|
|
31
|
-
* Maximum absolute increment (0.01 ETH). Bounds the barrier for legitimate competition on
|
|
32
|
-
* high value blocks where the relative increment would suppress closely competing bids.
|
|
33
|
-
*/
|
|
34
|
-
const BID_INCREMENT_CAP_GWEI = 10_000_000;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Return the minimum value a new bid must have to be forwarded given the current highest bid.
|
|
38
|
-
* Division before multiplication to stay within safe integer range for max gwei values.
|
|
39
|
-
*/
|
|
40
|
-
function getMinBidValue(currentHighestBid: number): number {
|
|
41
|
-
const relativeIncrement = Math.floor(currentHighestBid / 10_000) * BID_INCREMENT_BPS;
|
|
42
|
-
const increment = Math.min(Math.max(BID_INCREMENT_FLOOR_GWEI, relativeIncrement), BID_INCREMENT_CAP_GWEI);
|
|
43
|
-
return currentHighestBid + increment;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
19
|
/**
|
|
47
20
|
* Check whether a bid builds on one of the paths compatible with the local head branch.
|
|
48
21
|
*
|
|
@@ -165,17 +138,34 @@ async function validateExecutionPayloadBid(
|
|
|
165
138
|
});
|
|
166
139
|
}
|
|
167
140
|
|
|
168
|
-
// [IGNORE]
|
|
169
|
-
// the
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
|
|
141
|
+
// [IGNORE] The builder has not reached its bid limit, checked against the limit of its last valid bid.
|
|
142
|
+
// Bids for the same slot and parent root are validated against the same state, so bids past the
|
|
143
|
+
// limit can be dropped before state regeneration and the other expensive validation steps.
|
|
144
|
+
const seenBids = chain.seenExecutionPayloadBids.get(
|
|
145
|
+
bid.slot,
|
|
146
|
+
bid.builderIndex,
|
|
147
|
+
bidParentBlockHash,
|
|
148
|
+
bidParentBlockRoot
|
|
149
|
+
);
|
|
150
|
+
if (seenBids !== undefined && seenBids.count >= seenBids.limit) {
|
|
173
151
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
174
|
-
code: ExecutionPayloadBidErrorCode.
|
|
152
|
+
code: ExecutionPayloadBidErrorCode.BID_LIMIT_REACHED,
|
|
175
153
|
builderIndex: bid.builderIndex,
|
|
176
154
|
slot: bid.slot,
|
|
177
155
|
parentBlockRoot: bidParentBlockRoot,
|
|
178
156
|
parentBlockHash: bidParentBlockHash,
|
|
157
|
+
bidLimit: seenBids.limit,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// [IGNORE] this bid is the highest value bid seen for the tuple
|
|
162
|
+
// `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
|
|
163
|
+
const bestBid = chain.executionPayloadBidPool.getBestBid(bid.slot, bidParentBlockHash, bidParentBlockRoot);
|
|
164
|
+
if (bestBid !== null && bid.value <= bestBid.signedBid.message.value) {
|
|
165
|
+
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
166
|
+
code: ExecutionPayloadBidErrorCode.BID_TOO_LOW,
|
|
167
|
+
bidValue: bid.value,
|
|
168
|
+
currentHighestBid: bestBid.signedBid.message.value,
|
|
179
169
|
});
|
|
180
170
|
}
|
|
181
171
|
|
|
@@ -352,19 +342,24 @@ async function validateExecutionPayloadBid(
|
|
|
352
342
|
});
|
|
353
343
|
}
|
|
354
344
|
|
|
355
|
-
// [IGNORE]
|
|
356
|
-
// `(bid.slot, bid.parent_block_hash, bid.parent_block_root)
|
|
357
|
-
//
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
345
|
+
// [IGNORE] The builder has not reached its bid limit for the tuple
|
|
346
|
+
// `(bid.slot, bid.parent_block_hash, bid.parent_block_root)` -- i.e. one bid per ETH of builder balance
|
|
347
|
+
// not owed in pending withdrawals, `get_builder_bid_limit(state, bid.builder_index)`.
|
|
348
|
+
const bidLimit = state.getBuilderBidLimit(bid.builderIndex);
|
|
349
|
+
if (
|
|
350
|
+
(chain.seenExecutionPayloadBids.get(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)?.count ??
|
|
351
|
+
0) >= bidLimit
|
|
352
|
+
) {
|
|
362
353
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
363
|
-
code: ExecutionPayloadBidErrorCode.
|
|
364
|
-
|
|
365
|
-
|
|
354
|
+
code: ExecutionPayloadBidErrorCode.BID_LIMIT_REACHED,
|
|
355
|
+
builderIndex: bid.builderIndex,
|
|
356
|
+
slot: bid.slot,
|
|
357
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
358
|
+
parentBlockHash: bidParentBlockHash,
|
|
359
|
+
bidLimit,
|
|
366
360
|
});
|
|
367
361
|
}
|
|
362
|
+
|
|
368
363
|
// [IGNORE] `bid.value` is less or equal than the builder's excess balance --
|
|
369
364
|
// i.e. `can_builder_cover_bid(state, builder_index, amount)` returns `True`.
|
|
370
365
|
if (!state.canBuilderCoverBid(bid.builderIndex, bid.value)) {
|
|
@@ -425,20 +420,24 @@ async function validateExecutionPayloadBid(
|
|
|
425
420
|
});
|
|
426
421
|
}
|
|
427
422
|
|
|
428
|
-
// Repeat the
|
|
429
|
-
// for the same builder and tuple from
|
|
430
|
-
if (
|
|
423
|
+
// Repeat the bid limit check after the awaited signature verification to prevent concurrent bids
|
|
424
|
+
// for the same builder and tuple from all passing validation.
|
|
425
|
+
if (
|
|
426
|
+
(chain.seenExecutionPayloadBids.get(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)?.count ??
|
|
427
|
+
0) >= bidLimit
|
|
428
|
+
) {
|
|
431
429
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
432
|
-
code: ExecutionPayloadBidErrorCode.
|
|
430
|
+
code: ExecutionPayloadBidErrorCode.BID_LIMIT_REACHED,
|
|
433
431
|
builderIndex: bid.builderIndex,
|
|
434
432
|
slot: bid.slot,
|
|
435
433
|
parentBlockRoot: bidParentBlockRoot,
|
|
436
434
|
parentBlockHash: bidParentBlockHash,
|
|
435
|
+
bidLimit,
|
|
437
436
|
});
|
|
438
437
|
}
|
|
439
438
|
|
|
440
439
|
// Valid
|
|
441
|
-
chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot);
|
|
440
|
+
chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot, bidLimit);
|
|
442
441
|
|
|
443
442
|
return {proposerIndex: proposerPreferences.message.validatorIndex};
|
|
444
443
|
}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import {PayloadStatus} from "@lodestar/fork-choice";
|
|
1
|
+
import {PayloadStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
2
|
import {
|
|
3
3
|
computeStartSlotAtEpoch,
|
|
4
|
+
computeTimeAtSlot,
|
|
4
5
|
getExecutionPayloadEnvelopeSignatureSet,
|
|
5
6
|
isStatePostGloas,
|
|
6
7
|
} from "@lodestar/state-transition";
|
|
7
8
|
import {gloas, ssz} from "@lodestar/types";
|
|
8
9
|
import {byteArrayEquals, toRootHex} from "@lodestar/utils";
|
|
10
|
+
import {
|
|
11
|
+
getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized,
|
|
12
|
+
getSlotFromExecutionPayloadEnvelopeSerialized,
|
|
13
|
+
getTransactionCountFromExecutionPayloadEnvelopeSerialized,
|
|
14
|
+
} from "../../util/sszBytes.js";
|
|
9
15
|
import {ExecutionPayloadEnvelopeError, ExecutionPayloadEnvelopeErrorCode, GossipAction} from "../errors/index.js";
|
|
10
16
|
import {IBeaconChain} from "../index.js";
|
|
11
17
|
import {RegenCaller} from "../regen/index.js";
|
|
18
|
+
import {PayloadEnvelopeInput} from "../seenCache/seenPayloadEnvelopeInput.js";
|
|
12
19
|
|
|
13
20
|
export async function validateApiExecutionPayloadEnvelope(
|
|
14
21
|
chain: IBeaconChain,
|
|
@@ -24,6 +31,40 @@ export async function validateGossipExecutionPayloadEnvelope(
|
|
|
24
31
|
return validateExecutionPayloadEnvelope(chain, executionPayloadEnvelope);
|
|
25
32
|
}
|
|
26
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Applies the transaction count check to the serialized envelope so that an oversized envelope is dropped
|
|
36
|
+
* before it is deserialized. Defers to validateGossipExecutionPayloadEnvelope if the data is malformed
|
|
37
|
+
* or the block is not known.
|
|
38
|
+
*/
|
|
39
|
+
export function validateGossipExecutionPayloadEnvelopeSerialized(
|
|
40
|
+
chain: IBeaconChain,
|
|
41
|
+
serializedData: Uint8Array
|
|
42
|
+
): void {
|
|
43
|
+
const blockRootHex = getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized(serializedData);
|
|
44
|
+
const slot = getSlotFromExecutionPayloadEnvelopeSerialized(serializedData);
|
|
45
|
+
const transactionCount = getTransactionCountFromExecutionPayloadEnvelopeSerialized(serializedData);
|
|
46
|
+
if (blockRootHex === null || slot === null || transactionCount === null) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const block = chain.forkChoice.getBlockHexDefaultStatus(blockRootHex);
|
|
51
|
+
const payloadInput = chain.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
52
|
+
if (!block || !payloadInput) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const maxTransactionCount = getMaxTransactionCount(chain, block, payloadInput);
|
|
57
|
+
if (BigInt(transactionCount) > maxTransactionCount) {
|
|
58
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
59
|
+
code: ExecutionPayloadEnvelopeErrorCode.TOO_MANY_TRANSACTIONS,
|
|
60
|
+
slot,
|
|
61
|
+
root: blockRootHex,
|
|
62
|
+
transactionCount,
|
|
63
|
+
maxTransactionCount: Number(maxTransactionCount),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
27
68
|
async function validateExecutionPayloadEnvelope(
|
|
28
69
|
chain: IBeaconChain,
|
|
29
70
|
executionPayloadEnvelope: gloas.SignedExecutionPayloadEnvelope
|
|
@@ -89,6 +130,17 @@ async function validateExecutionPayloadEnvelope(
|
|
|
89
130
|
});
|
|
90
131
|
}
|
|
91
132
|
|
|
133
|
+
// [REJECT] `envelope.parent_beacon_block_root == block.parent_root`
|
|
134
|
+
if (toRootHex(envelope.parentBeaconBlockRoot) !== block.parentRoot) {
|
|
135
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
136
|
+
code: ExecutionPayloadEnvelopeErrorCode.PARENT_BEACON_BLOCK_ROOT_MISMATCH,
|
|
137
|
+
slot: payload.slotNumber,
|
|
138
|
+
root: blockRootHex,
|
|
139
|
+
envelopeParentBeaconBlockRoot: toRootHex(envelope.parentBeaconBlockRoot),
|
|
140
|
+
blockParentRoot: block.parentRoot,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
92
144
|
// [REJECT] `envelope.builder_index == bid.builder_index`
|
|
93
145
|
if (envelope.builderIndex !== payloadInput.getBuilderIndex()) {
|
|
94
146
|
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
@@ -100,6 +152,30 @@ async function validateExecutionPayloadEnvelope(
|
|
|
100
152
|
});
|
|
101
153
|
}
|
|
102
154
|
|
|
155
|
+
const bid = payloadInput.getBid();
|
|
156
|
+
|
|
157
|
+
// [REJECT] `payload.prev_randao == bid.prev_randao`
|
|
158
|
+
if (!byteArrayEquals(payload.prevRandao, bid.prevRandao)) {
|
|
159
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
160
|
+
code: ExecutionPayloadEnvelopeErrorCode.PREV_RANDAO_MISMATCH,
|
|
161
|
+
slot: payload.slotNumber,
|
|
162
|
+
root: blockRootHex,
|
|
163
|
+
envelopePrevRandao: toRootHex(payload.prevRandao),
|
|
164
|
+
bidPrevRandao: toRootHex(bid.prevRandao),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// [REJECT] `payload.gas_limit == bid.gas_limit`
|
|
169
|
+
if (BigInt(payload.gasLimit) !== bid.gasLimit) {
|
|
170
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
171
|
+
code: ExecutionPayloadEnvelopeErrorCode.GAS_LIMIT_MISMATCH,
|
|
172
|
+
slot: payload.slotNumber,
|
|
173
|
+
root: blockRootHex,
|
|
174
|
+
envelopeGasLimit: payload.gasLimit,
|
|
175
|
+
bidGasLimit: bid.gasLimit,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
103
179
|
// [REJECT] `payload.block_hash == bid.block_hash`
|
|
104
180
|
if (toRootHex(payload.blockHash) !== payloadInput.getBlockHashHex()) {
|
|
105
181
|
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
@@ -113,17 +189,31 @@ async function validateExecutionPayloadEnvelope(
|
|
|
113
189
|
|
|
114
190
|
// [REJECT] `hash_tree_root(envelope.execution_requests) == bid.execution_requests_root`
|
|
115
191
|
const requestsRoot = ssz.gloas.ExecutionRequests.hashTreeRoot(envelope.executionRequests);
|
|
116
|
-
if (!byteArrayEquals(requestsRoot,
|
|
192
|
+
if (!byteArrayEquals(requestsRoot, bid.executionRequestsRoot)) {
|
|
117
193
|
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
118
194
|
code: ExecutionPayloadEnvelopeErrorCode.EXECUTION_REQUESTS_ROOT_MISMATCH,
|
|
119
195
|
slot: payload.slotNumber,
|
|
120
196
|
root: blockRootHex,
|
|
121
197
|
envelopeRequestsRoot: toRootHex(requestsRoot),
|
|
122
|
-
bidRequestsRoot: toRootHex(
|
|
198
|
+
bidRequestsRoot: toRootHex(bid.executionRequestsRoot),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// [IGNORE] The number of transactions is within the limit implied by the parent payload's gas limit
|
|
203
|
+
// TODO GLOAS: [REJECT] once https://github.com/ethereum/consensus-specs/pull/5802 is released,
|
|
204
|
+
// also in validateGossipExecutionPayloadEnvelopeSerialized
|
|
205
|
+
const maxTransactionCount = getMaxTransactionCount(chain, block, payloadInput);
|
|
206
|
+
if (BigInt(payload.transactions.length) > maxTransactionCount) {
|
|
207
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
208
|
+
code: ExecutionPayloadEnvelopeErrorCode.TOO_MANY_TRANSACTIONS,
|
|
209
|
+
slot: payload.slotNumber,
|
|
210
|
+
root: blockRootHex,
|
|
211
|
+
transactionCount: payload.transactions.length,
|
|
212
|
+
maxTransactionCount: Number(maxTransactionCount),
|
|
123
213
|
});
|
|
124
214
|
}
|
|
125
215
|
|
|
126
|
-
// Get the block state to verify the builder's signature.
|
|
216
|
+
// Get the block state to verify the payload against it and the builder's signature.
|
|
127
217
|
const blockState = await chain.regen
|
|
128
218
|
.getState(block.stateRoot, RegenCaller.validateGossipPayloadEnvelope)
|
|
129
219
|
.catch(() => {
|
|
@@ -137,6 +227,54 @@ async function validateExecutionPayloadEnvelope(
|
|
|
137
227
|
throw new Error(`Expected gloas+ state for execution payload envelope validation, got fork=${blockState.forkName}`);
|
|
138
228
|
}
|
|
139
229
|
|
|
230
|
+
// [REJECT] `payload.parent_hash == state.latest_block_hash`
|
|
231
|
+
if (!byteArrayEquals(payload.parentHash, blockState.latestBlockHash)) {
|
|
232
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
233
|
+
code: ExecutionPayloadEnvelopeErrorCode.PARENT_HASH_MISMATCH,
|
|
234
|
+
slot: payload.slotNumber,
|
|
235
|
+
root: blockRootHex,
|
|
236
|
+
envelopeParentHash: toRootHex(payload.parentHash),
|
|
237
|
+
latestBlockHash: toRootHex(blockState.latestBlockHash),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// [REJECT] `payload.timestamp == compute_time_at_slot(state.genesis_time, block.slot)`
|
|
242
|
+
const expectedTimestamp = computeTimeAtSlot(chain.config, block.slot, blockState.genesisTime);
|
|
243
|
+
if (payload.timestamp !== expectedTimestamp) {
|
|
244
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
245
|
+
code: ExecutionPayloadEnvelopeErrorCode.INCORRECT_TIMESTAMP,
|
|
246
|
+
slot: payload.slotNumber,
|
|
247
|
+
root: blockRootHex,
|
|
248
|
+
envelopeTimestamp: payload.timestamp,
|
|
249
|
+
expectedTimestamp,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// [REJECT] The payload contains no empty transactions
|
|
254
|
+
for (let i = 0; i < payload.transactions.length; i++) {
|
|
255
|
+
if (payload.transactions.getSize(i) === 0) {
|
|
256
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
257
|
+
code: ExecutionPayloadEnvelopeErrorCode.EMPTY_TRANSACTION,
|
|
258
|
+
slot: payload.slotNumber,
|
|
259
|
+
root: blockRootHex,
|
|
260
|
+
transactionIndex: i,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// [REJECT] `hash_tree_root(payload.withdrawals) == hash_tree_root(state.payload_expected_withdrawals)`
|
|
266
|
+
const withdrawalsRoot = ssz.gloas.Withdrawals.hashTreeRoot(payload.withdrawals);
|
|
267
|
+
const expectedWithdrawalsRoot = ssz.gloas.Withdrawals.hashTreeRoot(blockState.payloadExpectedWithdrawals);
|
|
268
|
+
if (!byteArrayEquals(withdrawalsRoot, expectedWithdrawalsRoot)) {
|
|
269
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
270
|
+
code: ExecutionPayloadEnvelopeErrorCode.WITHDRAWALS_MISMATCH,
|
|
271
|
+
slot: payload.slotNumber,
|
|
272
|
+
root: blockRootHex,
|
|
273
|
+
envelopeWithdrawalsRoot: toRootHex(withdrawalsRoot),
|
|
274
|
+
expectedWithdrawalsRoot: toRootHex(expectedWithdrawalsRoot),
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
140
278
|
// [REJECT] `signed_execution_payload_envelope.signature` is valid as verified
|
|
141
279
|
// by `verify_execution_payload_envelope_signature`.
|
|
142
280
|
const signatureSet = getExecutionPayloadEnvelopeSignatureSet(
|
|
@@ -154,3 +292,16 @@ async function validateExecutionPayloadEnvelope(
|
|
|
154
292
|
});
|
|
155
293
|
}
|
|
156
294
|
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* The bid's gas limit is only tied to the parent payload by bid gossip, so the bound is the gas limit the
|
|
298
|
+
* EIP-1559 rule allows on top of the parent payload's. The bid is the only bound if that gas limit is unknown.
|
|
299
|
+
*/
|
|
300
|
+
function getMaxTransactionCount(chain: IBeaconChain, block: ProtoBlock, payloadInput: PayloadEnvelopeInput): bigint {
|
|
301
|
+
const parentGasLimit = block.executionPayloadBlockHash === null ? 0n : BigInt(block.executionPayloadGasLimit);
|
|
302
|
+
const maxGasLimit =
|
|
303
|
+
parentGasLimit === 0n
|
|
304
|
+
? payloadInput.getBid().gasLimit
|
|
305
|
+
: parentGasLimit + (parentGasLimit / 1024n > 1n ? parentGasLimit / 1024n : 1n) - 1n;
|
|
306
|
+
return maxGasLimit / BigInt(chain.config.MIN_TRANSACTION_GAS);
|
|
307
|
+
}
|
|
@@ -131,6 +131,16 @@ async function validatePayloadAttestationMessage(
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// Re-check after the await: concurrent messages from the same validator all pass the check above
|
|
135
|
+
if (chain.seenPayloadAttesters.isKnown(data.slot, validatorIndex)) {
|
|
136
|
+
throw new PayloadAttestationError(GossipAction.IGNORE, {
|
|
137
|
+
code: PayloadAttestationErrorCode.PAYLOAD_ATTESTATION_ALREADY_KNOWN,
|
|
138
|
+
validatorIndex,
|
|
139
|
+
slot: data.slot,
|
|
140
|
+
blockRoot: toRootHex(data.beaconBlockRoot),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
134
144
|
// Valid
|
|
135
145
|
chain.seenPayloadAttesters.add(data.slot, validatorIndex);
|
|
136
146
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {SYNC_COMMITTEE_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
2
2
|
import {IBeaconStateView, isStatePostAltair} from "@lodestar/state-transition";
|
|
3
|
-
import {SubnetID, altair} from "@lodestar/types";
|
|
3
|
+
import {RootHex, Slot, SubnetID, ValidatorIndex, altair} from "@lodestar/types";
|
|
4
4
|
import {toRootHex} from "@lodestar/utils";
|
|
5
|
+
import {Metrics} from "../../metrics/metrics.js";
|
|
5
6
|
import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js";
|
|
6
7
|
import {IBeaconChain} from "../interface.js";
|
|
7
8
|
import {getSyncCommitteeSignatureSet} from "./signatureSets/index.js";
|
|
@@ -32,6 +33,33 @@ export async function validateGossipSyncCommittee(
|
|
|
32
33
|
|
|
33
34
|
// [IGNORE] There has been no other valid sync committee signature for the declared slot for the validator referenced
|
|
34
35
|
// by sync_committee_signature.validator_index.
|
|
36
|
+
assertSyncCommitteeMessageNotKnown(chain, slot, subnet, validatorIndex, messageRoot, chain.metrics);
|
|
37
|
+
|
|
38
|
+
// [REJECT] The subnet_id is valid for the given validator, i.e. subnet_id in compute_subnets_for_sync_committee(state, sync_committee_signature.validator_index).
|
|
39
|
+
// Note this validation implies the validator is part of the broader current sync committee along with the correct subcommittee.
|
|
40
|
+
// > Checked in validateGossipSyncCommitteeExceptSig()
|
|
41
|
+
|
|
42
|
+
// [REJECT] The signature is valid for the message beacon_block_root for the validator referenced by validator_index.
|
|
43
|
+
await validateSyncCommitteeSigOnly(chain, headState, syncCommittee);
|
|
44
|
+
|
|
45
|
+
// Re-check after the await: concurrent messages from the same validator all pass the check above.
|
|
46
|
+
// Metrics were already counted by the first check.
|
|
47
|
+
assertSyncCommitteeMessageNotKnown(chain, slot, subnet, validatorIndex, messageRoot, null);
|
|
48
|
+
|
|
49
|
+
// Register this valid item as seen
|
|
50
|
+
chain.seenSyncCommitteeMessages.add(slot, subnet, validatorIndex, messageRoot);
|
|
51
|
+
|
|
52
|
+
return {indicesInSubcommittee};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function assertSyncCommitteeMessageNotKnown(
|
|
56
|
+
chain: IBeaconChain,
|
|
57
|
+
slot: Slot,
|
|
58
|
+
subnet: SubnetID,
|
|
59
|
+
validatorIndex: ValidatorIndex,
|
|
60
|
+
messageRoot: RootHex,
|
|
61
|
+
metrics: Metrics | null
|
|
62
|
+
): void {
|
|
35
63
|
const prevRoot = chain.seenSyncCommitteeMessages.get(slot, subnet, validatorIndex);
|
|
36
64
|
if (prevRoot) {
|
|
37
65
|
let shouldIgnore = false;
|
|
@@ -39,9 +67,9 @@ export async function validateGossipSyncCommittee(
|
|
|
39
67
|
shouldIgnore = true;
|
|
40
68
|
} else {
|
|
41
69
|
const headRoot = chain.forkChoice.getHeadRoot();
|
|
42
|
-
|
|
70
|
+
metrics?.gossipSyncCommittee.equivocationCount.inc();
|
|
43
71
|
if (messageRoot === headRoot) {
|
|
44
|
-
|
|
72
|
+
metrics?.gossipSyncCommittee.equivocationToHeadCount.inc();
|
|
45
73
|
} else {
|
|
46
74
|
shouldIgnore = true;
|
|
47
75
|
}
|
|
@@ -57,18 +85,6 @@ export async function validateGossipSyncCommittee(
|
|
|
57
85
|
});
|
|
58
86
|
}
|
|
59
87
|
}
|
|
60
|
-
|
|
61
|
-
// [REJECT] The subnet_id is valid for the given validator, i.e. subnet_id in compute_subnets_for_sync_committee(state, sync_committee_signature.validator_index).
|
|
62
|
-
// Note this validation implies the validator is part of the broader current sync committee along with the correct subcommittee.
|
|
63
|
-
// > Checked in validateGossipSyncCommitteeExceptSig()
|
|
64
|
-
|
|
65
|
-
// [REJECT] The signature is valid for the message beacon_block_root for the validator referenced by validator_index.
|
|
66
|
-
await validateSyncCommitteeSigOnly(chain, headState, syncCommittee);
|
|
67
|
-
|
|
68
|
-
// Register this valid item as seen
|
|
69
|
-
chain.seenSyncCommitteeMessages.add(slot, subnet, validatorIndex, messageRoot);
|
|
70
|
-
|
|
71
|
-
return {indicesInSubcommittee};
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
export async function validateApiSyncCommittee(
|
|
@@ -92,6 +92,19 @@ export async function validateSyncCommitteeGossipContributionAndProof(
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
// Re-check after the await: concurrent contributions from the same aggregator all pass the checks above
|
|
96
|
+
if (chain.seenContributionAndProof.isAggregatorKnown(slot, subcommitteeIndex, aggregatorIndex)) {
|
|
97
|
+
throw new SyncCommitteeError(GossipAction.IGNORE, {
|
|
98
|
+
code: SyncCommitteeErrorCode.SYNC_COMMITTEE_AGGREGATOR_ALREADY_KNOWN,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!skipValidationKnownParticipants && chain.seenContributionAndProof.participantsKnown(contribution)) {
|
|
103
|
+
throw new SyncCommitteeError(GossipAction.IGNORE, {
|
|
104
|
+
code: SyncCommitteeErrorCode.SYNC_COMMITTEE_PARTICIPANTS_ALREADY_KNOWN,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
95
108
|
// no need to add to seenSyncCommittteeContributionCache here, gossip handler will do that
|
|
96
109
|
chain.seenContributionAndProof.add(contributionAndProof, syncCommitteeParticipantIndices.length);
|
|
97
110
|
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
SubnetID,
|
|
22
22
|
ValidatorIndex,
|
|
23
23
|
altair,
|
|
24
|
-
deneb,
|
|
25
24
|
gloas,
|
|
26
25
|
} from "@lodestar/types";
|
|
27
26
|
import {
|
|
@@ -70,7 +69,6 @@ export type ValidatorMonitor = {
|
|
|
70
69
|
balances?: number[]
|
|
71
70
|
): void;
|
|
72
71
|
registerBeaconBlock(src: OpSource, delaySec: Seconds, block: BeaconBlock): void;
|
|
73
|
-
registerBlobSidecar(src: OpSource, seenTimestampSec: Seconds, blob: deneb.BlobSidecar): void;
|
|
74
72
|
registerExecutionPayloadEnvelope(
|
|
75
73
|
src: OpSource,
|
|
76
74
|
delaySec: Seconds,
|
|
@@ -434,10 +432,6 @@ export function createValidatorMonitor(
|
|
|
434
432
|
}
|
|
435
433
|
},
|
|
436
434
|
|
|
437
|
-
registerBlobSidecar(_src, _seenTimestampSec, _blob) {
|
|
438
|
-
//TODO: freetheblobs
|
|
439
|
-
},
|
|
440
|
-
|
|
441
435
|
registerExecutionPayloadEnvelope(_src, _delaySec, _envelope) {
|
|
442
436
|
// TODO GLOAS: implement execution payload envelope monitoring
|
|
443
437
|
},
|
|
@@ -22,7 +22,8 @@ export interface IDataColumnStore {
|
|
|
22
22
|
getManyBinary(key: DataColumnKey, indices: ColumnIndex[]): Promise<(Uint8Array | undefined)[]>;
|
|
23
23
|
putManyBinary(key: DataColumnKey, columns: IndexedDataColumnBytes[]): Promise<void>;
|
|
24
24
|
deleteMany(keys: DataColumnKey[]): Promise<void>;
|
|
25
|
-
|
|
25
|
+
/** Prunes the oldest slots before `slot`, at most `maxSlots` of them per backing store. Returns the pruned slots. */
|
|
26
|
+
pruneBefore(slot: Slot, maxSlots?: number): Promise<Slot[]>;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -84,9 +85,9 @@ export class LegacyDataColumnStore implements IDataColumnStore {
|
|
|
84
85
|
await this.legacyHot.deleteMany(keys.map(({blockRoot}) => fromHex(blockRoot)));
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
async pruneBefore(slot: Slot): Promise<Slot[]> {
|
|
88
|
-
const flatFileSlots = await this.flatFiles.pruneBefore(slot);
|
|
89
|
-
const slots = await this.legacyArchive.pruneBefore(slot);
|
|
88
|
+
async pruneBefore(slot: Slot, maxSlots?: number): Promise<Slot[]> {
|
|
89
|
+
const flatFileSlots = await this.flatFiles.pruneBefore(slot, maxSlots);
|
|
90
|
+
const slots = await this.legacyArchive.pruneBefore(slot, maxSlots);
|
|
90
91
|
return [...new Set([...flatFileSlots, ...slots])].sort((a, b) => a - b);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {type FileHandle, open, readFile, rm} from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import {ChainForkConfig} from "@lodestar/config";
|
|
4
4
|
import {ForkPostFulu} from "@lodestar/params";
|
|
@@ -161,25 +161,26 @@ export class FlatFileStore implements IFlatFileStore {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
async pruneBefore(minSlot: Slot): Promise<Slot[]> {
|
|
164
|
+
async pruneBefore(minSlot: Slot, maxSlots = Infinity): Promise<Slot[]> {
|
|
165
165
|
return observeFlatFileStoreOperation(this.metrics, FlatFileStoreOperation.prune, async () => {
|
|
166
166
|
this.minRetainedSlot = Math.max(this.minRetainedSlot, minSlot);
|
|
167
|
-
const
|
|
167
|
+
const expiredSlots = new Set(this.slotIndex.getBefore(this.minRetainedSlot));
|
|
168
168
|
for (const slot of this.mutationLocks.keys()) {
|
|
169
|
-
if (slot < this.minRetainedSlot)
|
|
169
|
+
if (slot < this.minRetainedSlot) expiredSlots.add(slot);
|
|
170
170
|
}
|
|
171
|
+
const slotsToPrune = [...expiredSlots].sort((a, b) => a - b).slice(0, maxSlots);
|
|
171
172
|
|
|
172
173
|
for (const slot of slotsToPrune) {
|
|
173
174
|
const release = await this.acquireMutationLock(slot);
|
|
174
175
|
try {
|
|
175
|
-
await
|
|
176
|
+
await rm(path.join(this.dataColumnDir, padSlot(slot)), {recursive: true, force: true});
|
|
176
177
|
this.slotIndex.remove(slot);
|
|
177
178
|
this.metrics?.prunedDirectories.inc();
|
|
178
179
|
} finally {
|
|
179
180
|
release();
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
|
-
return
|
|
183
|
+
return slotsToPrune;
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
186
|
|
|
@@ -212,7 +213,7 @@ export class FlatFileStore implements IFlatFileStore {
|
|
|
212
213
|
|
|
213
214
|
private async readFile(slot: Slot, rootHex: RootHex): Promise<Uint8Array | null> {
|
|
214
215
|
try {
|
|
215
|
-
return await
|
|
216
|
+
return await readFile(this.filePath(slot, rootHex));
|
|
216
217
|
} catch (e) {
|
|
217
218
|
if (!isFsNotFoundError(e)) throw e;
|
|
218
219
|
return null;
|
|
@@ -224,9 +225,9 @@ export class FlatFileStore implements IFlatFileStore {
|
|
|
224
225
|
rootHex: RootHex,
|
|
225
226
|
indices: number[]
|
|
226
227
|
): Promise<(Uint8Array | undefined)[] | null> {
|
|
227
|
-
let fd:
|
|
228
|
+
let fd: FileHandle;
|
|
228
229
|
try {
|
|
229
|
-
fd = await
|
|
230
|
+
fd = await open(this.filePath(slot, rootHex), "r");
|
|
230
231
|
} catch (e) {
|
|
231
232
|
if (!isFsNotFoundError(e)) throw e;
|
|
232
233
|
return null;
|
|
@@ -270,7 +271,7 @@ export class FlatFileStore implements IFlatFileStore {
|
|
|
270
271
|
await observeFlatFileStoreOperation(this.metrics, FlatFileStoreOperation.delete, async () => {
|
|
271
272
|
const release = await this.acquireMutationLock(slot);
|
|
272
273
|
try {
|
|
273
|
-
await
|
|
274
|
+
await rm(this.filePath(slot, rootHex), {force: true});
|
|
274
275
|
} finally {
|
|
275
276
|
release();
|
|
276
277
|
}
|
|
@@ -294,7 +295,7 @@ function validateDcolHeader(header: DcolHeader, slot: Slot, rootHex: RootHex): v
|
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
297
|
|
|
297
|
-
async function readExactly(fd:
|
|
298
|
+
async function readExactly(fd: FileHandle, buffer: Uint8Array, position: number): Promise<void> {
|
|
298
299
|
let totalRead = 0;
|
|
299
300
|
while (totalRead < buffer.length) {
|
|
300
301
|
const {bytesRead} = await fd.read(buffer, totalRead, buffer.length - totalRead, position + totalRead);
|
|
@@ -17,5 +17,6 @@ export interface IFlatFileStore {
|
|
|
17
17
|
putDataColumnsBinary(slot: Slot, blockRoot: RootHex, columns: {index: number; data: Uint8Array}[]): Promise<void>;
|
|
18
18
|
|
|
19
19
|
deleteMany(items: {slot: Slot; blockRoot: RootHex}[]): Promise<void>;
|
|
20
|
-
|
|
20
|
+
/** Prunes the oldest slots before `slot`, at most `maxSlots` of them. Returns the pruned slots. */
|
|
21
|
+
pruneBefore(slot: Slot, maxSlots?: number): Promise<Slot[]>;
|
|
21
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type {Dirent} from "node:fs";
|
|
2
|
+
import {readdir} from "node:fs/promises";
|
|
2
3
|
import {Slot} from "@lodestar/types";
|
|
3
4
|
import {isFsNotFoundError} from "./errors.js";
|
|
4
5
|
import {padSlot} from "./path.js";
|
|
@@ -33,9 +34,9 @@ export class SlotIndex {
|
|
|
33
34
|
|
|
34
35
|
async rebuildFromDisk(columnsDir: string): Promise<SlotIndexRebuildStats> {
|
|
35
36
|
this.slots.clear();
|
|
36
|
-
let entries:
|
|
37
|
+
let entries: Dirent[];
|
|
37
38
|
try {
|
|
38
|
-
entries = await
|
|
39
|
+
entries = await readdir(columnsDir, {withFileTypes: true});
|
|
39
40
|
} catch (e) {
|
|
40
41
|
if (!isFsNotFoundError(e)) throw e;
|
|
41
42
|
return {slots: 0, ignoredEntries: 0};
|
|
@@ -14,7 +14,6 @@ export const blobSidecarsWrapperSsz = new ContainerType(
|
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
export type BlobSidecarsWrapper = ValueOf<typeof blobSidecarsWrapperSsz>;
|
|
17
|
-
export const BLOB_SIDECARS_IN_WRAPPER_INDEX = 44;
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* blobSidecarsWrapper by block root (= hash_tree_root(SignedBeaconBlock.message))
|