@lodestar/beacon-node 1.46.0-dev.d96240a05e → 1.46.0-dev.de5f89eae1
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 +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.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.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.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.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 +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 +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 +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 +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 +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 +22 -10
- 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 +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.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 +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 +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.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.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.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 +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 +28 -39
- package/src/api/impl/beacon/blocks/index.ts +65 -16
- package/src/api/impl/config/constants.ts +6 -0
- package/src/api/impl/lodestar/index.ts +2 -3
- package/src/api/impl/validator/index.ts +20 -7
- package/src/chain/archiveStore/archiveStore.ts +20 -3
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +0 -1
- 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/bls/multithread/index.ts +0 -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/blobSidecar.ts +1 -1
- 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/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 +40 -1
- package/src/metrics/nodeJsMetrics.ts +1 -1
- package/src/network/core/networkCore.ts +13 -1
- package/src/network/core/networkCoreWorkerHandler.ts +20 -9
- package/src/network/discv5/index.ts +1 -4
- package/src/network/gossip/topic.ts +4 -2
- package/src/network/libp2p/index.ts +2 -10
- package/src/network/network.ts +16 -1
- package/src/network/peers/datastore.ts +1 -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/util/clock.ts +2 -7
- package/src/util/profile.ts +1 -31
- package/src/util/sszBytes.ts +1 -1
- package/src/util/workerEvents.ts +18 -6
- 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
|
@@ -23,8 +23,9 @@ import {
|
|
|
23
23
|
getBlockProposerSignatureSet,
|
|
24
24
|
isExecutionBlockBodyType,
|
|
25
25
|
isStatePostBellatrix,
|
|
26
|
+
signedBlockToSignedHeader,
|
|
26
27
|
} from "@lodestar/state-transition";
|
|
27
|
-
import {SignedBeaconBlock, deneb, gloas, isGloasBeaconBlock} from "@lodestar/types";
|
|
28
|
+
import {RootHex, SignedBeaconBlock, deneb, gloas, isGloasBeaconBlock, ssz} from "@lodestar/types";
|
|
28
29
|
import {byteArrayEquals, sleep, toRootHex} from "@lodestar/utils";
|
|
29
30
|
import {BlockErrorCode, BlockGossipError, GossipAction} from "../errors/index.js";
|
|
30
31
|
import {IBeaconChain} from "../interface.js";
|
|
@@ -75,7 +76,10 @@ export async function validateGossipBlock(
|
|
|
75
76
|
// reboot if the `observed_block_producers` cache is empty. In that case, without this
|
|
76
77
|
// check, we will load the parent and state from disk only to find out later that we
|
|
77
78
|
// already know this block.
|
|
78
|
-
|
|
79
|
+
// A block's hash tree root is identical to its header's, so the root is derived from the header
|
|
80
|
+
// which is also used as potential equivocation evidence
|
|
81
|
+
const signedBlockHeader = signedBlockToSignedHeader(config, signedBlock);
|
|
82
|
+
const blockRoot = toRootHex(ssz.phase0.BeaconBlockHeader.hashTreeRoot(signedBlockHeader.message));
|
|
79
83
|
if (chain.forkChoice.getBlockHexDefaultStatus(blockRoot) !== null) {
|
|
80
84
|
throw new BlockGossipError(GossipAction.IGNORE, {code: BlockErrorCode.ALREADY_KNOWN, root: blockRoot});
|
|
81
85
|
}
|
|
@@ -85,7 +89,12 @@ export async function validateGossipBlock(
|
|
|
85
89
|
|
|
86
90
|
// [IGNORE] The block is the first block with valid signature received for the proposer for the slot, signed_beacon_block.message.slot.
|
|
87
91
|
const proposerIndex = block.proposerIndex;
|
|
92
|
+
const hasBlockRoot = chain.seenBlockProposers.hasBlockRoot(blockSlot, proposerIndex, blockRoot);
|
|
88
93
|
if (chain.seenBlockProposers.isKnown(blockSlot, proposerIndex)) {
|
|
94
|
+
if (!hasBlockRoot && !chain.seenBlockProposers.isEquivocating(blockSlot, proposerIndex)) {
|
|
95
|
+
await verifyBlockProposerSignature(chain, signedBlock, blockRoot, {verifyOnMainThread: false});
|
|
96
|
+
chain.seenBlockProposers.observeBlockRoot(blockSlot, proposerIndex, blockRoot, signedBlockHeader);
|
|
97
|
+
}
|
|
89
98
|
throw new BlockGossipError(GossipAction.IGNORE, {code: BlockErrorCode.REPEAT_PROPOSAL, proposerIndex});
|
|
90
99
|
}
|
|
91
100
|
|
|
@@ -270,18 +279,8 @@ export async function validateGossipBlock(
|
|
|
270
279
|
}
|
|
271
280
|
|
|
272
281
|
// [REJECT] The proposer signature, signed_beacon_block.signature, is valid with respect to the proposer_index pubkey.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// Don't batch so verification is not delayed
|
|
276
|
-
if (!(await chain.bls.verifySignatureSets([signatureSet], {verifyOnMainThread: true}))) {
|
|
277
|
-
throw new BlockGossipError(GossipAction.REJECT, {
|
|
278
|
-
code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID,
|
|
279
|
-
blockSlot,
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
chain.seenBlockInputCache.markVerifiedProposerSignature(blockSlot, blockRoot, signedBlock.signature);
|
|
284
|
-
}
|
|
282
|
+
await verifyBlockProposerSignature(chain, signedBlock, blockRoot);
|
|
283
|
+
chain.seenBlockProposers.observeBlockRoot(blockSlot, proposerIndex, blockRoot, signedBlockHeader);
|
|
285
284
|
|
|
286
285
|
// [REJECT] The block is proposed by the expected proposer_index for the block's slot in the context of the current
|
|
287
286
|
// shuffling (defined by parent_root/slot). If the proposer_index cannot immediately be verified against the expected
|
|
@@ -291,11 +290,6 @@ export async function validateGossipBlock(
|
|
|
291
290
|
throw new BlockGossipError(GossipAction.REJECT, {code: BlockErrorCode.INCORRECT_PROPOSER, proposerIndex});
|
|
292
291
|
}
|
|
293
292
|
|
|
294
|
-
// Check again in case there two blocks are processed concurrently
|
|
295
|
-
if (chain.seenBlockProposers.isKnown(blockSlot, proposerIndex)) {
|
|
296
|
-
throw new BlockGossipError(GossipAction.IGNORE, {code: BlockErrorCode.REPEAT_PROPOSAL, proposerIndex});
|
|
297
|
-
}
|
|
298
|
-
|
|
299
293
|
// Simple implementation of a pending block queue. Keeping the block here recycles the queue logic, and keeps the
|
|
300
294
|
// gossip validation promise without any extra infrastructure.
|
|
301
295
|
// Do the sleep at the end, since regen and signature validation can already take longer than `msToBlockSlot`.
|
|
@@ -305,7 +299,35 @@ export async function validateGossipBlock(
|
|
|
305
299
|
await sleep(msToBlockSlot);
|
|
306
300
|
}
|
|
307
301
|
|
|
302
|
+
// Check again after all async validation and the early-block delay so concurrent proposals cannot both pass
|
|
303
|
+
if (chain.seenBlockProposers.isKnown(blockSlot, proposerIndex)) {
|
|
304
|
+
throw new BlockGossipError(GossipAction.IGNORE, {code: BlockErrorCode.REPEAT_PROPOSAL, proposerIndex});
|
|
305
|
+
}
|
|
306
|
+
|
|
308
307
|
chain.seenBlockProposers.add(blockSlot, proposerIndex);
|
|
309
308
|
|
|
310
309
|
return {skippedSlots};
|
|
311
310
|
}
|
|
311
|
+
|
|
312
|
+
export async function verifyBlockProposerSignature(
|
|
313
|
+
chain: IBeaconChain,
|
|
314
|
+
signedBlock: SignedBeaconBlock,
|
|
315
|
+
blockRoot: RootHex,
|
|
316
|
+
opts: {verifyOnMainThread?: boolean} = {}
|
|
317
|
+
): Promise<void> {
|
|
318
|
+
const blockSlot = signedBlock.message.slot;
|
|
319
|
+
if (chain.seenBlockInputCache.isVerifiedProposerSignature(blockSlot, blockRoot, signedBlock.signature)) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const signatureSet = getBlockProposerSignatureSet(chain.config, signedBlock);
|
|
324
|
+
// Don't batch so verification is not delayed
|
|
325
|
+
if (!(await chain.bls.verifySignatureSets([signatureSet], {verifyOnMainThread: opts.verifyOnMainThread ?? true}))) {
|
|
326
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
327
|
+
code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID,
|
|
328
|
+
blockSlot,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
chain.seenBlockInputCache.markVerifiedProposerSignature(blockSlot, blockRoot, signedBlock.signature);
|
|
333
|
+
}
|
|
@@ -2,15 +2,16 @@ import {ChainConfig, ChainForkConfig} from "@lodestar/config";
|
|
|
2
2
|
import {
|
|
3
3
|
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH,
|
|
4
4
|
KZG_COMMITMENTS_SUBTREE_INDEX,
|
|
5
|
+
MIN_SEED_LOOKAHEAD,
|
|
5
6
|
NUMBER_OF_COLUMNS,
|
|
7
|
+
isForkPostFulu,
|
|
6
8
|
} from "@lodestar/params";
|
|
7
9
|
import {
|
|
8
10
|
computeEpochAtSlot,
|
|
9
11
|
computeStartSlotAtEpoch,
|
|
10
12
|
getBlockHeaderProposerSignatureSetByHeaderSlot,
|
|
11
|
-
getBlockHeaderProposerSignatureSetByParentStateSlot,
|
|
12
13
|
} from "@lodestar/state-transition";
|
|
13
|
-
import {DataColumnSidecar, Root, Slot, SubnetID, fulu, gloas, ssz} from "@lodestar/types";
|
|
14
|
+
import {DataColumnSidecar, Root, Slot, SubnetID, ValidatorIndex, fulu, gloas, ssz} from "@lodestar/types";
|
|
14
15
|
import {byteArrayEquals, toRootHex, verifyMerkleBranch} from "@lodestar/utils";
|
|
15
16
|
import {BeaconMetrics} from "../../metrics/metrics/beacon.js";
|
|
16
17
|
import {Metrics} from "../../metrics/metrics.js";
|
|
@@ -104,19 +105,23 @@ export async function validateGossipFuluDataColumnSidecar(
|
|
|
104
105
|
});
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
// getBlockSlotState also checks for whether the current finalized checkpoint is an ancestor of the block.
|
|
108
|
-
// As a result, we throw an IGNORE (whereas the spec says we should REJECT for this scenario).
|
|
109
|
-
// this is something we should change this in the future to make the code airtight to the spec.
|
|
110
108
|
// 7) [REJECT] The sidecar's block's parent passes validation.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
// Post-fulu, we can use parent state to get expected proposer index thanks to proposer lookahead
|
|
110
|
+
const parentEpoch = computeEpochAtSlot(parentBlock.slot);
|
|
111
|
+
const blockEpoch = computeEpochAtSlot(blockHeader.slot);
|
|
112
|
+
const getProposerIndex = async (): Promise<ValidatorIndex> => {
|
|
113
|
+
if (isForkPostFulu(chain.config.getForkName(parentBlock.slot)) && blockEpoch - parentEpoch <= MIN_SEED_LOOKAHEAD) {
|
|
114
|
+
const parentState = await chain.regen.getState(parentBlock.stateRoot, RegenCaller.validateGossipDataColumn);
|
|
115
|
+
return parentState.getBeaconProposer(blockHeader.slot);
|
|
116
|
+
}
|
|
117
|
+
const blockState = await chain.regen.getBlockSlotState(
|
|
118
|
+
parentBlock,
|
|
119
|
+
blockHeader.slot,
|
|
120
|
+
{dontTransferCache: true},
|
|
121
|
+
RegenCaller.validateGossipDataColumn
|
|
122
|
+
);
|
|
123
|
+
return blockState.getBeaconProposer(blockHeader.slot);
|
|
124
|
+
};
|
|
120
125
|
|
|
121
126
|
// 13) [REJECT] The sidecar is proposed by the expected proposer_index for the block's slot in the context of the current
|
|
122
127
|
// shuffling (defined by block_header.parent_root/block_header.slot). If the proposer_index cannot
|
|
@@ -124,7 +129,13 @@ export async function validateGossipFuluDataColumnSidecar(
|
|
|
124
129
|
// while proposers for the block's branch are calculated -- in such a case do not REJECT, instead IGNORE
|
|
125
130
|
// this message.
|
|
126
131
|
const proposerIndex = blockHeader.proposerIndex;
|
|
127
|
-
const expectedProposerIndex =
|
|
132
|
+
const expectedProposerIndex = await getProposerIndex().catch(() => {
|
|
133
|
+
throw new DataColumnSidecarGossipError(GossipAction.IGNORE, {
|
|
134
|
+
code: DataColumnSidecarErrorCode.PARENT_UNKNOWN,
|
|
135
|
+
parentRoot,
|
|
136
|
+
slot: blockHeader.slot,
|
|
137
|
+
});
|
|
138
|
+
});
|
|
128
139
|
|
|
129
140
|
if (proposerIndex !== expectedProposerIndex) {
|
|
130
141
|
throw new DataColumnSidecarGossipError(GossipAction.REJECT, {
|
|
@@ -137,9 +148,8 @@ export async function validateGossipFuluDataColumnSidecar(
|
|
|
137
148
|
// 5) [REJECT] The proposer signature of sidecar.signed_block_header, is valid with respect to the block_header.proposer_index pubkey.
|
|
138
149
|
const signature = dataColumnSidecar.signedBlockHeader.signature;
|
|
139
150
|
if (!chain.seenBlockInputCache.isVerifiedProposerSignature(blockHeader.slot, blockRootHex, signature)) {
|
|
140
|
-
const signatureSet =
|
|
151
|
+
const signatureSet = getBlockHeaderProposerSignatureSetByHeaderSlot(
|
|
141
152
|
chain.config,
|
|
142
|
-
blockState.slot,
|
|
143
153
|
dataColumnSidecar.signedBlockHeader
|
|
144
154
|
);
|
|
145
155
|
|
|
@@ -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,9 +7,10 @@ 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";
|
|
@@ -36,12 +38,47 @@ const BID_INCREMENT_CAP_GWEI = 10_000_000;
|
|
|
36
38
|
* Return the minimum value a new bid must have to be forwarded given the current highest bid.
|
|
37
39
|
* Division before multiplication to stay within safe integer range for max gwei values.
|
|
38
40
|
*/
|
|
39
|
-
|
|
41
|
+
function getMinBidValue(currentHighestBid: number): number {
|
|
40
42
|
const relativeIncrement = Math.floor(currentHighestBid / 10_000) * BID_INCREMENT_BPS;
|
|
41
43
|
const increment = Math.min(Math.max(BID_INCREMENT_FLOOR_GWEI, relativeIncrement), BID_INCREMENT_CAP_GWEI);
|
|
42
44
|
return currentHighestBid + increment;
|
|
43
45
|
}
|
|
44
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
|
+
|
|
45
82
|
export async function validateApiExecutionPayloadBid(
|
|
46
83
|
chain: IBeaconChain,
|
|
47
84
|
signedExecutionPayloadBid: gloas.SignedExecutionPayloadBid
|
|
@@ -61,8 +98,8 @@ async function validateExecutionPayloadBid(
|
|
|
61
98
|
signedExecutionPayloadBid: gloas.SignedExecutionPayloadBid
|
|
62
99
|
): Promise<{proposerIndex: ValidatorIndex}> {
|
|
63
100
|
const bid = signedExecutionPayloadBid.message;
|
|
64
|
-
const
|
|
65
|
-
const
|
|
101
|
+
const bidParentBlockRoot = toRootHex(bid.parentBlockRoot);
|
|
102
|
+
const bidParentBlockHash = toRootHex(bid.parentBlockHash);
|
|
66
103
|
|
|
67
104
|
// [IGNORE] `bid.slot` is the current slot, or the next slot (`bid.slot - 1` is current), allowing for `MAXIMUM_GOSSIP_CLOCK_DISPARITY`.
|
|
68
105
|
if (
|
|
@@ -76,14 +113,40 @@ async function validateExecutionPayloadBid(
|
|
|
76
113
|
});
|
|
77
114
|
}
|
|
78
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
|
+
|
|
79
142
|
// [IGNORE] `bid.parent_block_root` is the hash tree root of a known beacon block in fork choice.
|
|
80
143
|
// Moved earlier than the spec ordering so we can derive the proposer dependent root for the
|
|
81
144
|
// proposer-preferences lookup below from a known fork-choice block.
|
|
82
|
-
const parentBlock = chain.forkChoice.getBlockHexDefaultStatus(
|
|
145
|
+
const parentBlock = chain.forkChoice.getBlockHexDefaultStatus(bidParentBlockRoot);
|
|
83
146
|
if (parentBlock === null) {
|
|
84
147
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
85
148
|
code: ExecutionPayloadBidErrorCode.UNKNOWN_BLOCK_ROOT,
|
|
86
|
-
parentBlockRoot:
|
|
149
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
87
150
|
});
|
|
88
151
|
}
|
|
89
152
|
|
|
@@ -122,7 +185,7 @@ async function validateExecutionPayloadBid(
|
|
|
122
185
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
123
186
|
code: ExecutionPayloadBidErrorCode.NO_MATCHING_PROPOSER_PREFERENCES,
|
|
124
187
|
slot: bid.slot,
|
|
125
|
-
parentBlockRoot:
|
|
188
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
126
189
|
dependentRoot: "unknown",
|
|
127
190
|
});
|
|
128
191
|
}
|
|
@@ -132,7 +195,7 @@ async function validateExecutionPayloadBid(
|
|
|
132
195
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
133
196
|
code: ExecutionPayloadBidErrorCode.NO_MATCHING_PROPOSER_PREFERENCES,
|
|
134
197
|
slot: bid.slot,
|
|
135
|
-
parentBlockRoot:
|
|
198
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
136
199
|
dependentRoot: dependentRootHex,
|
|
137
200
|
});
|
|
138
201
|
}
|
|
@@ -143,7 +206,7 @@ async function validateExecutionPayloadBid(
|
|
|
143
206
|
.catch(() => {
|
|
144
207
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
145
208
|
code: ExecutionPayloadBidErrorCode.UNKNOWN_BLOCK_ROOT,
|
|
146
|
-
parentBlockRoot:
|
|
209
|
+
parentBlockRoot: bidParentBlockRoot,
|
|
147
210
|
});
|
|
148
211
|
});
|
|
149
212
|
|
|
@@ -184,7 +247,7 @@ async function validateExecutionPayloadBid(
|
|
|
184
247
|
}
|
|
185
248
|
|
|
186
249
|
// [REJECT] `bid.execution_payment` is zero.
|
|
187
|
-
if (bid.executionPayment !==
|
|
250
|
+
if (bid.executionPayment !== 0n) {
|
|
188
251
|
throw new ExecutionPayloadBidError(GossipAction.REJECT, {
|
|
189
252
|
code: ExecutionPayloadBidErrorCode.NON_ZERO_EXECUTION_PAYMENT,
|
|
190
253
|
builderIndex: bid.builderIndex,
|
|
@@ -208,11 +271,11 @@ async function validateExecutionPayloadBid(
|
|
|
208
271
|
// payload's hash) and EMPTY parents (EMPTY/PENDING variants carry the inherited parent
|
|
209
272
|
// payload's hash, since the new block doesn't have its own payload). Variant carries the
|
|
210
273
|
// executed payload's gas_limit, which we use as `parent_gas_limit` below.
|
|
211
|
-
const parentPayloadVariant = chain.forkChoice.getBlockHexAndBlockHash(
|
|
274
|
+
const parentPayloadVariant = chain.forkChoice.getBlockHexAndBlockHash(bidParentBlockRoot, bidParentBlockHash);
|
|
212
275
|
if (parentPayloadVariant === null || parentPayloadVariant.executionPayloadBlockHash === null) {
|
|
213
276
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
214
277
|
code: ExecutionPayloadBidErrorCode.UNKNOWN_PARENT_BLOCK_HASH,
|
|
215
|
-
parentBlockHash:
|
|
278
|
+
parentBlockHash: bidParentBlockHash,
|
|
216
279
|
});
|
|
217
280
|
}
|
|
218
281
|
|
|
@@ -220,7 +283,7 @@ async function validateExecutionPayloadBid(
|
|
|
220
283
|
// where `parent_gas_limit` is the `gas_limit` of the parent execution payload and
|
|
221
284
|
// `target_gas_limit` is `proposer_preferences.target_gas_limit`.
|
|
222
285
|
const bidGasLimit = bid.gasLimit;
|
|
223
|
-
const parentGasLimit = parentPayloadVariant.executionPayloadGasLimit;
|
|
286
|
+
const parentGasLimit = BigInt(parentPayloadVariant.executionPayloadGasLimit);
|
|
224
287
|
const targetGasLimit = proposerPreferences.message.targetGasLimit;
|
|
225
288
|
if (!isGasLimitTargetCompatible(parentGasLimit, bidGasLimit, targetGasLimit)) {
|
|
226
289
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
@@ -245,23 +308,12 @@ async function validateExecutionPayloadBid(
|
|
|
245
308
|
});
|
|
246
309
|
}
|
|
247
310
|
|
|
248
|
-
// [IGNORE] this is the first signed bid seen with a valid signature from the given builder for this slot.
|
|
249
|
-
if (chain.seenExecutionPayloadBids.isKnown(bid.slot, bid.builderIndex)) {
|
|
250
|
-
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
251
|
-
code: ExecutionPayloadBidErrorCode.BID_ALREADY_KNOWN,
|
|
252
|
-
builderIndex: bid.builderIndex,
|
|
253
|
-
slot: bid.slot,
|
|
254
|
-
parentBlockRoot: parentBlockRootHex,
|
|
255
|
-
parentBlockHash: parentBlockHashHex,
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
311
|
// [IGNORE] this bid is the highest value bid seen for the tuple
|
|
260
312
|
// `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
|
|
261
313
|
// As a DoS prevention measure, the bid must also exceed the current highest bid by a minimum
|
|
262
314
|
// increment, see https://github.com/ethereum/consensus-specs/pull/4831. This prevents spam
|
|
263
315
|
// from builders submitting numerous bids with minimal value increments.
|
|
264
|
-
const bestBid = chain.executionPayloadBidPool.getBestBid(bid.slot,
|
|
316
|
+
const bestBid = chain.executionPayloadBidPool.getBestBid(bid.slot, bidParentBlockHash, bidParentBlockRoot);
|
|
265
317
|
if (bestBid !== null && bid.value < getMinBidValue(bestBid.message.value)) {
|
|
266
318
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
267
319
|
code: ExecutionPayloadBidErrorCode.BID_TOO_LOW,
|
|
@@ -294,7 +346,7 @@ async function validateExecutionPayloadBid(
|
|
|
294
346
|
// [REJECT] `signed_execution_payload_bid.signature` is valid with respect to the `bid.builder_index`.
|
|
295
347
|
const signatureSet = createSingleSignatureSetFromComponents(
|
|
296
348
|
PublicKey.fromBytes(builder.pubkey),
|
|
297
|
-
getExecutionPayloadBidSigningRoot(chain.config,
|
|
349
|
+
getExecutionPayloadBidSigningRoot(chain.config, bid),
|
|
298
350
|
signedExecutionPayloadBid.signature
|
|
299
351
|
);
|
|
300
352
|
|
|
@@ -306,8 +358,20 @@ async function validateExecutionPayloadBid(
|
|
|
306
358
|
});
|
|
307
359
|
}
|
|
308
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
|
+
|
|
309
373
|
// Valid
|
|
310
|
-
chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex);
|
|
374
|
+
chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot);
|
|
311
375
|
|
|
312
376
|
return {proposerIndex: proposerPreferences.message.validatorIndex};
|
|
313
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",
|
|
@@ -1179,6 +1179,10 @@ export function createLodestarMetrics(
|
|
|
1179
1179
|
name: "lodestar_oppool_proposer_slashing_pool_size",
|
|
1180
1180
|
help: "Current size of the ProposerSlashingPool",
|
|
1181
1181
|
}),
|
|
1182
|
+
proposerSlashingsProduced: register.counter({
|
|
1183
|
+
name: "lodestar_oppool_proposer_slashings_produced_total",
|
|
1184
|
+
help: "Total number of proposer slashings produced from observed equivocations",
|
|
1185
|
+
}),
|
|
1182
1186
|
voluntaryExitPoolSize: register.gauge({
|
|
1183
1187
|
name: "lodestar_oppool_voluntary_exit_pool_size",
|
|
1184
1188
|
help: "Current size of the VoluntaryExitPool",
|
|
@@ -1708,6 +1712,41 @@ export function createLodestarMetrics(
|
|
|
1708
1712
|
}),
|
|
1709
1713
|
},
|
|
1710
1714
|
|
|
1715
|
+
// Pre-verify builder-deposit signatures in the epochs before the Gloas fork (prepareNextSlot).
|
|
1716
|
+
builderDepositPreVerify: {
|
|
1717
|
+
duration: register.histogram({
|
|
1718
|
+
name: "lodestar_builder_deposit_preverify_duration_seconds",
|
|
1719
|
+
help: "Duration of one preVerifyBuilderDepositsPreGloas call (BLS batch verify + scan)",
|
|
1720
|
+
buckets: [1, 2, 3, 4],
|
|
1721
|
+
}),
|
|
1722
|
+
pendingDeposits: register.gauge({
|
|
1723
|
+
name: "lodestar_builder_deposit_preverify_pending_deposits",
|
|
1724
|
+
help: "Current state.pendingDeposits length (backlog to drain before the fork)",
|
|
1725
|
+
}),
|
|
1726
|
+
cachedDeposits: register.gauge({
|
|
1727
|
+
name: "lodestar_builder_deposit_preverify_cached_deposits",
|
|
1728
|
+
help: "Deposit signatures verified & cached so far this pre-fork window (valid + invalid)",
|
|
1729
|
+
}),
|
|
1730
|
+
scannedDeposits: register.gauge({
|
|
1731
|
+
name: "lodestar_builder_deposit_preverify_scanned_deposits",
|
|
1732
|
+
help: "Pending deposits examined by the last pre-verify call (< pending_deposits ⇒ cap hit)",
|
|
1733
|
+
}),
|
|
1734
|
+
builderPubkeys: register.gauge({
|
|
1735
|
+
name: "lodestar_builder_deposit_preverify_builder_pubkeys",
|
|
1736
|
+
help: "Distinct builder pubkeys tracked this window (validator deposits for these are pre-verified)",
|
|
1737
|
+
}),
|
|
1738
|
+
validSignatures: register.counter<{type: "builder" | "validator"}>({
|
|
1739
|
+
name: "lodestar_builder_deposit_preverify_valid_signatures_total",
|
|
1740
|
+
help: "Cumulative deposit signatures whose BLS verification passed (VALID), by credential type",
|
|
1741
|
+
labelNames: ["type"],
|
|
1742
|
+
}),
|
|
1743
|
+
invalidSignatures: register.counter<{type: "builder" | "validator"}>({
|
|
1744
|
+
name: "lodestar_builder_deposit_preverify_invalid_signatures_total",
|
|
1745
|
+
help: "Cumulative deposit signatures whose BLS verification failed (INVALID), by credential type",
|
|
1746
|
+
labelNames: ["type"],
|
|
1747
|
+
}),
|
|
1748
|
+
},
|
|
1749
|
+
|
|
1711
1750
|
// reprocess attestations
|
|
1712
1751
|
reprocessApiAttestations: {
|
|
1713
1752
|
total: register.gauge({
|
|
@@ -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({
|
|
@@ -70,6 +70,15 @@ export type BaseNetworkInit = {
|
|
|
70
70
|
initialCustodyGroupCount: number;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
/** Counts of what is still keeping this thread's event loop alive, e.g. `TCPWrap=3,Timeout=1` */
|
|
74
|
+
function formatActiveResources(): string {
|
|
75
|
+
const counts = new Map<string, number>();
|
|
76
|
+
for (const resource of process.getActiveResourcesInfo()) {
|
|
77
|
+
counts.set(resource, (counts.get(resource) ?? 0) + 1);
|
|
78
|
+
}
|
|
79
|
+
return Array.from(counts, ([name, count]) => `${name}=${count}`).join(",");
|
|
80
|
+
}
|
|
81
|
+
|
|
73
82
|
/**
|
|
74
83
|
* This class is meant to work both:
|
|
75
84
|
* - In a libp2p worker
|
|
@@ -289,7 +298,10 @@ export class NetworkCore implements INetworkCore {
|
|
|
289
298
|
this.attnetsService.close();
|
|
290
299
|
this.syncnetsService.close();
|
|
291
300
|
await this.libp2p.stop();
|
|
292
|
-
this
|
|
301
|
+
// Diagnostic for the shutdown hang, this thread can spin in `Environment::CleanupHandles()` on
|
|
302
|
+
// a handle that never closes and `Worker.terminate()` then never resolves. Diffing this list
|
|
303
|
+
// between a clean and a stuck shutdown should narrow down which handle it is
|
|
304
|
+
this.logger.debug("network lib2p closed", {activeResources: formatActiveResources()});
|
|
293
305
|
|
|
294
306
|
this.closed = true;
|
|
295
307
|
}
|
|
@@ -10,6 +10,7 @@ import {BeaconConfig, chainConfigToJson} from "@lodestar/config";
|
|
|
10
10
|
import type {LoggerNode} from "@lodestar/logger/node";
|
|
11
11
|
import {ResponseIncoming, ResponseOutgoing} from "@lodestar/reqresp";
|
|
12
12
|
import {Status} from "@lodestar/types";
|
|
13
|
+
import {withTimeout} from "@lodestar/utils";
|
|
13
14
|
import {Metrics} from "../../metrics/index.js";
|
|
14
15
|
import {AsyncIterableBridgeCaller, AsyncIterableBridgeHandler} from "../../util/asyncIterableToEvents.js";
|
|
15
16
|
import {PeerIdStr, peerIdFromString} from "../../util/peerId.js";
|
|
@@ -58,6 +59,10 @@ type WorkerNetworkCoreModules = WorkerNetworkCoreInitModules & {
|
|
|
58
59
|
|
|
59
60
|
const NETWORK_WORKER_EXIT_TIMEOUT_MS = 1000;
|
|
60
61
|
const NETWORK_WORKER_EXIT_RETRY_COUNT = 3;
|
|
62
|
+
/** `getApi().close()` is an unbounded RPC into the worker and runs before `BeaconNode.close()`
|
|
63
|
+
* archives chain state to disk, so it is bounded here. Set well above the ~2-4s a close takes on
|
|
64
|
+
* mainnet, tripping it leaves libp2p half torn down */
|
|
65
|
+
const NETWORK_CORE_CLOSE_TIMEOUT_MS = 5000;
|
|
61
66
|
|
|
62
67
|
/**
|
|
63
68
|
* NetworkCore implementation using a Worker thread
|
|
@@ -132,10 +137,6 @@ export class WorkerNetworkCore implements INetworkCore {
|
|
|
132
137
|
|
|
133
138
|
const workerOpts: ConstructorParameters<typeof Worker>[1] = {
|
|
134
139
|
workerData,
|
|
135
|
-
};
|
|
136
|
-
if (globalThis.Bun) {
|
|
137
|
-
workerOpts.suppressTranspileTS = true;
|
|
138
|
-
} else {
|
|
139
140
|
/**
|
|
140
141
|
* maxYoungGenerationSizeMb defaults to 152mb through the cli option defaults.
|
|
141
142
|
* That default value was determined via https://github.com/ChainSafe/lodestar/issues/2115 and
|
|
@@ -147,8 +148,8 @@ export class WorkerNetworkCore implements INetworkCore {
|
|
|
147
148
|
* showed that there is a pretty big window of "correct" values but we can always tune as
|
|
148
149
|
* necessary
|
|
149
150
|
*/
|
|
150
|
-
|
|
151
|
-
}
|
|
151
|
+
resourceLimits: {maxYoungGenerationSizeMb: opts.maxYoungGenerationSizeMb},
|
|
152
|
+
};
|
|
152
153
|
|
|
153
154
|
const worker = new Worker(path.join(workerDir, "networkCoreWorker.js"), workerOpts);
|
|
154
155
|
|
|
@@ -169,15 +170,25 @@ export class WorkerNetworkCore implements INetworkCore {
|
|
|
169
170
|
|
|
170
171
|
async close(): Promise<void> {
|
|
171
172
|
this.modules.logger.debug("closing network core running in network worker");
|
|
172
|
-
|
|
173
|
+
try {
|
|
174
|
+
await withTimeout(async () => this.getApi().close(), NETWORK_CORE_CLOSE_TIMEOUT_MS);
|
|
175
|
+
} catch (e) {
|
|
176
|
+
this.modules.logger.debug("Error closing network core", {}, e as Error);
|
|
177
|
+
}
|
|
173
178
|
this.modules.logger.debug("terminating network worker");
|
|
174
|
-
await terminateWorkerThread({
|
|
179
|
+
const terminated = await terminateWorkerThread({
|
|
175
180
|
worker: this.getApi(),
|
|
176
181
|
retryCount: NETWORK_WORKER_EXIT_RETRY_COUNT,
|
|
177
182
|
retryMs: NETWORK_WORKER_EXIT_TIMEOUT_MS,
|
|
178
183
|
logger: this.modules.logger,
|
|
179
184
|
});
|
|
180
|
-
|
|
185
|
+
if (terminated) {
|
|
186
|
+
this.modules.logger.debug("terminated network worker");
|
|
187
|
+
} else {
|
|
188
|
+
// Nothing more to do, `process.exit()` joins the thread regardless so the process still waits
|
|
189
|
+
// on it. What matters is returning, so the caller can archive state and close the db
|
|
190
|
+
this.modules.logger.debug("Network worker did not terminate in time, continuing shutdown without it");
|
|
191
|
+
}
|
|
181
192
|
}
|
|
182
193
|
|
|
183
194
|
async test(): Promise<void> {
|