@lodestar/beacon-node 1.46.0-dev.9b97bb94f2 → 1.46.0-dev.a03686d0dc
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 +37 -15
- 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 +2 -0
- package/lib/api/impl/config/constants.d.ts.map +1 -1
- package/lib/api/impl/config/constants.js +4 -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.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.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +18 -11
- 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.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.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +3 -3
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +4 -6
- 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 +6 -0
- 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.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js +31 -25
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/utils/polarBearBanner.d.ts +2 -0
- package/lib/chain/blocks/utils/polarBearBanner.d.ts.map +1 -0
- package/lib/chain/blocks/utils/polarBearBanner.js +51 -0
- package/lib/chain/blocks/utils/polarBearBanner.js.map +1 -0
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +21 -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.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 +7 -2
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +55 -0
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +7 -1
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +6 -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.d.ts +2 -0
- package/lib/chain/interface.d.ts.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/options.d.ts +2 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.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 +108 -30
- 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 +23 -17
- 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.d.ts +20 -4
- package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockProposers.js +49 -2
- 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.map +1 -1
- package/lib/chain/validation/block.d.ts +4 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +32 -18
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +21 -16
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts +0 -5
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +74 -26
- 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.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 +16 -2
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +39 -1
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/metrics.js.map +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 +12 -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 +20 -3
- 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.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 +671 -26
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +3 -3
- 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.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 +2 -1
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +11 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/peers/client.js +1 -2
- package/lib/network/peers/client.js.map +1 -1
- package/lib/network/peers/datastore.d.ts +3 -0
- package/lib/network/peers/datastore.d.ts.map +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.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +8 -0
- 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.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +20 -3
- 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 +44 -16
- 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.d.ts +16 -4
- package/lib/sync/range/utils/hashBlocks.d.ts.map +1 -1
- package/lib/sync/range/utils/hashBlocks.js +49 -18
- 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.d.ts +2 -7
- package/lib/util/clock.d.ts.map +1 -1
- package/lib/util/clock.js +3 -9
- 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.js +1 -2
- 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 +8 -2
- package/lib/util/workerEvents.d.ts.map +1 -1
- package/lib/util/workerEvents.js +17 -5
- package/lib/util/workerEvents.js.map +1 -1
- package/lib/util/wrapError.js.map +1 -1
- package/package.json +17 -17
- package/src/api/impl/beacon/blocks/index.ts +65 -16
- package/src/api/impl/config/constants.ts +6 -0
- package/src/api/impl/validator/index.ts +20 -7
- package/src/chain/archiveStore/archiveStore.ts +20 -3
- package/src/chain/blocks/importBlock.ts +3 -2
- package/src/chain/blocks/importExecutionPayload.ts +8 -4
- package/src/chain/blocks/index.ts +7 -0
- package/src/chain/blocks/utils/chainSegment.ts +35 -28
- package/src/chain/blocks/utils/polarBearBanner.ts +50 -0
- package/src/chain/blocks/verifyBlock.ts +28 -2
- package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +1 -1
- package/src/chain/chain.ts +60 -0
- package/src/chain/emitter.ts +7 -0
- package/src/chain/errors/executionPayloadBid.ts +12 -4
- package/src/chain/interface.ts +3 -0
- package/src/chain/opPools/aggregatedAttestationPool.ts +4 -2
- package/src/chain/options.ts +3 -0
- package/src/chain/prepareNextSlot.ts +141 -40
- package/src/chain/produceBlock/produceBlockBody.ts +28 -11
- package/src/chain/seenCache/seenBlockProposers.ts +72 -5
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +22 -9
- package/src/chain/validation/block.ts +41 -19
- package/src/chain/validation/dataColumnSidecar.ts +27 -17
- package/src/chain/validation/executionPayloadBid.ts +91 -27
- 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 +40 -1
- package/src/network/core/networkCore.ts +13 -1
- package/src/network/core/networkCoreWorkerHandler.ts +18 -3
- package/src/network/gossip/topic.ts +4 -2
- package/src/network/network.ts +16 -1
- package/src/network/processor/gossipHandlers.ts +7 -0
- 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/network/reqresp/score.ts +22 -3
- package/src/sync/constants.ts +6 -5
- package/src/sync/range/batch.ts +50 -12
- package/src/sync/range/chain.ts +36 -16
- package/src/sync/range/utils/batches.ts +44 -0
- package/src/sync/range/utils/hashBlocks.ts +56 -21
- package/src/util/clock.ts +2 -7
- package/src/util/sszBytes.ts +1 -1
- package/src/util/workerEvents.ts +18 -6
|
@@ -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,
|
|
@@ -33,9 +33,28 @@ export function onOutgoingReqRespError(e: RequestError, method: ReqRespMethod):
|
|
|
33
33
|
|
|
34
34
|
case RequestErrorCode.DIAL_TIMEOUT:
|
|
35
35
|
case RequestErrorCode.DIAL_ERROR:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
// `RequestError` renders `e.message` as just the error code (see `renderErrorMessage`), so the
|
|
37
|
+
// multistream "protocol selection failed" text is only on the wrapped inner error, which is
|
|
38
|
+
// available on `DIAL_ERROR` via `e.type.error` (`DIAL_TIMEOUT` carries no inner error).
|
|
39
|
+
if (
|
|
40
|
+
e.type.code === RequestErrorCode.DIAL_ERROR &&
|
|
41
|
+
e.type.error.message.includes(multiStreamSelectErrorCodes.protocolSelectionFailed)
|
|
42
|
+
) {
|
|
43
|
+
// Peer does not support the protocol, a real incompatibility rather than a transient
|
|
44
|
+
// failure, so keep the stronger penalty (Fatal for Ping, as before).
|
|
45
|
+
return method === ReqRespMethod.Ping ? PeerAction.Fatal : PeerAction.LowToleranceError;
|
|
46
|
+
}
|
|
47
|
+
switch (method) {
|
|
48
|
+
// Ping and Status are liveness probes; their dial timeouts are dominated by transient
|
|
49
|
+
// network congestion rather than peer misbehavior, so penalize leniently to avoid
|
|
50
|
+
// self-inflicted peer starvation (https://github.com/ChainSafe/lodestar/issues/9562),
|
|
51
|
+
// while still applying some penalty so genuinely dead peers eventually free the slot.
|
|
52
|
+
case ReqRespMethod.Ping:
|
|
53
|
+
case ReqRespMethod.Status:
|
|
54
|
+
return PeerAction.HighToleranceError;
|
|
55
|
+
default:
|
|
56
|
+
return PeerAction.LowToleranceError;
|
|
57
|
+
}
|
|
39
58
|
// TODO: Detect SSZDecodeError and return PeerAction.Fatal
|
|
40
59
|
|
|
41
60
|
case RequestErrorCode.RESP_TIMEOUT:
|
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
|
@@ -5,6 +5,7 @@ import {LodestarError, byteArrayEquals, prettyPrintIndices, toRootHex} from "@lo
|
|
|
5
5
|
import {isBlockInputColumns} from "../../chain/blocks/blockInput/blockInput.js";
|
|
6
6
|
import {IBlockInput} from "../../chain/blocks/blockInput/types.js";
|
|
7
7
|
import {isDaOutOfRange} from "../../chain/blocks/blockInput/utils.js";
|
|
8
|
+
import {PayloadError, PayloadErrorCode} from "../../chain/blocks/importExecutionPayload.js";
|
|
8
9
|
import {PayloadEnvelopeInput} from "../../chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js";
|
|
9
10
|
import {BlockError, BlockErrorCode} from "../../chain/errors/index.js";
|
|
10
11
|
import {ZERO_HASH} from "../../constants/constants.js";
|
|
@@ -64,6 +65,7 @@ export type DownloadSuccessState = {
|
|
|
64
65
|
status: BatchStatus.AwaitingProcessing;
|
|
65
66
|
blocks: IBlockInput[];
|
|
66
67
|
payloadEnvelopes: Map<Slot, PayloadEnvelopeInput> | null;
|
|
68
|
+
attempt: Attempt;
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
export type BatchState =
|
|
@@ -589,7 +591,11 @@ export class Batch {
|
|
|
589
591
|
}
|
|
590
592
|
|
|
591
593
|
if (allComplete) {
|
|
592
|
-
|
|
594
|
+
const attempt: Attempt = {
|
|
595
|
+
peers: this.getSuccessfulPeers(),
|
|
596
|
+
hash: hashBlocks(blocks, payloadEnvelopes),
|
|
597
|
+
};
|
|
598
|
+
this.state = {status: BatchStatus.AwaitingProcessing, blocks, payloadEnvelopes: newPayloadEnvelopes, attempt};
|
|
593
599
|
} else {
|
|
594
600
|
this.state = {status: BatchStatus.AwaitingDownload, blocks, payloadEnvelopes: newPayloadEnvelopes};
|
|
595
601
|
this.requests = this.getRequests(blocks);
|
|
@@ -646,15 +652,11 @@ export class Batch {
|
|
|
646
652
|
throw new BatchError(this.wrongStatusErrorType(BatchStatus.AwaitingProcessing));
|
|
647
653
|
}
|
|
648
654
|
|
|
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();
|
|
655
|
+
const {blocks, payloadEnvelopes, attempt} = this.state;
|
|
656
|
+
// No need to track successfulDownloads anymore, the batch goes to Processing status.
|
|
655
657
|
this.successfulDownloads.clear();
|
|
656
|
-
this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt
|
|
657
|
-
return {blocks, payloadEnvelopes, peers};
|
|
658
|
+
this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt};
|
|
659
|
+
return {blocks, payloadEnvelopes, peers: attempt.peers};
|
|
658
660
|
}
|
|
659
661
|
|
|
660
662
|
/**
|
|
@@ -673,6 +675,26 @@ export class Batch {
|
|
|
673
675
|
};
|
|
674
676
|
}
|
|
675
677
|
|
|
678
|
+
/**
|
|
679
|
+
* Processing -> AwaitingProcessing
|
|
680
|
+
*
|
|
681
|
+
* The batch's own blocks are valid but processing failed because a previous batch did not
|
|
682
|
+
* deliver the parent. Keep the downloaded blocks and process them again once the previous
|
|
683
|
+
* batch is repaired.
|
|
684
|
+
*/
|
|
685
|
+
retainForReprocessing(): void {
|
|
686
|
+
if (this.state.status !== BatchStatus.Processing) {
|
|
687
|
+
throw new BatchError(this.wrongStatusErrorType(BatchStatus.Processing));
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
this.state = {
|
|
691
|
+
status: BatchStatus.AwaitingProcessing,
|
|
692
|
+
blocks: this.state.blocks,
|
|
693
|
+
payloadEnvelopes: this.state.payloadEnvelopes,
|
|
694
|
+
attempt: this.state.attempt,
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
|
|
676
698
|
/**
|
|
677
699
|
* Processing -> AwaitingDownload
|
|
678
700
|
*/
|
|
@@ -681,7 +703,7 @@ export class Batch {
|
|
|
681
703
|
throw new BatchError(this.wrongStatusErrorType(BatchStatus.Processing));
|
|
682
704
|
}
|
|
683
705
|
|
|
684
|
-
if (err
|
|
706
|
+
if (isExecutionEngineError(err)) {
|
|
685
707
|
this.onExecutionEngineError(this.state.attempt);
|
|
686
708
|
} else {
|
|
687
709
|
this.onProcessingError(this.state.attempt);
|
|
@@ -696,7 +718,7 @@ export class Batch {
|
|
|
696
718
|
throw new BatchError(this.wrongStatusErrorType(BatchStatus.AwaitingValidation));
|
|
697
719
|
}
|
|
698
720
|
|
|
699
|
-
if (err
|
|
721
|
+
if (isExecutionEngineError(err)) {
|
|
700
722
|
this.onExecutionEngineError(this.state.attempt);
|
|
701
723
|
} else {
|
|
702
724
|
this.onProcessingError(this.state.attempt);
|
|
@@ -750,7 +772,7 @@ export enum BatchErrorCode {
|
|
|
750
772
|
INVALID_COUNT = "BATCH_ERROR_INVALID_COUNT",
|
|
751
773
|
MAX_DOWNLOAD_ATTEMPTS = "BATCH_ERROR_MAX_DOWNLOAD_ATTEMPTS",
|
|
752
774
|
MAX_PROCESSING_ATTEMPTS = "BATCH_ERROR_MAX_PROCESSING_ATTEMPTS",
|
|
753
|
-
MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "
|
|
775
|
+
MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "BATCH_ERROR_MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS",
|
|
754
776
|
}
|
|
755
777
|
|
|
756
778
|
type BatchErrorType =
|
|
@@ -766,3 +788,19 @@ type BatchErrorMetadata = {
|
|
|
766
788
|
};
|
|
767
789
|
|
|
768
790
|
export class BatchError extends LodestarError<BatchErrorType & BatchErrorMetadata> {}
|
|
791
|
+
|
|
792
|
+
function isExecutionEngineError(err: Error): boolean {
|
|
793
|
+
if (!(err instanceof BlockError)) {
|
|
794
|
+
return false;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
if (err.type.code === BlockErrorCode.EXECUTION_ENGINE_ERROR) {
|
|
798
|
+
return true;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
return (
|
|
802
|
+
err.type.code === BlockErrorCode.BEACON_CHAIN_ERROR &&
|
|
803
|
+
err.type.error instanceof PayloadError &&
|
|
804
|
+
err.type.error.type.code === PayloadErrorCode.EXECUTION_ENGINE_ERROR
|
|
805
|
+
);
|
|
806
|
+
}
|
package/src/sync/range/chain.ts
CHANGED
|
@@ -23,7 +23,9 @@ import {Batch, BatchError, BatchErrorCode, BatchMetadata, BatchStatus} from "./b
|
|
|
23
23
|
import {
|
|
24
24
|
ChainPeersBalancer,
|
|
25
25
|
PeerSyncInfo,
|
|
26
|
+
ProcessingFaultKind,
|
|
26
27
|
batchStartEpochIsAfterSlot,
|
|
28
|
+
classifyProcessingFault,
|
|
27
29
|
computeHighestTarget,
|
|
28
30
|
getBatchSlotRange,
|
|
29
31
|
getNextBatchToProcess,
|
|
@@ -708,23 +710,41 @@ export class SyncChain {
|
|
|
708
710
|
this.triggerBatchProcessor();
|
|
709
711
|
} else {
|
|
710
712
|
this.logger.verbose("Batch process error", logCtx, res.err);
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
for (const pendingBatch of this.batches.values()) {
|
|
724
|
-
if (pendingBatch.startEpoch < batch.startEpoch) {
|
|
725
|
-
this.logger.verbose("Batch validation error", {id: this.logId, ...pendingBatch.getMetadata()});
|
|
726
|
-
pendingBatch.validationError(res.err); // Throws after MAX_BATCH_PROCESSING_ATTEMPTS
|
|
713
|
+
|
|
714
|
+
const invalidatePreviousBatches = (): number => {
|
|
715
|
+
let invalidatedCount = 0;
|
|
716
|
+
for (const pendingBatch of this.batches.values()) {
|
|
717
|
+
if (
|
|
718
|
+
pendingBatch.startEpoch < batch.startEpoch &&
|
|
719
|
+
pendingBatch.state.status === BatchStatus.AwaitingValidation
|
|
720
|
+
) {
|
|
721
|
+
this.logger.verbose("Batch validation error", {id: this.logId, ...pendingBatch.getMetadata()});
|
|
722
|
+
pendingBatch.validationError(res.err);
|
|
723
|
+
invalidatedCount++;
|
|
724
|
+
}
|
|
727
725
|
}
|
|
726
|
+
return invalidatedCount;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
const prevBatch = this.batches.get(batch.startEpoch - EPOCHS_PER_BATCH);
|
|
730
|
+
switch (classifyProcessingFault(res.err, batch, prevBatch)) {
|
|
731
|
+
case ProcessingFaultKind.CurrentBatch:
|
|
732
|
+
batch.processingError(res.err);
|
|
733
|
+
break;
|
|
734
|
+
|
|
735
|
+
case ProcessingFaultKind.PreviousBatch:
|
|
736
|
+
// If no previous batch was invalidated, it means the error is on this batch
|
|
737
|
+
if (invalidatePreviousBatches() === 0) {
|
|
738
|
+
batch.processingError(res.err);
|
|
739
|
+
} else {
|
|
740
|
+
batch.retainForReprocessing();
|
|
741
|
+
}
|
|
742
|
+
break;
|
|
743
|
+
|
|
744
|
+
case ProcessingFaultKind.Ambiguous:
|
|
745
|
+
batch.processingError(res.err);
|
|
746
|
+
invalidatePreviousBatches();
|
|
747
|
+
break;
|
|
728
748
|
}
|
|
729
749
|
}
|
|
730
750
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
2
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
3
3
|
import {Epoch, Slot} from "@lodestar/types";
|
|
4
|
+
import {BlockError, BlockErrorCode} from "../../../chain/errors/index.js";
|
|
4
5
|
import {BATCH_SLOT_OFFSET, EPOCHS_PER_BATCH} from "../../constants.js";
|
|
5
6
|
import {Batch, BatchStatus} from "../batch.js";
|
|
6
7
|
|
|
@@ -117,3 +118,46 @@ export function isSyncChainDone(batches: Batch[], lastEpochWithProcessBlocks: Ep
|
|
|
117
118
|
|
|
118
119
|
return batchStartEpochIsAfterSlot(lastEpochWithProcessBlocks, targetSlot);
|
|
119
120
|
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Where a batch processing error should be attributed.
|
|
124
|
+
*/
|
|
125
|
+
export enum ProcessingFaultKind {
|
|
126
|
+
/** This batch's own blocks are bad or incomplete, so redownload this batch. */
|
|
127
|
+
CurrentBatch = "CurrentBatch",
|
|
128
|
+
/** This batch is valid, but a previous batch did not deliver the parent. */
|
|
129
|
+
PreviousBatch = "PreviousBatch",
|
|
130
|
+
/** The fault could be in this batch or a previous batch, so hedge both ways. */
|
|
131
|
+
Ambiguous = "Ambiguous",
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Classify a processChainSegment error for a batch so range sync only redownloads
|
|
136
|
+
* the batch or batches that could actually be at fault.
|
|
137
|
+
* Note that range sync is supposed to only handle linear chain, for forky condition we'll handle it via backward sync
|
|
138
|
+
* in BlockInputSync or the upcoming/TODO beacon_blocks_by_head req/resp.
|
|
139
|
+
*/
|
|
140
|
+
export function classifyProcessingFault(err: Error, batch: Batch, prevBatch: Batch | undefined): ProcessingFaultKind {
|
|
141
|
+
if (!(err instanceof BlockError)) {
|
|
142
|
+
return ProcessingFaultKind.CurrentBatch;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const {code} = err.type;
|
|
146
|
+
if (code !== BlockErrorCode.PARENT_BLOCK_UNKNOWN && code !== BlockErrorCode.PARENT_PAYLOAD_UNKNOWN) {
|
|
147
|
+
return ProcessingFaultKind.CurrentBatch;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const firstErrorSlot = err.signedBlock.message.slot;
|
|
151
|
+
if (firstErrorSlot === batch.startSlot) {
|
|
152
|
+
// note that range sync is for linear chain, so this is clearly an issue of the previous batch
|
|
153
|
+
return prevBatch === undefined ? ProcessingFaultKind.CurrentBatch : ProcessingFaultKind.PreviousBatch;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const prevTailSlot = batch.startSlot - 1;
|
|
157
|
+
const prevHasFullTail =
|
|
158
|
+
code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN
|
|
159
|
+
? (prevBatch?.getPayloadEnvelopes()?.get(prevTailSlot)?.hasPayloadEnvelope() ?? false)
|
|
160
|
+
: (prevBatch?.getBlocks().some((b) => b.slot === prevTailSlot) ?? false);
|
|
161
|
+
|
|
162
|
+
return prevHasFullTail ? ProcessingFaultKind.CurrentBatch : ProcessingFaultKind.Ambiguous;
|
|
163
|
+
}
|
|
@@ -1,27 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {RootHex,
|
|
3
|
-
import {toRootHex} from "@lodestar/utils";
|
|
1
|
+
import {digest} from "@chainsafe/as-sha256";
|
|
2
|
+
import {RootHex, Slot, ssz} from "@lodestar/types";
|
|
3
|
+
import {fromHex, toRootHex} from "@lodestar/utils";
|
|
4
4
|
import {IBlockInput} from "../../../chain/blocks/blockInput/types.js";
|
|
5
|
+
import {PayloadEnvelopeInput} from "../../../chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js";
|
|
6
|
+
|
|
7
|
+
const ROOT_SIZE = 32;
|
|
8
|
+
const SIGNATURE_SIZE = 96;
|
|
9
|
+
/** Every block and every payload envelope contributes a fixed-size (root, signature) entry */
|
|
10
|
+
const ENTRY_SIZE = ROOT_SIZE + SIGNATURE_SIZE;
|
|
11
|
+
/** uint32 LE counts of block and envelope entries, so the variable-length sections are self-describing */
|
|
12
|
+
const COUNT_SIZE = 4;
|
|
13
|
+
const HEADER_SIZE = COUNT_SIZE * 2;
|
|
5
14
|
|
|
6
15
|
/**
|
|
7
|
-
*
|
|
16
|
+
* Root uniquely identifying a batch attempt (its blocks AND payloads). Used for peer scoring and to
|
|
17
|
+
* compare if two attempts are equivalent.
|
|
18
|
+
*
|
|
19
|
+
* Signatures are part of the id for BOTH blocks and payload envelopes, not just their message roots:
|
|
20
|
+
* a peer serving a correct message with a garbage signature would otherwise produce the same id as
|
|
21
|
+
* the honest attempt and escape scoring in `SyncChain.advanceChain`. Signatures are not verified at
|
|
22
|
+
* download time, only during processChainSegment (block signatures in verifyBlocksSignatures,
|
|
23
|
+
* envelope signatures in importExecutionPayload).
|
|
24
|
+
*
|
|
25
|
+
* Entries are written as raw bytes into a single exactly-sized buffer and digested once, so an
|
|
26
|
+
* `Attempt` retains 32 bytes rather than the ~16 KB a full 32-slot gloas batch would need if the
|
|
27
|
+
* roots and signatures were concatenated as hex. sha256 (not a 64-bit hash) because a peer that
|
|
28
|
+
* could force a collision with the winning attempt would escape peer scoring.
|
|
8
29
|
*/
|
|
9
|
-
export function hashBlocks(blocks: IBlockInput[],
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
export function hashBlocks(blocks: IBlockInput[], payloadEnvelopes: Map<Slot, PayloadEnvelopeInput> | null): RootHex {
|
|
31
|
+
// Envelopes without a payload carry no attributable data, so they are skipped entirely. A `null`
|
|
32
|
+
// map and a map whose entries all lack a payload are therefore equivalent, which is intended.
|
|
33
|
+
const envelopes =
|
|
34
|
+
payloadEnvelopes && payloadEnvelopes.size > 0
|
|
35
|
+
? Array.from(payloadEnvelopes.entries())
|
|
36
|
+
.filter(([, envelope]) => envelope.hasPayloadEnvelope())
|
|
37
|
+
.sort(([slotA], [slotB]) => slotA - slotB)
|
|
38
|
+
: [];
|
|
39
|
+
|
|
40
|
+
const buf = Buffer.allocUnsafe(HEADER_SIZE + (blocks.length + envelopes.length) * ENTRY_SIZE);
|
|
41
|
+
buf.writeUInt32LE(blocks.length, 0);
|
|
42
|
+
buf.writeUInt32LE(envelopes.length, COUNT_SIZE);
|
|
43
|
+
let offset = HEADER_SIZE;
|
|
44
|
+
|
|
45
|
+
for (const block of blocks) {
|
|
46
|
+
buf.set(fromHex(block.blockRootHex), offset);
|
|
47
|
+
offset += ROOT_SIZE;
|
|
48
|
+
buf.set(block.getBlock().signature, offset);
|
|
49
|
+
offset += SIGNATURE_SIZE;
|
|
26
50
|
}
|
|
51
|
+
|
|
52
|
+
for (const [, envelope] of envelopes) {
|
|
53
|
+
const signedEnvelope = envelope.getPayloadEnvelope();
|
|
54
|
+
// envelope's root is cached thanks to cachePermanentRootStruct, so this avoids re-hashing
|
|
55
|
+
buf.set(ssz.gloas.ExecutionPayloadEnvelope.hashTreeRoot(signedEnvelope.message), offset);
|
|
56
|
+
offset += ROOT_SIZE;
|
|
57
|
+
buf.set(signedEnvelope.signature, offset);
|
|
58
|
+
offset += SIGNATURE_SIZE;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return toRootHex(digest(buf));
|
|
27
62
|
}
|
package/src/util/clock.ts
CHANGED
|
@@ -94,10 +94,7 @@ export class Clock extends EventEmitter implements IClock {
|
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* If it's too close to next slot given MAXIMUM_GOSSIP_CLOCK_DISPARITY, return currentSlot + 1.
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* Spec: phase0/p2p-interface.md - gossip validation uses `current_time + MAXIMUM_GOSSIP_CLOCK_DISPARITY < message_time`
|
|
100
|
-
* to reject future messages (strict `<`), so the boundary (exactly equal) is accepted, hence `<=` here.
|
|
97
|
+
* Spec: phase0/p2p-interface.md rejects future messages with strict `<`, hence `<=` here.
|
|
101
98
|
*/
|
|
102
99
|
get currentSlotWithGossipDisparity(): Slot {
|
|
103
100
|
const currentSlot = this.currentSlot;
|
|
@@ -123,9 +120,7 @@ export class Clock extends EventEmitter implements IClock {
|
|
|
123
120
|
|
|
124
121
|
/**
|
|
125
122
|
* Check if a slot is current slot given MAXIMUM_GOSSIP_CLOCK_DISPARITY.
|
|
126
|
-
*
|
|
127
|
-
* Uses `<=` for disparity checks because the spec rejects with strict `<`
|
|
128
|
-
* (phase0/p2p-interface.md), meaning the boundary (exactly equal) is accepted.
|
|
123
|
+
* Spec: phase0/p2p-interface.md rejects future messages with strict `<`, hence `<=`.
|
|
129
124
|
*/
|
|
130
125
|
isCurrentSlotGivenGossipDisparity(slot: Slot): boolean {
|
|
131
126
|
const currentSlot = this.currentSlot;
|
package/src/util/sszBytes.ts
CHANGED
|
@@ -706,7 +706,7 @@ export function getBlockRootFromPayloadAttestationMessageSerialized(data: Uint8A
|
|
|
706
706
|
* blockHash: Bytes32 (32 bytes)
|
|
707
707
|
* prevRandao: Bytes32 (32 bytes)
|
|
708
708
|
* feeRecipient: ExecutionAddress(20 bytes)
|
|
709
|
-
* gasLimit:
|
|
709
|
+
* gasLimit: UintBn64 (8 bytes)
|
|
710
710
|
* builderIndex: BuilderIndex (8 bytes)
|
|
711
711
|
* slot: Slot (8 bytes) ← absolute offset 264
|
|
712
712
|
*/
|
package/src/util/workerEvents.ts
CHANGED
|
@@ -111,6 +111,12 @@ export function wireEventsOnMainThread<EventData>(
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Terminate a worker thread, bounded to `retryCount * retryMs`.
|
|
116
|
+
*
|
|
117
|
+
* @returns `false` if it could not be terminated, the worker thread is then still running and the
|
|
118
|
+
* caller has to decide how to proceed without it.
|
|
119
|
+
*/
|
|
114
120
|
export async function terminateWorkerThread({
|
|
115
121
|
worker,
|
|
116
122
|
retryMs,
|
|
@@ -121,7 +127,7 @@ export async function terminateWorkerThread({
|
|
|
121
127
|
retryMs: number;
|
|
122
128
|
retryCount: number;
|
|
123
129
|
logger?: Logger;
|
|
124
|
-
}): Promise<
|
|
130
|
+
}): Promise<boolean> {
|
|
125
131
|
const terminated = new Promise((resolve) => {
|
|
126
132
|
Thread.events(worker).subscribe((event) => {
|
|
127
133
|
if (event.type === "termination") {
|
|
@@ -131,13 +137,19 @@ export async function terminateWorkerThread({
|
|
|
131
137
|
});
|
|
132
138
|
|
|
133
139
|
for (let i = 0; i < retryCount; i++) {
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
// `Worker.terminate()` resolves only once the worker thread exits, and the thread can spin
|
|
141
|
+
// forever in `Environment::CleanupHandles()` when a libuv handle on its loop never closes, so
|
|
142
|
+
// it has to be raced too, otherwise `retryCount * retryMs` never applies.
|
|
143
|
+
const result = await Promise.race([
|
|
144
|
+
Thread.terminate(worker).then(() => terminated),
|
|
145
|
+
sleep(retryMs).then(() => false),
|
|
146
|
+
]);
|
|
136
147
|
|
|
137
|
-
if (result) return;
|
|
148
|
+
if (result) return true;
|
|
138
149
|
|
|
139
|
-
logger?.
|
|
150
|
+
logger?.debug("Worker thread failed to terminate, retrying...");
|
|
140
151
|
}
|
|
141
152
|
|
|
142
|
-
|
|
153
|
+
logger?.debug(`Worker thread failed to terminate in ${retryCount * retryMs}ms`);
|
|
154
|
+
return false;
|
|
143
155
|
}
|