@lodestar/beacon-node 1.46.0-dev.8fc4e297d2 → 1.46.0-dev.92d84f9b7f
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.map +1 -1
- package/lib/api/impl/beacon/blocks/index.d.ts +1 -1
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/blocks/utils.js.map +1 -1
- package/lib/api/impl/beacon/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/rewards/index.d.ts +1 -1
- package/lib/api/impl/beacon/rewards/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/rewards/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/config/constants.d.ts +1 -0
- package/lib/api/impl/config/constants.d.ts.map +1 -1
- package/lib/api/impl/config/constants.js +2 -1
- package/lib/api/impl/config/constants.js.map +1 -1
- package/lib/api/impl/config/index.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/errors.js.map +1 -1
- package/lib/api/impl/events/index.d.ts +1 -1
- package/lib/api/impl/events/index.d.ts.map +1 -1
- package/lib/api/impl/events/index.js.map +1 -1
- package/lib/api/impl/lightclient/index.d.ts +1 -1
- package/lib/api/impl/lightclient/index.d.ts.map +1 -1
- package/lib/api/impl/lightclient/index.js.map +1 -1
- package/lib/api/impl/lodestar/attesterSlashing.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +2 -3
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/node/index.js.map +1 -1
- package/lib/api/impl/node/utils.js.map +1 -1
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/utils.js.map +1 -1
- package/lib/api/impl/validator/index.js +3 -5
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +1 -1
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/api/rest/activeSockets.js.map +1 -1
- package/lib/api/rest/base.js.map +1 -1
- package/lib/api/rest/index.js.map +1 -1
- package/lib/api/rest/swaggerUI.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +18 -5
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +0 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js +1 -2
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.js +1 -2
- package/lib/chain/archiveStore/interface.js.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +1 -2
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/archiveStore/utils/updateBackfillRange.js.map +1 -1
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/beaconProposerCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.js +1 -2
- package/lib/chain/blocks/blockInput/errors.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +2 -4
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/blockInput/utils.js.map +1 -1
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +1 -2
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.js +1 -2
- package/lib/chain/blocks/payloadEnvelopeInput/types.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.js +3 -6
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js +1 -1
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -1
- package/lib/chain/bls/maybeBatch.js.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +0 -1
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/jobItem.js +1 -2
- package/lib/chain/bls/multithread/jobItem.js.map +1 -1
- package/lib/chain/bls/multithread/types.js +1 -2
- package/lib/chain/bls/multithread/types.js.map +1 -1
- package/lib/chain/bls/multithread/utils.js.map +1 -1
- package/lib/chain/bls/multithread/worker.js.map +1 -1
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/builderCircuitBreaker.js.map +1 -1
- package/lib/chain/chain.d.ts +2 -2
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +32 -11
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +1 -1
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +1 -2
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/attestationError.js +1 -2
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/attesterSlashingError.js +1 -2
- package/lib/chain/errors/attesterSlashingError.js.map +1 -1
- package/lib/chain/errors/blobSidecarError.js +1 -2
- package/lib/chain/errors/blobSidecarError.js.map +1 -1
- package/lib/chain/errors/blockError.js +1 -2
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/blsToExecutionChangeError.js +1 -2
- package/lib/chain/errors/blsToExecutionChangeError.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +1 -2
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +11 -4
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +2 -2
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -2
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/gossipValidation.js +2 -4
- package/lib/chain/errors/gossipValidation.js.map +1 -1
- package/lib/chain/errors/lightClientError.js +2 -4
- package/lib/chain/errors/lightClientError.js.map +1 -1
- package/lib/chain/errors/payloadAttestation.js +1 -2
- package/lib/chain/errors/payloadAttestation.js.map +1 -1
- package/lib/chain/errors/proposerPreferences.js +1 -2
- package/lib/chain/errors/proposerPreferences.js.map +1 -1
- package/lib/chain/errors/proposerSlashingError.js +1 -2
- package/lib/chain/errors/proposerSlashingError.js.map +1 -1
- package/lib/chain/errors/syncCommitteeError.js +1 -2
- package/lib/chain/errors/syncCommitteeError.js.map +1 -1
- package/lib/chain/errors/voluntaryExitError.js +1 -2
- package/lib/chain/errors/voluntaryExitError.js.map +1 -1
- package/lib/chain/forkChoice/index.js +1 -2
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +1 -1
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.js +1 -2
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +29 -0
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/lightClient/proofs.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +5 -6
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.js.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
- package/lib/chain/opPools/types.js +2 -4
- package/lib/chain/opPools/types.js.map +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +1 -1
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +7 -10
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/produceBlock/validateBlobsAndKzgCommitments.js.map +1 -1
- package/lib/chain/regen/errors.js +1 -2
- package/lib/chain/regen/errors.js.map +1 -1
- package/lib/chain/regen/interface.js +2 -4
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/reprocess.js +1 -2
- package/lib/chain/reprocess.js.map +1 -1
- package/lib/chain/seenCache/seenAggregateAndProof.js.map +1 -1
- package/lib/chain/seenCache/seenAttestationData.js +1 -2
- package/lib/chain/seenCache/seenAttestationData.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
- package/lib/chain/seenCache/seenCommittee.js.map +1 -1
- package/lib/chain/seenCache/seenCommitteeContribution.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +6 -5
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.js +16 -8
- package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +3 -3
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.js +1 -2
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/datastore/db.js.map +1 -1
- package/lib/chain/stateCache/datastore/file.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/mapMetrics.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +45 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.js +1 -2
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -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 +101 -25
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
- package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerPreferences.js +8 -8
- package/lib/chain/validation/proposerPreferences.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/selectionProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.js +2 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/constants/network.js +2 -4
- package/lib/constants/network.js.map +1 -1
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/buckets.d.ts +23 -23
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +1 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/attesterSlashing.js.map +1 -1
- package/lib/db/repositories/backfilledRanges.js.map +1 -1
- package/lib/db/repositories/blobSidecars.js.map +1 -1
- package/lib/db/repositories/blobSidecarsArchive.js.map +1 -1
- package/lib/db/repositories/block.js.map +1 -1
- package/lib/db/repositories/blockArchive.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
- package/lib/db/repositories/blsToExecutionChange.js.map +1 -1
- package/lib/db/repositories/checkpointState.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelope.js.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
- package/lib/db/repositories/lightclientBestUpdate.js.map +1 -1
- package/lib/db/repositories/lightclientCheckpointHeader.js.map +1 -1
- package/lib/db/repositories/lightclientSyncCommittee.js.map +1 -1
- package/lib/db/repositories/lightclientSyncCommitteeWitness.js.map +1 -1
- package/lib/db/repositories/proposerSlashing.js.map +1 -1
- package/lib/db/repositories/stateArchive.js.map +1 -1
- package/lib/db/repositories/stateArchiveIndex.js.map +1 -1
- package/lib/db/repositories/voluntaryExit.js.map +1 -1
- package/lib/execution/builder/cache.js.map +1 -1
- package/lib/execution/builder/http.js +1 -2
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/execution/builder/index.js.map +1 -1
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +1 -1
- package/lib/execution/engine/interface.js +2 -4
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.d.ts +13 -10
- package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.js +1 -2
- package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
- package/lib/execution/engine/jwt.js.map +1 -1
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/types.js +1 -1
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts +1 -1
- package/lib/execution/engine/utils.d.ts.map +1 -1
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +2 -2
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +1 -1
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/metrics/nodeJsMetrics.js +1 -1
- package/lib/metrics/nodeJsMetrics.js.map +1 -1
- package/lib/metrics/server/http.d.ts +1 -1
- package/lib/metrics/server/http.d.ts.map +1 -1
- package/lib/metrics/server/http.js.map +1 -1
- package/lib/metrics/utils/avgMinMax.js.map +1 -1
- package/lib/metrics/utils/gauge.js.map +1 -1
- package/lib/metrics/utils/registryMetricCreator.js.map +1 -1
- package/lib/monitoring/clientStats.js.map +1 -1
- package/lib/monitoring/properties.js.map +1 -1
- package/lib/monitoring/service.js.map +1 -1
- package/lib/monitoring/system.d.ts.map +1 -1
- package/lib/monitoring/system.js.map +1 -1
- package/lib/monitoring/types.js +2 -4
- package/lib/monitoring/types.js.map +1 -1
- package/lib/network/core/events.d.ts.map +1 -1
- package/lib/network/core/events.js +2 -4
- package/lib/network/core/events.js.map +1 -1
- package/lib/network/core/metrics.d.ts +7 -6
- package/lib/network/core/metrics.d.ts.map +1 -1
- package/lib/network/core/metrics.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +1 -1
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +2 -7
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/discv5/index.d.ts +1 -1
- package/lib/network/discv5/index.d.ts.map +1 -1
- package/lib/network/discv5/index.js +1 -4
- package/lib/network/discv5/index.js.map +1 -1
- package/lib/network/discv5/utils.js +1 -2
- package/lib/network/discv5/utils.js.map +1 -1
- package/lib/network/discv5/worker.js.map +1 -1
- package/lib/network/events.d.ts.map +1 -1
- package/lib/network/events.js +2 -4
- package/lib/network/events.js.map +1 -1
- package/lib/network/forks.js.map +1 -1
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/errors.js.map +1 -1
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.js +2 -4
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/metrics.d.ts +14 -12
- package/lib/network/gossip/metrics.d.ts.map +1 -1
- package/lib/network/gossip/metrics.js.map +1 -1
- package/lib/network/gossip/scoringParameters.d.ts +1 -1
- package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +12 -12
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/libp2p/error.js +1 -2
- package/lib/network/libp2p/error.js.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +2 -9
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/metadata.js +2 -4
- package/lib/network/metadata.js.map +1 -1
- package/lib/network/network.d.ts +1 -1
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/peers/client.js +1 -2
- package/lib/network/peers/client.js.map +1 -1
- package/lib/network/peers/datastore.d.ts +4 -1
- package/lib/network/peers/datastore.d.ts.map +1 -1
- package/lib/network/peers/datastore.js +1 -1
- package/lib/network/peers/datastore.js.map +1 -1
- package/lib/network/peers/discover.d.ts +7 -0
- package/lib/network/peers/discover.d.ts.map +1 -1
- package/lib/network/peers/discover.js +2 -4
- package/lib/network/peers/discover.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts +1 -0
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/peersData.js +1 -2
- package/lib/network/peers/peersData.js.map +1 -1
- package/lib/network/peers/score/interface.js +2 -4
- package/lib/network/peers/score/interface.js.map +1 -1
- package/lib/network/peers/score/score.js.map +1 -1
- package/lib/network/peers/score/store.js.map +1 -1
- package/lib/network/peers/score/utils.js.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.js +1 -2
- package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
- package/lib/network/peers/utils/enrSubnetsDeserialize.js.map +1 -1
- package/lib/network/peers/utils/getConnectedPeerIds.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +1 -2
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/peers/utils/subnetMap.js.map +1 -1
- package/lib/network/processor/aggregatorTracker.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipQueues/indexed.js.map +1 -1
- package/lib/network/processor/gossipQueues/linear.js.map +1 -1
- package/lib/network/processor/gossipQueues/types.js +2 -4
- package/lib/network/processor/gossipQueues/types.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +4 -5
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByHead.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientBootstrap.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientFinalityUpdate.js +1 -1
- package/lib/network/reqresp/handlers/lightClientFinalityUpdate.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientOptimisticUpdate.js +1 -1
- package/lib/network/reqresp/handlers/lightClientOptimisticUpdate.js.map +1 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js +6 -2
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js.map +1 -1
- package/lib/network/reqresp/interface.js +1 -2
- package/lib/network/reqresp/interface.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +35 -9
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.js +1 -1
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.js +2 -4
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/network/reqresp/utils/collect.js.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +1 -2
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts.map +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
- package/lib/network/statusCache.js.map +1 -1
- package/lib/network/subnets/attnetsService.js +1 -2
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/network/subnets/interface.js.map +1 -1
- package/lib/network/subnets/syncnetsService.d.ts.map +1 -1
- package/lib/network/subnets/syncnetsService.js.map +1 -1
- package/lib/network/subnets/util.js.map +1 -1
- package/lib/network/util.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +1 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.js.map +1 -1
- package/lib/node/utils/interop/deposits.js.map +1 -1
- package/lib/node/utils/interop/state.d.ts +1 -1
- package/lib/node/utils/interop/state.d.ts.map +1 -1
- package/lib/node/utils/interop/state.js.map +1 -1
- package/lib/node/utils/lightclient.js.map +1 -1
- package/lib/node/utils/state.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +7 -0
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +3 -6
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/backfill/errors.js +1 -2
- package/lib/sync/backfill/errors.js.map +1 -1
- package/lib/sync/backfill/verify.js.map +1 -1
- package/lib/sync/constants.d.ts +6 -5
- package/lib/sync/constants.d.ts.map +1 -1
- package/lib/sync/constants.js +6 -5
- package/lib/sync/constants.js.map +1 -1
- package/lib/sync/interface.js +1 -2
- package/lib/sync/interface.js.map +1 -1
- package/lib/sync/range/batch.d.ts +10 -1
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +30 -14
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +10 -0
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +31 -17
- 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 +2 -4
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/range/utils/batches.d.ts +18 -0
- package/lib/sync/range/utils/batches.d.ts.map +1 -1
- package/lib/sync/range/utils/batches.js +38 -0
- package/lib/sync/range/utils/batches.js.map +1 -1
- package/lib/sync/range/utils/chainTarget.js.map +1 -1
- package/lib/sync/range/utils/hashBlocks.js.map +1 -1
- package/lib/sync/range/utils/peerBalancer.js.map +1 -1
- package/lib/sync/range/utils/updateChains.js.map +1 -1
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/types.js +3 -6
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +23 -0
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +4 -4
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +1 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +7 -7
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +1 -2
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
- package/lib/sync/utils/rateLimit.js.map +1 -1
- package/lib/sync/utils/remoteSyncType.d.ts.map +1 -1
- package/lib/sync/utils/remoteSyncType.js +2 -4
- package/lib/sync/utils/remoteSyncType.js.map +1 -1
- package/lib/util/address.js.map +1 -1
- package/lib/util/array.js.map +1 -1
- package/lib/util/asyncIterableToEvents.js +1 -2
- package/lib/util/asyncIterableToEvents.js.map +1 -1
- package/lib/util/binarySearch.js.map +1 -1
- package/lib/util/bitArray.js +1 -2
- package/lib/util/bitArray.js.map +1 -1
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/bufferPool.js +1 -2
- package/lib/util/bufferPool.js.map +1 -1
- package/lib/util/chunkify.js.map +1 -1
- package/lib/util/clock.js +1 -2
- package/lib/util/clock.js.map +1 -1
- package/lib/util/dataColumns.js +2 -4
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/dependentRoot.js.map +1 -1
- package/lib/util/enum.js.map +1 -1
- package/lib/util/error.js.map +1 -1
- package/lib/util/eventLoop.js.map +1 -1
- package/lib/util/execution.js +1 -2
- package/lib/util/execution.js.map +1 -1
- package/lib/util/file.js.map +1 -1
- package/lib/util/forkChoice.js.map +1 -1
- package/lib/util/forkName.js.map +1 -1
- package/lib/util/graffiti.js.map +1 -1
- package/lib/util/hex.js.map +1 -1
- package/lib/util/ip.js.map +1 -1
- package/lib/util/itTrigger.js.map +1 -1
- package/lib/util/map.js.map +1 -1
- package/lib/util/metadata.js.map +1 -1
- package/lib/util/multifork.js.map +1 -1
- package/lib/util/numpy.js.map +1 -1
- package/lib/util/peerId.js.map +1 -1
- package/lib/util/profile.d.ts +3 -0
- package/lib/util/profile.d.ts.map +1 -1
- package/lib/util/profile.js +2 -29
- package/lib/util/profile.js.map +1 -1
- package/lib/util/promises.js.map +1 -1
- package/lib/util/queue/errors.js +1 -2
- package/lib/util/queue/errors.js.map +1 -1
- package/lib/util/queue/fnQueue.js.map +1 -1
- package/lib/util/queue/itemQueue.d.ts.map +1 -1
- package/lib/util/queue/itemQueue.js.map +1 -1
- package/lib/util/queue/options.js +1 -2
- package/lib/util/queue/options.js.map +1 -1
- package/lib/util/serializedCache.js.map +1 -1
- package/lib/util/set.js.map +1 -1
- package/lib/util/shuffle.js.map +1 -1
- package/lib/util/sortBy.js.map +1 -1
- package/lib/util/sszBytes.js +1 -1
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/time.js.map +1 -1
- package/lib/util/timeSeries.js.map +1 -1
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/workerEvents.d.ts +1 -1
- package/lib/util/workerEvents.d.ts.map +1 -1
- package/lib/util/workerEvents.js.map +1 -1
- package/lib/util/wrapError.js.map +1 -1
- package/package.json +27 -38
- package/src/api/impl/config/constants.ts +2 -0
- package/src/api/impl/lodestar/index.ts +2 -3
- package/src/api/impl/validator/index.ts +1 -1
- package/src/chain/archiveStore/archiveStore.ts +20 -3
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +0 -1
- package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +1 -1
- package/src/chain/bls/multithread/index.ts +0 -1
- package/src/chain/chain.ts +39 -9
- package/src/chain/errors/executionPayloadBid.ts +12 -4
- package/src/chain/opPools/aggregatedAttestationPool.ts +4 -2
- package/src/chain/prepareNextSlot.ts +1 -1
- package/src/chain/produceBlock/produceBlockBody.ts +5 -5
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +22 -9
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +120 -26
- package/src/chain/validation/proposerPreferences.ts +8 -8
- package/src/chain/validatorMonitor.ts +1 -1
- package/src/execution/engine/interface.ts +1 -1
- package/src/execution/engine/types.ts +1 -1
- package/src/metrics/metrics/lodestar.ts +1 -1
- package/src/metrics/nodeJsMetrics.ts +1 -1
- package/src/network/core/networkCoreWorkerHandler.ts +2 -6
- package/src/network/discv5/index.ts +1 -4
- package/src/network/libp2p/index.ts +2 -10
- package/src/network/peers/datastore.ts +1 -1
- package/src/network/processor/index.ts +2 -1
- package/src/network/reqresp/handlers/lightClientFinalityUpdate.ts +1 -1
- package/src/network/reqresp/handlers/lightClientOptimisticUpdate.ts +1 -1
- package/src/network/reqresp/handlers/lightClientUpdatesByRange.ts +6 -2
- package/src/network/reqresp/protocols.ts +39 -11
- package/src/network/reqresp/rateLimit.ts +1 -1
- package/src/sync/constants.ts +6 -5
- package/src/sync/range/batch.ts +31 -10
- package/src/sync/range/chain.ts +36 -16
- package/src/sync/range/utils/batches.ts +44 -0
- package/src/util/profile.ts +1 -31
- package/src/util/sszBytes.ts +1 -1
- package/lib/bun-wrappers/prometheus-gc-stats.d.ts +0 -2
- package/lib/bun-wrappers/prometheus-gc-stats.d.ts.map +0 -1
- package/lib/bun-wrappers/prometheus-gc-stats.js +0 -8
- package/lib/bun-wrappers/prometheus-gc-stats.js.map +0 -1
- package/lib/network/peers/datastore_bun.d.ts +0 -3
- package/lib/network/peers/datastore_bun.d.ts.map +0 -1
- package/lib/network/peers/datastore_bun.js +0 -3
- package/lib/network/peers/datastore_bun.js.map +0 -1
- package/src/bun-wrappers/prometheus-gc-stats.ts +0 -7
- package/src/network/peers/datastore_bun.ts +0 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {PublicKey} from "@chainsafe/blst";
|
|
2
|
+
import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
3
|
import {PAYLOAD_BUILDER_VERSION} from "@lodestar/params";
|
|
3
4
|
import {
|
|
4
5
|
computeEpochAtSlot,
|
|
@@ -6,15 +7,78 @@ import {
|
|
|
6
7
|
getExecutionPayloadBidSigningRoot,
|
|
7
8
|
isActiveBuilder,
|
|
8
9
|
isGasLimitTargetCompatible,
|
|
10
|
+
isStartSlotOfEpoch,
|
|
9
11
|
isStatePostGloas,
|
|
10
12
|
} from "@lodestar/state-transition";
|
|
11
|
-
import {ValidatorIndex, gloas} from "@lodestar/types";
|
|
13
|
+
import {RootHex, Slot, ValidatorIndex, gloas} from "@lodestar/types";
|
|
12
14
|
import {byteArrayEquals, toHex, toRootHex} from "@lodestar/utils";
|
|
13
15
|
import {getShufflingDependentRoot} from "../../util/dependentRoot.js";
|
|
14
16
|
import {ExecutionPayloadBidError, ExecutionPayloadBidErrorCode, GossipAction} from "../errors/index.js";
|
|
15
17
|
import {IBeaconChain} from "../index.js";
|
|
16
18
|
import {RegenCaller} from "../regen/index.js";
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Relative increment over the current highest bid required to forward a bid, in basis points.
|
|
22
|
+
* With 3%, laddering from 1 gwei to 1 ETH takes ~256 bids given the floor and cap below, see
|
|
23
|
+
* https://github.com/ethereum/consensus-specs/pull/4792#issuecomment-3714553549.
|
|
24
|
+
*/
|
|
25
|
+
const BID_INCREMENT_BPS = 300;
|
|
26
|
+
/**
|
|
27
|
+
* Minimum absolute increment (0.0001 ETH). Covers low bid values where the relative increment
|
|
28
|
+
* is tiny and provides weak spam protection.
|
|
29
|
+
*/
|
|
30
|
+
const BID_INCREMENT_FLOOR_GWEI = 100_000;
|
|
31
|
+
/**
|
|
32
|
+
* Maximum absolute increment (0.01 ETH). Bounds the barrier for legitimate competition on
|
|
33
|
+
* high value blocks where the relative increment would suppress closely competing bids.
|
|
34
|
+
*/
|
|
35
|
+
const BID_INCREMENT_CAP_GWEI = 10_000_000;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Return the minimum value a new bid must have to be forwarded given the current highest bid.
|
|
39
|
+
* Division before multiplication to stay within safe integer range for max gwei values.
|
|
40
|
+
*/
|
|
41
|
+
function getMinBidValue(currentHighestBid: number): number {
|
|
42
|
+
const relativeIncrement = Math.floor(currentHighestBid / 10_000) * BID_INCREMENT_BPS;
|
|
43
|
+
const increment = Math.min(Math.max(BID_INCREMENT_FLOOR_GWEI, relativeIncrement), BID_INCREMENT_CAP_GWEI);
|
|
44
|
+
return currentHighestBid + increment;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check whether a bid builds on one of the paths compatible with the local head branch.
|
|
49
|
+
*
|
|
50
|
+
* Building directly on the parent is allowed for proposer-boost reorgs outside epoch boundaries.
|
|
51
|
+
* Otherwise the bid must build on the local head's full or empty payload variant, as selected for its slot.
|
|
52
|
+
*/
|
|
53
|
+
function isBidCompatibleWithHead(
|
|
54
|
+
forkChoice: IForkChoice,
|
|
55
|
+
head: ProtoBlock,
|
|
56
|
+
bidSlot: Slot,
|
|
57
|
+
bidParentBlockRoot: RootHex,
|
|
58
|
+
bidParentBlockHash: RootHex
|
|
59
|
+
): boolean {
|
|
60
|
+
const buildsOnParentBlock = bidParentBlockRoot === head.parentRoot;
|
|
61
|
+
const buildsOnParentPayload = bidParentBlockHash === head.parentBlockHash;
|
|
62
|
+
|
|
63
|
+
if (buildsOnParentBlock && buildsOnParentPayload) {
|
|
64
|
+
// The spec allows this at epoch boundaries, but Lodestar does not propagate these bids because validating
|
|
65
|
+
// them requires an epoch transition for a parent state that cannot be used for proposer-boost reorgs.
|
|
66
|
+
return !isStartSlotOfEpoch(bidSlot);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (bidParentBlockRoot !== head.blockRoot) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const buildsOnHeadPayload = bidParentBlockHash === head.executionPayloadBlockHash;
|
|
74
|
+
|
|
75
|
+
if (forkChoice.shouldBuildOnFull(head, bidSlot)) {
|
|
76
|
+
return buildsOnHeadPayload;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return buildsOnParentPayload;
|
|
80
|
+
}
|
|
81
|
+
|
|
18
82
|
export async function validateApiExecutionPayloadBid(
|
|
19
83
|
chain: IBeaconChain,
|
|
20
84
|
signedExecutionPayloadBid: gloas.SignedExecutionPayloadBid
|
|
@@ -34,8 +98,8 @@ async function validateExecutionPayloadBid(
|
|
|
34
98
|
signedExecutionPayloadBid: gloas.SignedExecutionPayloadBid
|
|
35
99
|
): Promise<{proposerIndex: ValidatorIndex}> {
|
|
36
100
|
const bid = signedExecutionPayloadBid.message;
|
|
37
|
-
const
|
|
38
|
-
const
|
|
101
|
+
const bidParentBlockRoot = toRootHex(bid.parentBlockRoot);
|
|
102
|
+
const bidParentBlockHash = toRootHex(bid.parentBlockHash);
|
|
39
103
|
|
|
40
104
|
// [IGNORE] `bid.slot` is the current slot, or the next slot (`bid.slot - 1` is current), allowing for `MAXIMUM_GOSSIP_CLOCK_DISPARITY`.
|
|
41
105
|
if (
|
|
@@ -49,14 +113,40 @@ async function validateExecutionPayloadBid(
|
|
|
49
113
|
});
|
|
50
114
|
}
|
|
51
115
|
|
|
116
|
+
// [IGNORE] The bid is compatible with the current head branch.
|
|
117
|
+
const head = chain.forkChoice.getHead();
|
|
118
|
+
if (!isBidCompatibleWithHead(chain.forkChoice, head, bid.slot, bidParentBlockRoot, bidParentBlockHash)) {
|
|
119
|
+
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
120
|
+
code: ExecutionPayloadBidErrorCode.INCOMPATIBLE_WITH_HEAD,
|
|
121
|
+
slot: bid.slot,
|
|
122
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
123
|
+
parentBlockHash: bidParentBlockHash,
|
|
124
|
+
headBlockRoot: head.blockRoot,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// [IGNORE] this is the first signed bid seen with a valid signature from the given builder for
|
|
129
|
+
// the tuple `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
|
|
130
|
+
// Entries are only added after signature verification, so known tuples can be dropped before
|
|
131
|
+
// state regeneration and the other expensive validation steps.
|
|
132
|
+
if (chain.seenExecutionPayloadBids.isKnown(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)) {
|
|
133
|
+
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
134
|
+
code: ExecutionPayloadBidErrorCode.BID_ALREADY_KNOWN,
|
|
135
|
+
builderIndex: bid.builderIndex,
|
|
136
|
+
slot: bid.slot,
|
|
137
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
138
|
+
parentBlockHash: bidParentBlockHash,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
52
142
|
// [IGNORE] `bid.parent_block_root` is the hash tree root of a known beacon block in fork choice.
|
|
53
143
|
// Moved earlier than the spec ordering so we can derive the proposer dependent root for the
|
|
54
144
|
// proposer-preferences lookup below from a known fork-choice block.
|
|
55
|
-
const parentBlock = chain.forkChoice.getBlockHexDefaultStatus(
|
|
145
|
+
const parentBlock = chain.forkChoice.getBlockHexDefaultStatus(bidParentBlockRoot);
|
|
56
146
|
if (parentBlock === null) {
|
|
57
147
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
58
148
|
code: ExecutionPayloadBidErrorCode.UNKNOWN_BLOCK_ROOT,
|
|
59
|
-
parentBlockRoot:
|
|
149
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
60
150
|
});
|
|
61
151
|
}
|
|
62
152
|
|
|
@@ -95,7 +185,7 @@ async function validateExecutionPayloadBid(
|
|
|
95
185
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
96
186
|
code: ExecutionPayloadBidErrorCode.NO_MATCHING_PROPOSER_PREFERENCES,
|
|
97
187
|
slot: bid.slot,
|
|
98
|
-
parentBlockRoot:
|
|
188
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
99
189
|
dependentRoot: "unknown",
|
|
100
190
|
});
|
|
101
191
|
}
|
|
@@ -105,7 +195,7 @@ async function validateExecutionPayloadBid(
|
|
|
105
195
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
106
196
|
code: ExecutionPayloadBidErrorCode.NO_MATCHING_PROPOSER_PREFERENCES,
|
|
107
197
|
slot: bid.slot,
|
|
108
|
-
parentBlockRoot:
|
|
198
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
109
199
|
dependentRoot: dependentRootHex,
|
|
110
200
|
});
|
|
111
201
|
}
|
|
@@ -116,7 +206,7 @@ async function validateExecutionPayloadBid(
|
|
|
116
206
|
.catch(() => {
|
|
117
207
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
118
208
|
code: ExecutionPayloadBidErrorCode.UNKNOWN_BLOCK_ROOT,
|
|
119
|
-
parentBlockRoot:
|
|
209
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
120
210
|
});
|
|
121
211
|
});
|
|
122
212
|
|
|
@@ -157,7 +247,7 @@ async function validateExecutionPayloadBid(
|
|
|
157
247
|
}
|
|
158
248
|
|
|
159
249
|
// [REJECT] `bid.execution_payment` is zero.
|
|
160
|
-
if (bid.executionPayment !==
|
|
250
|
+
if (bid.executionPayment !== 0n) {
|
|
161
251
|
throw new ExecutionPayloadBidError(GossipAction.REJECT, {
|
|
162
252
|
code: ExecutionPayloadBidErrorCode.NON_ZERO_EXECUTION_PAYMENT,
|
|
163
253
|
builderIndex: bid.builderIndex,
|
|
@@ -181,11 +271,11 @@ async function validateExecutionPayloadBid(
|
|
|
181
271
|
// payload's hash) and EMPTY parents (EMPTY/PENDING variants carry the inherited parent
|
|
182
272
|
// payload's hash, since the new block doesn't have its own payload). Variant carries the
|
|
183
273
|
// executed payload's gas_limit, which we use as `parent_gas_limit` below.
|
|
184
|
-
const parentPayloadVariant = chain.forkChoice.getBlockHexAndBlockHash(
|
|
274
|
+
const parentPayloadVariant = chain.forkChoice.getBlockHexAndBlockHash(bidParentBlockRoot, bidParentBlockHash);
|
|
185
275
|
if (parentPayloadVariant === null || parentPayloadVariant.executionPayloadBlockHash === null) {
|
|
186
276
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
187
277
|
code: ExecutionPayloadBidErrorCode.UNKNOWN_PARENT_BLOCK_HASH,
|
|
188
|
-
parentBlockHash:
|
|
278
|
+
parentBlockHash: bidParentBlockHash,
|
|
189
279
|
});
|
|
190
280
|
}
|
|
191
281
|
|
|
@@ -193,7 +283,7 @@ async function validateExecutionPayloadBid(
|
|
|
193
283
|
// where `parent_gas_limit` is the `gas_limit` of the parent execution payload and
|
|
194
284
|
// `target_gas_limit` is `proposer_preferences.target_gas_limit`.
|
|
195
285
|
const bidGasLimit = bid.gasLimit;
|
|
196
|
-
const parentGasLimit = parentPayloadVariant.executionPayloadGasLimit;
|
|
286
|
+
const parentGasLimit = BigInt(parentPayloadVariant.executionPayloadGasLimit);
|
|
197
287
|
const targetGasLimit = proposerPreferences.message.targetGasLimit;
|
|
198
288
|
if (!isGasLimitTargetCompatible(parentGasLimit, bidGasLimit, targetGasLimit)) {
|
|
199
289
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
@@ -218,21 +308,13 @@ async function validateExecutionPayloadBid(
|
|
|
218
308
|
});
|
|
219
309
|
}
|
|
220
310
|
|
|
221
|
-
// [IGNORE] this is the first signed bid seen with a valid signature from the given builder for this slot.
|
|
222
|
-
if (chain.seenExecutionPayloadBids.isKnown(bid.slot, bid.builderIndex)) {
|
|
223
|
-
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
224
|
-
code: ExecutionPayloadBidErrorCode.BID_ALREADY_KNOWN,
|
|
225
|
-
builderIndex: bid.builderIndex,
|
|
226
|
-
slot: bid.slot,
|
|
227
|
-
parentBlockRoot: parentBlockRootHex,
|
|
228
|
-
parentBlockHash: parentBlockHashHex,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
|
|
232
311
|
// [IGNORE] this bid is the highest value bid seen for the tuple
|
|
233
312
|
// `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
|
|
234
|
-
|
|
235
|
-
|
|
313
|
+
// As a DoS prevention measure, the bid must also exceed the current highest bid by a minimum
|
|
314
|
+
// increment, see https://github.com/ethereum/consensus-specs/pull/4831. This prevents spam
|
|
315
|
+
// from builders submitting numerous bids with minimal value increments.
|
|
316
|
+
const bestBid = chain.executionPayloadBidPool.getBestBid(bid.slot, bidParentBlockHash, bidParentBlockRoot);
|
|
317
|
+
if (bestBid !== null && bid.value < getMinBidValue(bestBid.message.value)) {
|
|
236
318
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
237
319
|
code: ExecutionPayloadBidErrorCode.BID_TOO_LOW,
|
|
238
320
|
bidValue: bid.value,
|
|
@@ -276,8 +358,20 @@ async function validateExecutionPayloadBid(
|
|
|
276
358
|
});
|
|
277
359
|
}
|
|
278
360
|
|
|
361
|
+
// Repeat the seen check after the awaited signature verification to prevent concurrent bids
|
|
362
|
+
// for the same builder and tuple from both passing validation.
|
|
363
|
+
if (chain.seenExecutionPayloadBids.isKnown(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)) {
|
|
364
|
+
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
365
|
+
code: ExecutionPayloadBidErrorCode.BID_ALREADY_KNOWN,
|
|
366
|
+
builderIndex: bid.builderIndex,
|
|
367
|
+
slot: bid.slot,
|
|
368
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
369
|
+
parentBlockHash: bidParentBlockHash,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
279
373
|
// Valid
|
|
280
|
-
chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex);
|
|
374
|
+
chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot);
|
|
281
375
|
|
|
282
376
|
return {proposerIndex: proposerPreferences.message.validatorIndex};
|
|
283
377
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
|
-
import {GENESIS_SLOT, MIN_SEED_LOOKAHEAD, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
|
+
import {GENESIS_EPOCH, GENESIS_SLOT, MIN_SEED_LOOKAHEAD, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
3
|
import {
|
|
4
4
|
computeEpochAtSlot,
|
|
5
5
|
computeStartSlotAtEpoch,
|
|
@@ -24,9 +24,10 @@ export async function validateGossipProposerPreferences(
|
|
|
24
24
|
const dependentRootHex = toRootHex(dependentRoot);
|
|
25
25
|
const proposalEpoch = computeEpochAtSlot(proposalSlot);
|
|
26
26
|
|
|
27
|
-
// [IGNORE] `preferences.proposal_slot` is within the proposer lookahead
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
// [IGNORE] `preferences.proposal_slot` is within the proposer lookahead,
|
|
28
|
+
// allowing for `MAXIMUM_GOSSIP_CLOCK_DISPARITY`.
|
|
29
|
+
const currentEpoch = computeEpochAtSlot(chain.clock.currentSlotWithGossipDisparity);
|
|
30
|
+
if (proposalEpoch > currentEpoch + MIN_SEED_LOOKAHEAD) {
|
|
30
31
|
throw new ProposerPreferencesError(GossipAction.IGNORE, {
|
|
31
32
|
code: ProposerPreferencesErrorCode.INVALID_EPOCH,
|
|
32
33
|
proposalSlot,
|
|
@@ -36,12 +37,11 @@ export async function validateGossipProposerPreferences(
|
|
|
36
37
|
|
|
37
38
|
// [IGNORE] `preferences.proposal_slot` has not already passed, i.e. `proposal_slot > current_slot`,
|
|
38
39
|
// allowing for `MAXIMUM_GOSSIP_CLOCK_DISPARITY`.
|
|
39
|
-
|
|
40
|
-
if (proposalSlot <= currentSlot) {
|
|
40
|
+
if (chain.clock.msFromSlot(proposalSlot) > chain.config.MAXIMUM_GOSSIP_CLOCK_DISPARITY) {
|
|
41
41
|
throw new ProposerPreferencesError(GossipAction.IGNORE, {
|
|
42
42
|
code: ProposerPreferencesErrorCode.PROPOSAL_SLOT_PASSED,
|
|
43
43
|
proposalSlot,
|
|
44
|
-
currentSlot,
|
|
44
|
+
currentSlot: chain.clock.currentSlot,
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -55,7 +55,7 @@ export async function validateGossipProposerPreferences(
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const dependentEpoch = proposalEpoch - MIN_SEED_LOOKAHEAD;
|
|
58
|
+
const dependentEpoch = Math.max(GENESIS_EPOCH, proposalEpoch - MIN_SEED_LOOKAHEAD);
|
|
59
59
|
const dependentRootSlot = getDependentRootSlot(dependentEpoch);
|
|
60
60
|
|
|
61
61
|
// [REJECT] The slot of the block with root `preferences.dependent_root` is strictly less than
|
|
@@ -469,7 +469,7 @@ export function createValidatorMonitor(
|
|
|
469
469
|
proposerIndex,
|
|
470
470
|
src,
|
|
471
471
|
builderIndex: bid.builderIndex,
|
|
472
|
-
gasLimit: bid.gasLimit,
|
|
472
|
+
gasLimit: Number(bid.gasLimit),
|
|
473
473
|
value: bid.value.toString(),
|
|
474
474
|
parentBlockRoot: toRootHex(bid.parentBlockRoot),
|
|
475
475
|
parentBlockHash: toRootHex(bid.parentBlockHash),
|
|
@@ -98,7 +98,7 @@ export type PayloadAttributes = {
|
|
|
98
98
|
withdrawals?: capella.Withdrawal[];
|
|
99
99
|
parentBeaconBlockRoot?: Uint8Array;
|
|
100
100
|
slotNumber?: number; // EIP-7843
|
|
101
|
-
targetGasLimit?:
|
|
101
|
+
targetGasLimit?: bigint; // GLOAS (PayloadAttributesV4, execution-apis#796)
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
export type VersionedHashes = Uint8Array[];
|
|
@@ -458,7 +458,7 @@ export function deserializePayloadAttributes(data: PayloadAttributesRpc): Payloa
|
|
|
458
458
|
withdrawals: data.withdrawals?.map((withdrawal) => deserializeWithdrawal(withdrawal)),
|
|
459
459
|
parentBeaconBlockRoot: data.parentBeaconBlockRoot ? dataToBytes(data.parentBeaconBlockRoot, 32) : undefined,
|
|
460
460
|
slotNumber: data.slotNumber !== undefined ? quantityToNum(data.slotNumber) : undefined,
|
|
461
|
-
targetGasLimit: data.targetGasLimit !== undefined ?
|
|
461
|
+
targetGasLimit: data.targetGasLimit !== undefined ? quantityToBigint(data.targetGasLimit) : undefined,
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
464
|
|
|
@@ -424,7 +424,7 @@ export function createLodestarMetrics(
|
|
|
424
424
|
jobWaitTime: register.histogram({
|
|
425
425
|
name: "lodestar_bls_thread_pool_queue_job_wait_time_seconds",
|
|
426
426
|
help: "Time from job added to the queue to starting the job in seconds",
|
|
427
|
-
buckets: [0.01, 0.02, 0.
|
|
427
|
+
buckets: [0.01, 0.02, 0.1, 0.3, 0.5, 1],
|
|
428
428
|
}),
|
|
429
429
|
queueLength: register.gauge({
|
|
430
430
|
name: "lodestar_bls_thread_pool_queue_length",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {Registry, collectDefaultMetrics} from "prom-client";
|
|
2
|
-
import {gcStats} from "
|
|
2
|
+
import {gcStats} from "@chainsafe/prometheus-gc-stats";
|
|
3
3
|
|
|
4
4
|
export function collectNodeJSMetrics(register: Registry, prefix?: string): () => void {
|
|
5
5
|
collectDefaultMetrics({
|
|
@@ -132,10 +132,6 @@ export class WorkerNetworkCore implements INetworkCore {
|
|
|
132
132
|
|
|
133
133
|
const workerOpts: ConstructorParameters<typeof Worker>[1] = {
|
|
134
134
|
workerData,
|
|
135
|
-
};
|
|
136
|
-
if (globalThis.Bun) {
|
|
137
|
-
workerOpts.suppressTranspileTS = true;
|
|
138
|
-
} else {
|
|
139
135
|
/**
|
|
140
136
|
* maxYoungGenerationSizeMb defaults to 152mb through the cli option defaults.
|
|
141
137
|
* That default value was determined via https://github.com/ChainSafe/lodestar/issues/2115 and
|
|
@@ -147,8 +143,8 @@ export class WorkerNetworkCore implements INetworkCore {
|
|
|
147
143
|
* showed that there is a pretty big window of "correct" values but we can always tune as
|
|
148
144
|
* necessary
|
|
149
145
|
*/
|
|
150
|
-
|
|
151
|
-
}
|
|
146
|
+
resourceLimits: {maxYoungGenerationSizeMb: opts.maxYoungGenerationSizeMb},
|
|
147
|
+
};
|
|
152
148
|
|
|
153
149
|
const worker = new Worker(path.join(workerDir, "networkCoreWorker.js"), workerOpts);
|
|
154
150
|
|
|
@@ -51,10 +51,7 @@ export class Discv5Worker extends (EventEmitter as {new (): StrictEventEmitter<E
|
|
|
51
51
|
loggerOpts: opts.logger.toOpts(),
|
|
52
52
|
genesisTime: opts.genesisTime,
|
|
53
53
|
};
|
|
54
|
-
const worker = new Worker("./worker.js", {
|
|
55
|
-
suppressTranspileTS: Boolean(globalThis.Bun),
|
|
56
|
-
workerData,
|
|
57
|
-
} as ConstructorParameters<typeof Worker>[1]);
|
|
54
|
+
const worker = new Worker("./worker.js", {workerData} as ConstructorParameters<typeof Worker>[1]);
|
|
58
55
|
|
|
59
56
|
const workerApi = await spawn<Discv5WorkerApi>(worker, {
|
|
60
57
|
// A Lodestar Node may do very expensive task at start blocking the event loop and causing
|
|
@@ -9,7 +9,7 @@ import {Libp2pInit, createLibp2p} from "libp2p";
|
|
|
9
9
|
import {Registry} from "prom-client";
|
|
10
10
|
import {ENR} from "@chainsafe/enr";
|
|
11
11
|
import {noise} from "@chainsafe/libp2p-noise";
|
|
12
|
-
import {
|
|
12
|
+
import {defaultCrypto} from "@chainsafe/libp2p-noise/crypto";
|
|
13
13
|
import {quic} from "@chainsafe/libp2p-quic";
|
|
14
14
|
import {Libp2p, LodestarComponents} from "../interface.js";
|
|
15
15
|
import {NetworkOptions, defaultNetworkOptions} from "../options.js";
|
|
@@ -111,14 +111,6 @@ export async function createNodeJsLibp2p(
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
const noiseCrypto = {
|
|
115
|
-
...defaultCrypto,
|
|
116
|
-
};
|
|
117
|
-
if (globalThis.Bun) {
|
|
118
|
-
noiseCrypto.chaCha20Poly1305Decrypt = asCrypto.chaCha20Poly1305Decrypt;
|
|
119
|
-
noiseCrypto.chaCha20Poly1305Encrypt = asCrypto.chaCha20Poly1305Encrypt;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
114
|
return createLibp2p({
|
|
123
115
|
privateKey,
|
|
124
116
|
nodeInfo: {
|
|
@@ -130,7 +122,7 @@ export async function createNodeJsLibp2p(
|
|
|
130
122
|
listen: localMultiaddrs,
|
|
131
123
|
announce: [],
|
|
132
124
|
},
|
|
133
|
-
connectionEncrypters: [noise({crypto:
|
|
125
|
+
connectionEncrypters: [noise({crypto: defaultCrypto})],
|
|
134
126
|
transports,
|
|
135
127
|
streamMuxers: [mplex({disconnectThreshold})],
|
|
136
128
|
peerDiscovery,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {AbortOptions} from "@libp2p/interface";
|
|
2
2
|
import {BaseDatastore} from "datastore-core";
|
|
3
|
+
import {LevelDatastore} from "datastore-level";
|
|
3
4
|
import {Key, KeyQuery, Pair, Query} from "interface-datastore";
|
|
4
|
-
import {LevelDatastore} from "#datastore-wrapper";
|
|
5
5
|
|
|
6
6
|
type MemoryItem = {
|
|
7
7
|
lastAccessedMs: number;
|
|
@@ -461,7 +461,8 @@ export class NetworkProcessor {
|
|
|
461
461
|
break;
|
|
462
462
|
}
|
|
463
463
|
case GossipType.execution_payload_bid: {
|
|
464
|
-
//
|
|
464
|
+
// Search for the parent independently of current head compatibility. A bid may arrive
|
|
465
|
+
// before its parent block, so compatibility is checked later during gossip validation.
|
|
465
466
|
const parentBlockRoot = getParentBlockRootFromSignedExecutionPayloadBidSerialized(message.msg.data);
|
|
466
467
|
const parentBlockHash = getParentBlockHashFromSignedExecutionPayloadBidSerialized(message.msg.data);
|
|
467
468
|
if (
|
|
@@ -12,7 +12,7 @@ export async function* onLightClientFinalityUpdate(chain: IBeaconChain): AsyncIt
|
|
|
12
12
|
throw new ResponseError(RespStatus.RESOURCE_UNAVAILABLE, "No latest finality update available");
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const boundary = chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(update.
|
|
15
|
+
const boundary = chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(update.attestedHeader.beacon.slot));
|
|
16
16
|
const type = responseSszTypeByMethod[ReqRespMethod.LightClientFinalityUpdate](boundary.fork, 0);
|
|
17
17
|
yield {
|
|
18
18
|
data: type.serialize(update),
|
|
@@ -12,7 +12,7 @@ export async function* onLightClientOptimisticUpdate(chain: IBeaconChain): Async
|
|
|
12
12
|
throw new ResponseError(RespStatus.RESOURCE_UNAVAILABLE, "No latest optimistic update available");
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const boundary = chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(update.
|
|
15
|
+
const boundary = chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(update.attestedHeader.beacon.slot));
|
|
16
16
|
const type = responseSszTypeByMethod[ReqRespMethod.LightClientOptimisticUpdate](boundary.fork, 0);
|
|
17
17
|
yield {
|
|
18
18
|
data: type.serialize(update),
|
|
@@ -19,11 +19,15 @@ export async function* onLightClientUpdatesByRange(
|
|
|
19
19
|
assertLightClientServer(chain.lightClientServer);
|
|
20
20
|
|
|
21
21
|
const count = Math.min(MAX_REQUEST_LIGHT_CLIENT_UPDATES, requestBody.count);
|
|
22
|
+
if (!Number.isSafeInteger(requestBody.startPeriod)) {
|
|
23
|
+
throw new ResponseError(RespStatus.INVALID_REQUEST, "startPeriod out of range");
|
|
24
|
+
}
|
|
22
25
|
let started = false;
|
|
23
|
-
for (let
|
|
26
|
+
for (let i = 0; i < count; i++) {
|
|
27
|
+
const period = requestBody.startPeriod + i;
|
|
24
28
|
try {
|
|
25
29
|
const update = await chain.lightClientServer.getUpdate(period);
|
|
26
|
-
const boundary = chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(update.
|
|
30
|
+
const boundary = chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(update.attestedHeader.beacon.slot));
|
|
27
31
|
const type = responseSszTypeByMethod[ReqRespMethod.LightClientUpdatesByRange](boundary.fork, 0);
|
|
28
32
|
|
|
29
33
|
yield {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {ForkName} from "@lodestar/params";
|
|
3
|
-
import {ContextBytesFactory, ContextBytesType, Encoding} from "@lodestar/reqresp";
|
|
2
|
+
import {ForkName, MAX_DATA_COLUMN_SIDECAR_SIZE, isForkPostGloas} from "@lodestar/params";
|
|
3
|
+
import {ContextBytesFactory, ContextBytesType, Encoding, TypeSizes} from "@lodestar/reqresp";
|
|
4
4
|
import {rateLimitQuotas} from "./rateLimit.js";
|
|
5
5
|
import {ProtocolNoHandler, ReqRespMethod, Version, requestSszTypeByMethod, responseSszTypeByMethod} from "./types.js";
|
|
6
6
|
|
|
@@ -143,15 +143,43 @@ type ProtocolSummary = {
|
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
function toProtocol(protocol: ProtocolSummary) {
|
|
146
|
-
return (fork: ForkName, config: BeaconConfig): ProtocolNoHandler =>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
return (fork: ForkName, config: BeaconConfig): ProtocolNoHandler => {
|
|
147
|
+
const requestType = requestSszTypeByMethod(fork, config)[protocol.method];
|
|
148
|
+
return {
|
|
149
|
+
method: protocol.method,
|
|
150
|
+
version: protocol.version,
|
|
151
|
+
encoding: Encoding.SSZ_SNAPPY,
|
|
152
|
+
contextBytes: toContextBytes(protocol.contextBytesType, config),
|
|
153
|
+
inboundRateLimits: rateLimitQuotas(fork, config)[protocol.method],
|
|
154
|
+
requestSizes: requestType === null ? null : clampTypeSizes(requestType, protocol.method, fork, config),
|
|
155
|
+
responseSizes: (fork) =>
|
|
156
|
+
clampTypeSizes(responseSszTypeByMethod[protocol.method](fork, protocol.version), protocol.method, fork, config),
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Bound the sizes accepted from the ssz-snappy length-prefix. Gloas progressive containers have broad
|
|
163
|
+
* theoretical SSZ max sizes so the preset p2p bounds must be used instead.
|
|
164
|
+
*
|
|
165
|
+
* The length-prefix must be within the size bounds derived from the payload SSZ type or `MAX_PAYLOAD_SIZE`,
|
|
166
|
+
* whichever is smaller, see
|
|
167
|
+
* https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/phase0/p2p-interface.md#encoding-strategies.
|
|
168
|
+
* Type-specific SSZ bounds supersede the bounds derived from the SSZ type, see
|
|
169
|
+
* https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/gloas/p2p-interface.md#type-specific-ssz-bounds.
|
|
170
|
+
*/
|
|
171
|
+
function clampTypeSizes(type: TypeSizes, method: ReqRespMethod, fork: ForkName, config: BeaconConfig): TypeSizes {
|
|
172
|
+
let typeSpecificBound = config.MAX_PAYLOAD_SIZE;
|
|
173
|
+
if (isForkPostGloas(fork)) {
|
|
174
|
+
switch (method) {
|
|
175
|
+
case ReqRespMethod.DataColumnSidecarsByRange:
|
|
176
|
+
case ReqRespMethod.DataColumnSidecarsByRoot:
|
|
177
|
+
typeSpecificBound = MAX_DATA_COLUMN_SIDECAR_SIZE;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return {minSize: type.minSize, maxSize: Math.min(type.maxSize, typeSpecificBound)};
|
|
155
183
|
}
|
|
156
184
|
|
|
157
185
|
function toContextBytes(type: ContextBytesType, config: BeaconConfig): ContextBytesFactory {
|
|
@@ -87,7 +87,7 @@ export const rateLimitQuotas: (fork: ForkName, config: BeaconConfig) => Record<R
|
|
|
87
87
|
),
|
|
88
88
|
},
|
|
89
89
|
[ReqRespMethod.ExecutionPayloadEnvelopesByRange]: {
|
|
90
|
-
byPeer: {quota: config.
|
|
90
|
+
byPeer: {quota: config.MAX_REQUEST_PAYLOADS, quotaTimeMs: 10_000},
|
|
91
91
|
getRequestCount: getRequestCountFn(
|
|
92
92
|
fork,
|
|
93
93
|
config,
|
package/src/sync/constants.ts
CHANGED
|
@@ -15,12 +15,13 @@ export const MAX_BATCH_DOWNLOAD_ATTEMPTS = 5;
|
|
|
15
15
|
export const RATE_LIMITED_PEER_BACKOFF_MS = 5_000;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Consider batch faulty
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* Consider a batch faulty once its failed processing attempts EXCEED this number, i.e. the batch is
|
|
19
|
+
* processed up to `MAX_BATCH_PROCESSING_ATTEMPTS + 1` times before teardown (the check is `>`, same
|
|
20
|
+
* convention as `MAX_BATCH_DOWNLOAD_ATTEMPTS`).
|
|
21
|
+
* Some processing failures can be caused by a different batch, so range sync classifies the fault
|
|
22
|
+
* before deciding which batch to redownload.
|
|
22
23
|
**/
|
|
23
|
-
export const MAX_BATCH_PROCESSING_ATTEMPTS =
|
|
24
|
+
export const MAX_BATCH_PROCESSING_ATTEMPTS = 3;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Number of slots to offset batches.
|
package/src/sync/range/batch.ts
CHANGED
|
@@ -64,6 +64,7 @@ export type DownloadSuccessState = {
|
|
|
64
64
|
status: BatchStatus.AwaitingProcessing;
|
|
65
65
|
blocks: IBlockInput[];
|
|
66
66
|
payloadEnvelopes: Map<Slot, PayloadEnvelopeInput> | null;
|
|
67
|
+
attempt: Attempt;
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
export type BatchState =
|
|
@@ -589,7 +590,11 @@ export class Batch {
|
|
|
589
590
|
}
|
|
590
591
|
|
|
591
592
|
if (allComplete) {
|
|
592
|
-
|
|
593
|
+
const attempt: Attempt = {
|
|
594
|
+
peers: this.getSuccessfulPeers(),
|
|
595
|
+
hash: hashBlocks(blocks, this.config),
|
|
596
|
+
};
|
|
597
|
+
this.state = {status: BatchStatus.AwaitingProcessing, blocks, payloadEnvelopes: newPayloadEnvelopes, attempt};
|
|
593
598
|
} else {
|
|
594
599
|
this.state = {status: BatchStatus.AwaitingDownload, blocks, payloadEnvelopes: newPayloadEnvelopes};
|
|
595
600
|
this.requests = this.getRequests(blocks);
|
|
@@ -646,15 +651,11 @@ export class Batch {
|
|
|
646
651
|
throw new BatchError(this.wrongStatusErrorType(BatchStatus.AwaitingProcessing));
|
|
647
652
|
}
|
|
648
653
|
|
|
649
|
-
const blocks = this.state
|
|
650
|
-
|
|
651
|
-
const hash = hashBlocks(blocks, this.config); // tracks blocks to report peer on processing error
|
|
652
|
-
// Reset successfulDownloads in case another download attempt needs to be made. When Attempt is successful or not
|
|
653
|
-
// the peers that the data came from will be handled by the Attempt that goes for processing.
|
|
654
|
-
const peers = this.getSuccessfulPeers();
|
|
654
|
+
const {blocks, payloadEnvelopes, attempt} = this.state;
|
|
655
|
+
// No need to track successfulDownloads anymore, the batch goes to Processing status.
|
|
655
656
|
this.successfulDownloads.clear();
|
|
656
|
-
this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt
|
|
657
|
-
return {blocks, payloadEnvelopes, peers};
|
|
657
|
+
this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt};
|
|
658
|
+
return {blocks, payloadEnvelopes, peers: attempt.peers};
|
|
658
659
|
}
|
|
659
660
|
|
|
660
661
|
/**
|
|
@@ -673,6 +674,26 @@ export class Batch {
|
|
|
673
674
|
};
|
|
674
675
|
}
|
|
675
676
|
|
|
677
|
+
/**
|
|
678
|
+
* Processing -> AwaitingProcessing
|
|
679
|
+
*
|
|
680
|
+
* The batch's own blocks are valid but processing failed because a previous batch did not
|
|
681
|
+
* deliver the parent. Keep the downloaded blocks and process them again once the previous
|
|
682
|
+
* batch is repaired.
|
|
683
|
+
*/
|
|
684
|
+
retainForReprocessing(): void {
|
|
685
|
+
if (this.state.status !== BatchStatus.Processing) {
|
|
686
|
+
throw new BatchError(this.wrongStatusErrorType(BatchStatus.Processing));
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
this.state = {
|
|
690
|
+
status: BatchStatus.AwaitingProcessing,
|
|
691
|
+
blocks: this.state.blocks,
|
|
692
|
+
payloadEnvelopes: this.state.payloadEnvelopes,
|
|
693
|
+
attempt: this.state.attempt,
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
|
|
676
697
|
/**
|
|
677
698
|
* Processing -> AwaitingDownload
|
|
678
699
|
*/
|
|
@@ -750,7 +771,7 @@ export enum BatchErrorCode {
|
|
|
750
771
|
INVALID_COUNT = "BATCH_ERROR_INVALID_COUNT",
|
|
751
772
|
MAX_DOWNLOAD_ATTEMPTS = "BATCH_ERROR_MAX_DOWNLOAD_ATTEMPTS",
|
|
752
773
|
MAX_PROCESSING_ATTEMPTS = "BATCH_ERROR_MAX_PROCESSING_ATTEMPTS",
|
|
753
|
-
MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "
|
|
774
|
+
MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "BATCH_ERROR_MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS",
|
|
754
775
|
}
|
|
755
776
|
|
|
756
777
|
type BatchErrorType =
|