@lodestar/beacon-node 1.42.0 → 1.43.0-dev.07452fe3b7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +37 -9
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +49 -2
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +13 -10
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +2 -2
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +0 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/attesterSlashing.d.ts +8 -0
- package/lib/api/impl/lodestar/attesterSlashing.d.ts.map +1 -0
- package/lib/api/impl/lodestar/attesterSlashing.js +29 -0
- package/lib/api/impl/lodestar/attesterSlashing.js.map +1 -0
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +40 -1
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +74 -5
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +1 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +1 -2
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +4 -4
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts +4 -4
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +2 -4
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +2 -2
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +110 -58
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +51 -53
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +28 -14
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +95 -86
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts +5 -3
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +59 -26
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +4 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +25 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +1 -0
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +5 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +7 -5
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +16 -21
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.d.ts +23 -2
- package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js +89 -12
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +5 -3
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +50 -7
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +0 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +8 -4
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts +2 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +25 -5
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +4 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.d.ts +24 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js +79 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +14 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +30 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +2 -11
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -1
- package/lib/chain/chain.d.ts +9 -6
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +51 -42
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +16 -15
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -4
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +8 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +4 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +18 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +6 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +5 -0
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +5 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/index.d.ts +1 -0
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +1 -0
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/errors/proposerPreferences.d.ts +33 -0
- package/lib/chain/errors/proposerPreferences.d.ts.map +1 -0
- package/lib/chain/errors/proposerPreferences.js +13 -0
- package/lib/chain/errors/proposerPreferences.js.map +1 -0
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +21 -23
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +8 -5
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +7 -0
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +5 -2
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts +3 -2
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js +26 -4
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +48 -18
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +1 -7
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +1 -28
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +15 -10
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +83 -21
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/errors.d.ts +1 -11
- package/lib/chain/regen/errors.d.ts.map +1 -1
- package/lib/chain/regen/errors.js +0 -2
- package/lib/chain/regen/errors.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +7 -12
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -0
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.d.ts +6 -11
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +9 -44
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +0 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +8 -38
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/index.d.ts +1 -0
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +1 -0
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +19 -6
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +40 -22
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/seenCache/seenProposerPreferences.d.ts +15 -0
- package/lib/chain/seenCache/seenProposerPreferences.d.ts.map +1 -0
- package/lib/chain/seenCache/seenProposerPreferences.js +25 -0
- package/lib/chain/seenCache/seenProposerPreferences.js.map +1 -0
- package/lib/chain/stateCache/datastore/db.d.ts +5 -4
- package/lib/chain/stateCache/datastore/db.d.ts.map +1 -1
- package/lib/chain/stateCache/datastore/db.js +10 -32
- package/lib/chain/stateCache/datastore/db.js.map +1 -1
- package/lib/chain/stateCache/datastore/file.d.ts +1 -1
- package/lib/chain/stateCache/datastore/file.d.ts.map +1 -1
- package/lib/chain/stateCache/datastore/file.js +5 -5
- package/lib/chain/stateCache/datastore/file.js.map +1 -1
- package/lib/chain/stateCache/datastore/types.d.ts +1 -1
- package/lib/chain/stateCache/datastore/types.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +1 -7
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js +0 -8
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +13 -30
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +120 -216
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +8 -15
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +12 -0
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +12 -0
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +28 -5
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +19 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +27 -12
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +8 -4
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/proposerPreferences.d.ts +8 -0
- package/lib/chain/validation/proposerPreferences.d.ts.map +1 -0
- package/lib/chain/validation/proposerPreferences.js +69 -0
- package/lib/chain/validation/proposerPreferences.js.map +1 -0
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +4 -0
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +4 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +3 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +21 -14
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +1 -0
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -0
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/types.d.ts +20 -0
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +18 -0
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +1 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +4 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +7 -1
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +1 -0
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
- package/lib/network/gossip/scoringParameters.js +12 -1
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +31 -748
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +6 -0
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +1 -0
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +1 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +6 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +50 -22
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +5 -0
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +6 -5
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js +16 -7
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js +2 -0
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +18 -8
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +6 -0
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +24 -8
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +9 -5
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +3 -8
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +7 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +2 -2
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/range/batch.d.ts +23 -2
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +84 -33
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +6 -2
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +26 -7
- 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 +17 -6
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/types.d.ts +34 -0
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +34 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +22 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +602 -53
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +46 -10
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +164 -24
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +16 -2
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.d.ts +0 -1
- package/lib/sync/utils/pendingBlocksTree.d.ts.map +1 -1
- package/lib/sync/utils/pendingBlocksTree.js +0 -9
- package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +20 -5
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +17 -16
- package/src/api/impl/beacon/blocks/index.ts +51 -9
- package/src/api/impl/beacon/pool/index.ts +87 -1
- package/src/api/impl/beacon/state/index.ts +15 -15
- package/src/api/impl/beacon/state/utils.ts +2 -2
- package/src/api/impl/debug/index.ts +0 -1
- package/src/api/impl/lodestar/attesterSlashing.ts +43 -0
- package/src/api/impl/lodestar/index.ts +52 -2
- package/src/api/impl/validator/index.ts +91 -6
- package/src/chain/GetBlobsTracker.ts +1 -2
- package/src/chain/archiveStore/archiveStore.ts +5 -5
- package/src/chain/archiveStore/interface.ts +4 -4
- package/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +6 -8
- package/src/chain/archiveStore/utils/archiveBlocks.ts +153 -94
- package/src/chain/blocks/importBlock.ts +57 -80
- package/src/chain/blocks/importExecutionPayload.ts +116 -98
- package/src/chain/blocks/index.ts +74 -24
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +33 -1
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +1 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +7 -6
- package/src/chain/blocks/types.ts +16 -26
- package/src/chain/blocks/utils/chainSegment.ts +114 -17
- package/src/chain/blocks/verifyBlock.ts +70 -9
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +8 -5
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +26 -7
- package/src/chain/blocks/verifyBlocksSignatures.ts +9 -2
- package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +134 -0
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +41 -0
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +9 -18
- package/src/chain/chain.ts +75 -65
- package/src/chain/emitter.ts +15 -14
- package/src/chain/errors/attestationError.ts +6 -1
- package/src/chain/errors/blockError.ts +10 -1
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -0
- package/src/chain/errors/index.ts +1 -0
- package/src/chain/errors/proposerPreferences.ts +39 -0
- package/src/chain/forkChoice/index.ts +19 -28
- package/src/chain/interface.ts +16 -3
- package/src/chain/lightClient/index.ts +15 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +6 -1
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- package/src/chain/opPools/payloadAttestationPool.ts +29 -8
- package/src/chain/prepareNextSlot.ts +58 -19
- package/src/chain/produceBlock/computeNewStateRoot.ts +1 -37
- package/src/chain/produceBlock/produceBlockBody.ts +120 -26
- package/src/chain/regen/errors.ts +1 -6
- package/src/chain/regen/interface.ts +7 -12
- package/src/chain/regen/queued.ts +14 -55
- package/src/chain/regen/regen.ts +10 -43
- package/src/chain/seenCache/index.ts +1 -0
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +47 -25
- package/src/chain/seenCache/seenProposerPreferences.ts +29 -0
- package/src/chain/stateCache/datastore/db.ts +10 -33
- package/src/chain/stateCache/datastore/file.ts +5 -6
- package/src/chain/stateCache/datastore/types.ts +2 -3
- package/src/chain/stateCache/fifoBlockStateCache.ts +1 -10
- package/src/chain/stateCache/persistentCheckpointsCache.ts +139 -247
- package/src/chain/stateCache/types.ts +8 -14
- package/src/chain/validation/aggregateAndProof.ts +13 -0
- package/src/chain/validation/attestation.ts +13 -0
- package/src/chain/validation/block.ts +31 -7
- package/src/chain/validation/executionPayloadBid.ts +21 -3
- package/src/chain/validation/executionPayloadEnvelope.ts +32 -13
- package/src/chain/validation/payloadAttestationMessage.ts +9 -3
- package/src/chain/validation/proposerPreferences.ts +91 -0
- package/src/chain/validation/syncCommittee.ts +5 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -1
- package/src/chain/validatorMonitor.ts +3 -2
- package/src/db/repositories/executionPayloadEnvelopeArchive.ts +1 -1
- package/src/execution/engine/http.ts +21 -14
- package/src/execution/engine/interface.ts +1 -0
- package/src/execution/engine/mock.ts +8 -1
- package/src/execution/engine/types.ts +41 -0
- package/src/metrics/metrics/lodestar.ts +4 -0
- package/src/network/gossip/interface.ts +6 -0
- package/src/network/gossip/scoringParameters.ts +14 -1
- package/src/network/gossip/topic.ts +6 -0
- package/src/network/interface.ts +1 -0
- package/src/network/network.ts +12 -1
- package/src/network/processor/gossipHandlers.ts +66 -27
- package/src/network/processor/gossipQueues/index.ts +5 -0
- package/src/network/processor/index.ts +6 -5
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +17 -7
- package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +3 -0
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +26 -8
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +11 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +36 -8
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +10 -5
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +3 -12
- package/src/node/nodejs.ts +8 -3
- package/src/node/notifier.ts +7 -2
- package/src/sync/range/batch.ts +142 -38
- package/src/sync/range/chain.ts +37 -9
- package/src/sync/range/range.ts +18 -6
- package/src/sync/types.ts +72 -0
- package/src/sync/unknownBlock.ts +760 -57
- package/src/sync/utils/downloadByRange.ts +274 -39
- package/src/sync/utils/downloadByRoot.ts +24 -2
- package/src/sync/utils/pendingBlocksTree.ts +0 -15
- package/src/util/sszBytes.ts +25 -5
|
@@ -90,6 +90,19 @@ async function validateAggregateAndProof(
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// [REJECT] If `aggregate.data.index == 1` (payload present for a past
|
|
94
|
+
// block), the execution payload for `block` passes validation.
|
|
95
|
+
// [IGNORE] When `aggregate.data.index == 1` (payload present for a past block),
|
|
96
|
+
// the corresponding execution payload for `block` has been seen (a client MAY queue
|
|
97
|
+
// attestations for processing once the payload is retrieved and SHOULD request the
|
|
98
|
+
// payload envelope via `ExecutionPayloadEnvelopesByRoot`).
|
|
99
|
+
if (block !== null && attData.index === 1 && !chain.seenPayloadEnvelope(toRootHex(attData.beaconBlockRoot))) {
|
|
100
|
+
throw new AttestationError(GossipAction.IGNORE, {
|
|
101
|
+
code: AttestationErrorCode.EXECUTION_PAYLOAD_NOT_SEEN,
|
|
102
|
+
beaconBlockRoot: toRootHex(attData.beaconBlockRoot),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
93
106
|
// [REJECT] len(committee_indices) == 1, where committee_indices = get_committee_indices(aggregate)
|
|
94
107
|
committeeIndex = (aggregate as electra.Attestation).committeeBits.getSingleTrueBit();
|
|
95
108
|
if (committeeIndex === null) {
|
|
@@ -315,6 +315,19 @@ async function validateAttestationNoSignatureCheck(
|
|
|
315
315
|
code: AttestationErrorCode.PREMATURELY_INDICATED_PAYLOAD_PRESENT,
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
+
|
|
319
|
+
// [REJECT] If `attestation.data.index == 1` (payload present for a past
|
|
320
|
+
// block), the execution payload for `block` passes validation.
|
|
321
|
+
// [IGNORE] When `attestation.data.index == 1` (payload present for a past block),
|
|
322
|
+
// the corresponding execution payload for `block` has been seen (a client MAY queue
|
|
323
|
+
// attestations for processing once the payload is retrieved and SHOULD request the
|
|
324
|
+
// payload envelope via `ExecutionPayloadEnvelopesByRoot`).
|
|
325
|
+
if (block !== null && attData.index === 1 && !chain.seenPayloadEnvelope(toRootHex(attData.beaconBlockRoot))) {
|
|
326
|
+
throw new AttestationError(GossipAction.IGNORE, {
|
|
327
|
+
code: AttestationErrorCode.EXECUTION_PAYLOAD_NOT_SEEN,
|
|
328
|
+
beaconBlockRoot: toRootHex(attData.beaconBlockRoot),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
318
331
|
} else {
|
|
319
332
|
// [REJECT] attestation.data.index == 0
|
|
320
333
|
if (attData.index !== 0) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
+
import {ExecutionStatus} from "@lodestar/fork-choice";
|
|
2
3
|
import {ForkName, isForkPostBellatrix, isForkPostDeneb, isForkPostGloas} from "@lodestar/params";
|
|
3
4
|
import {
|
|
4
5
|
computeEpochAtSlot,
|
|
@@ -6,6 +7,7 @@ import {
|
|
|
6
7
|
computeTimeAtSlot,
|
|
7
8
|
getBlockProposerSignatureSet,
|
|
8
9
|
isExecutionBlockBodyType,
|
|
10
|
+
isStatePostBellatrix,
|
|
9
11
|
} from "@lodestar/state-transition";
|
|
10
12
|
import {SignedBeaconBlock, deneb, gloas, isGloasBeaconBlock} from "@lodestar/types";
|
|
11
13
|
import {byteArrayEquals, sleep, toRootHex} from "@lodestar/utils";
|
|
@@ -70,12 +72,7 @@ export async function validateGossipBlock(
|
|
|
70
72
|
// [REJECT] The current finalized_checkpoint is an ancestor of block -- i.e.
|
|
71
73
|
// get_ancestor(store, block.parent_root, compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)) == store.finalized_checkpoint.root
|
|
72
74
|
const parentRoot = toRootHex(block.parentRoot);
|
|
73
|
-
const parentBlock =
|
|
74
|
-
? chain.forkChoice.getBlockHexAndBlockHash(
|
|
75
|
-
parentRoot,
|
|
76
|
-
toRootHex(block.body.signedExecutionPayloadBid.message.parentBlockHash)
|
|
77
|
-
)
|
|
78
|
-
: chain.forkChoice.getBlockHexDefaultStatus(parentRoot);
|
|
75
|
+
const parentBlock = chain.forkChoice.getBlockHexDefaultStatus(parentRoot);
|
|
79
76
|
if (parentBlock === null) {
|
|
80
77
|
// If fork choice does *not* consider the parent to be a descendant of the finalized block,
|
|
81
78
|
// then there are two more cases:
|
|
@@ -90,6 +87,28 @@ export async function validateGossipBlock(
|
|
|
90
87
|
throw new BlockGossipError(GossipAction.IGNORE, {code: BlockErrorCode.PARENT_UNKNOWN, parentRoot});
|
|
91
88
|
}
|
|
92
89
|
|
|
90
|
+
// [IGNORE] The block's parent (defined by `block.parent_root`) passes all validation
|
|
91
|
+
// (including execution node verification of the `block.body.execution_payload`)
|
|
92
|
+
if (isForkPostBellatrix(fork) && parentBlock.executionStatus === ExecutionStatus.Invalid) {
|
|
93
|
+
throw new BlockGossipError(GossipAction.IGNORE, {
|
|
94
|
+
code: BlockErrorCode.PARENT_EXECUTION_INVALID,
|
|
95
|
+
parentRoot,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// [IGNORE] The block's parent execution payload (defined by bid.parent_block_hash) has been seen
|
|
100
|
+
// (via gossip or non-gossip sources) (a client MAY queue blocks for processing once the parent payload is retrieved).
|
|
101
|
+
if (isGloasBeaconBlock(block)) {
|
|
102
|
+
const parentBlockHashHex = toRootHex(block.body.signedExecutionPayloadBid.message.parentBlockHash);
|
|
103
|
+
if (chain.forkChoice.getBlockHexAndBlockHash(parentRoot, parentBlockHashHex) === null) {
|
|
104
|
+
throw new BlockGossipError(GossipAction.IGNORE, {
|
|
105
|
+
code: BlockErrorCode.PARENT_PAYLOAD_UNKNOWN,
|
|
106
|
+
parentRoot,
|
|
107
|
+
parentBlockHash: parentBlockHashHex,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
93
112
|
// [IGNORE] The attestation head block is too far behind the attestation slot, causing many skip slots.
|
|
94
113
|
// This is deemed a DoS risk because we need to get the proposerShuffling. To get the shuffling we have
|
|
95
114
|
// to do a bunch of epoch transitions, the longer the distance between the parent and block,
|
|
@@ -174,7 +193,7 @@ export async function validateGossipBlock(
|
|
|
174
193
|
if (isForkPostBellatrix(fork) && !isForkPostGloas(fork)) {
|
|
175
194
|
if (!isExecutionBlockBodyType(block.body)) throw Error("Not execution block body type");
|
|
176
195
|
const executionPayload = block.body.executionPayload;
|
|
177
|
-
if (blockState.isExecutionStateType && blockState.isExecutionEnabled(block)) {
|
|
196
|
+
if (isStatePostBellatrix(blockState) && blockState.isExecutionStateType && blockState.isExecutionEnabled(block)) {
|
|
178
197
|
const expectedTimestamp = computeTimeAtSlot(config, blockSlot, chain.genesisTime);
|
|
179
198
|
if (executionPayload.timestamp !== computeTimeAtSlot(config, blockSlot, chain.genesisTime)) {
|
|
180
199
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
@@ -186,6 +205,11 @@ export async function validateGossipBlock(
|
|
|
186
205
|
}
|
|
187
206
|
}
|
|
188
207
|
|
|
208
|
+
// [REJECT] The proposer index is a valid validator index
|
|
209
|
+
if (proposerIndex >= blockState.validatorCount) {
|
|
210
|
+
throw new BlockGossipError(GossipAction.REJECT, {code: BlockErrorCode.UNKNOWN_PROPOSER, proposerIndex});
|
|
211
|
+
}
|
|
212
|
+
|
|
189
213
|
// [REJECT] The proposer signature, signed_beacon_block.signature, is valid with respect to the proposer_index pubkey.
|
|
190
214
|
if (!chain.seenBlockInputCache.isVerifiedProposerSignature(blockSlot, blockRoot, signedBlock.signature)) {
|
|
191
215
|
const signatureSet = getBlockProposerSignatureSet(chain.config, signedBlock);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {PublicKey} from "@chainsafe/blst";
|
|
2
2
|
import {
|
|
3
|
+
computeEpochAtSlot,
|
|
3
4
|
createSingleSignatureSetFromComponents,
|
|
4
5
|
getExecutionPayloadBidSigningRoot,
|
|
5
6
|
isActiveBuilder,
|
|
7
|
+
isStatePostGloas,
|
|
6
8
|
} from "@lodestar/state-transition";
|
|
7
9
|
import {gloas} from "@lodestar/types";
|
|
8
10
|
import {toRootHex} from "@lodestar/utils";
|
|
@@ -32,6 +34,9 @@ async function validateExecutionPayloadBid(
|
|
|
32
34
|
const parentBlockRootHex = toRootHex(bid.parentBlockRoot);
|
|
33
35
|
const parentBlockHashHex = toRootHex(bid.parentBlockHash);
|
|
34
36
|
const state = await chain.getHeadStateAtCurrentEpoch(RegenCaller.validateGossipExecutionPayloadBid);
|
|
37
|
+
if (!isStatePostGloas(state)) {
|
|
38
|
+
throw new Error(`Expected gloas+ state for execution payload bid validation, got fork=${state.forkName}`);
|
|
39
|
+
}
|
|
35
40
|
|
|
36
41
|
// [IGNORE] `bid.slot` is the current slot or the next slot.
|
|
37
42
|
const currentSlot = chain.clock.currentSlot;
|
|
@@ -72,6 +77,19 @@ async function validateExecutionPayloadBid(
|
|
|
72
77
|
// `SignedProposerPreferences` associated with `bid.slot`.
|
|
73
78
|
// TODO GLOAS: Implement this along with proposer preference
|
|
74
79
|
|
|
80
|
+
// [REJECT] The length of KZG commitments is less than or equal to the limitation defined in the
|
|
81
|
+
// consensus layer -- i.e. validate that
|
|
82
|
+
// `len(bid.blob_kzg_commitments) <= get_blob_parameters(compute_epoch_at_slot(bid.slot)).max_blobs_per_block`.
|
|
83
|
+
const blobKzgCommitmentsLen = bid.blobKzgCommitments.length;
|
|
84
|
+
const maxBlobsPerBlock = chain.config.getMaxBlobsPerBlock(computeEpochAtSlot(bid.slot));
|
|
85
|
+
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
86
|
+
throw new ExecutionPayloadBidError(GossipAction.REJECT, {
|
|
87
|
+
code: ExecutionPayloadBidErrorCode.TOO_MANY_KZG_COMMITMENTS,
|
|
88
|
+
blobKzgCommitmentsLen,
|
|
89
|
+
commitmentLimit: maxBlobsPerBlock,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
75
93
|
// [IGNORE] this is the first signed bid seen with a valid signature from the given builder for this slot.
|
|
76
94
|
if (chain.seenExecutionPayloadBids.isKnown(bid.slot, bid.builderIndex)) {
|
|
77
95
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
@@ -83,9 +101,9 @@ async function validateExecutionPayloadBid(
|
|
|
83
101
|
});
|
|
84
102
|
}
|
|
85
103
|
|
|
86
|
-
// [IGNORE] this bid is the highest value bid seen for the
|
|
87
|
-
//
|
|
88
|
-
const bestBid = chain.executionPayloadBidPool.getBestBid(
|
|
104
|
+
// [IGNORE] this bid is the highest value bid seen for the tuple
|
|
105
|
+
// `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
|
|
106
|
+
const bestBid = chain.executionPayloadBidPool.getBestBid(bid.slot, parentBlockHashHex, parentBlockRootHex);
|
|
89
107
|
if (bestBid !== null && bestBid.value >= bid.value) {
|
|
90
108
|
throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
|
|
91
109
|
code: ExecutionPayloadBidErrorCode.BID_TOO_LOW,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {PayloadStatus} from "@lodestar/fork-choice";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
computeStartSlotAtEpoch,
|
|
4
|
+
getExecutionPayloadEnvelopeSignatureSet,
|
|
5
|
+
isStatePostGloas,
|
|
6
|
+
} from "@lodestar/state-transition";
|
|
7
|
+
import {gloas, ssz} from "@lodestar/types";
|
|
8
|
+
import {byteArrayEquals, toRootHex} from "@lodestar/utils";
|
|
5
9
|
import {ExecutionPayloadEnvelopeError, ExecutionPayloadEnvelopeErrorCode, GossipAction} from "../errors/index.js";
|
|
6
10
|
import {IBeaconChain} from "../index.js";
|
|
7
11
|
import {RegenCaller} from "../regen/index.js";
|
|
@@ -28,7 +32,7 @@ async function validateExecutionPayloadEnvelope(
|
|
|
28
32
|
const {payload} = envelope;
|
|
29
33
|
const blockRootHex = toRootHex(envelope.beaconBlockRoot);
|
|
30
34
|
|
|
31
|
-
// [IGNORE] The envelope's block root `envelope.
|
|
35
|
+
// [IGNORE] The envelope's block root `envelope.beacon_block_root` has been seen (via
|
|
32
36
|
// gossip or non-gossip sources) (a client MAY queue payload for processing once
|
|
33
37
|
// the block is retrieved).
|
|
34
38
|
// TODO GLOAS: Need to review this, we should queue the envelope for later
|
|
@@ -49,7 +53,7 @@ async function validateExecutionPayloadEnvelope(
|
|
|
49
53
|
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
50
54
|
code: ExecutionPayloadEnvelopeErrorCode.ENVELOPE_ALREADY_KNOWN,
|
|
51
55
|
blockRoot: blockRootHex,
|
|
52
|
-
slot:
|
|
56
|
+
slot: payload.slotNumber,
|
|
53
57
|
});
|
|
54
58
|
}
|
|
55
59
|
|
|
@@ -61,13 +65,13 @@ async function validateExecutionPayloadEnvelope(
|
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
// [IGNORE] The envelope is from a slot greater than or equal to the latest finalized slot -- i.e. validate that `
|
|
68
|
+
// [IGNORE] The envelope is from a slot greater than or equal to the latest finalized slot -- i.e. validate that `payload.slotNumber >= compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)`
|
|
65
69
|
const finalizedCheckpoint = chain.forkChoice.getFinalizedCheckpoint();
|
|
66
70
|
const finalizedSlot = computeStartSlotAtEpoch(finalizedCheckpoint.epoch);
|
|
67
|
-
if (
|
|
71
|
+
if (payload.slotNumber < finalizedSlot) {
|
|
68
72
|
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
69
73
|
code: ExecutionPayloadEnvelopeErrorCode.BELONG_TO_FINALIZED_BLOCK,
|
|
70
|
-
envelopeSlot:
|
|
74
|
+
envelopeSlot: payload.slotNumber,
|
|
71
75
|
finalizedSlot,
|
|
72
76
|
});
|
|
73
77
|
}
|
|
@@ -76,11 +80,11 @@ async function validateExecutionPayloadEnvelope(
|
|
|
76
80
|
// TODO GLOAS: implement this. Technically if we cannot get proto block from fork choice,
|
|
77
81
|
// it is possible that the block didn't pass the validation
|
|
78
82
|
|
|
79
|
-
// [REJECT] `block.slot` equals `
|
|
80
|
-
if (block.slot !==
|
|
83
|
+
// [REJECT] `block.slot` equals `payload.slotNumber`.
|
|
84
|
+
if (block.slot !== payload.slotNumber) {
|
|
81
85
|
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
82
86
|
code: ExecutionPayloadEnvelopeErrorCode.SLOT_MISMATCH,
|
|
83
|
-
envelopeSlot:
|
|
87
|
+
envelopeSlot: payload.slotNumber,
|
|
84
88
|
blockSlot: block.slot,
|
|
85
89
|
});
|
|
86
90
|
}
|
|
@@ -103,17 +107,32 @@ async function validateExecutionPayloadEnvelope(
|
|
|
103
107
|
});
|
|
104
108
|
}
|
|
105
109
|
|
|
106
|
-
//
|
|
110
|
+
// [REJECT] `hash_tree_root(envelope.execution_requests) == bid.execution_requests_root`
|
|
111
|
+
const requestsRoot = ssz.electra.ExecutionRequests.hashTreeRoot(envelope.executionRequests);
|
|
112
|
+
if (!byteArrayEquals(requestsRoot, payloadInput.getBid().executionRequestsRoot)) {
|
|
113
|
+
throw new ExecutionPayloadEnvelopeError(GossipAction.REJECT, {
|
|
114
|
+
code: ExecutionPayloadEnvelopeErrorCode.EXECUTION_REQUESTS_ROOT_MISMATCH,
|
|
115
|
+
envelopeRequestsRoot: toRootHex(requestsRoot),
|
|
116
|
+
bidRequestsRoot: toRootHex(payloadInput.getBid().executionRequestsRoot),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Get the block state to verify the builder's signature.
|
|
107
121
|
const blockState = await chain.regen
|
|
108
122
|
.getState(block.stateRoot, RegenCaller.validateGossipPayloadEnvelope)
|
|
109
123
|
.catch(() => {
|
|
110
124
|
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
111
125
|
code: ExecutionPayloadEnvelopeErrorCode.UNKNOWN_BLOCK_STATE,
|
|
112
126
|
blockRoot: blockRootHex,
|
|
113
|
-
slot:
|
|
127
|
+
slot: payload.slotNumber,
|
|
114
128
|
});
|
|
115
129
|
});
|
|
130
|
+
if (!isStatePostGloas(blockState)) {
|
|
131
|
+
throw new Error(`Expected gloas+ state for execution payload envelope validation, got fork=${blockState.forkName}`);
|
|
132
|
+
}
|
|
116
133
|
|
|
134
|
+
// [REJECT] `signed_execution_payload_envelope.signature` is valid as verified
|
|
135
|
+
// by `verify_execution_payload_envelope_signature`.
|
|
117
136
|
const signatureSet = getExecutionPayloadEnvelopeSignatureSet(
|
|
118
137
|
chain.config,
|
|
119
138
|
chain.pubkeyCache,
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
computeEpochAtSlot,
|
|
3
3
|
createSingleSignatureSetFromComponents,
|
|
4
4
|
getPayloadAttestationDataSigningRoot,
|
|
5
|
+
isStatePostGloas,
|
|
5
6
|
} from "@lodestar/state-transition";
|
|
6
7
|
import {RootHex, gloas, ssz} from "@lodestar/types";
|
|
7
8
|
import {toRootHex} from "@lodestar/utils";
|
|
@@ -17,7 +18,8 @@ export async function validateApiPayloadAttestationMessage(
|
|
|
17
18
|
chain: IBeaconChain,
|
|
18
19
|
payloadAttestationMessage: gloas.PayloadAttestationMessage
|
|
19
20
|
): Promise<PayloadAttestationValidationResult> {
|
|
20
|
-
|
|
21
|
+
const prioritizeBls = true;
|
|
22
|
+
return validatePayloadAttestationMessage(chain, payloadAttestationMessage, prioritizeBls);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export async function validateGossipPayloadAttestationMessage(
|
|
@@ -29,7 +31,8 @@ export async function validateGossipPayloadAttestationMessage(
|
|
|
29
31
|
|
|
30
32
|
async function validatePayloadAttestationMessage(
|
|
31
33
|
chain: IBeaconChain,
|
|
32
|
-
payloadAttestationMessage: gloas.PayloadAttestationMessage
|
|
34
|
+
payloadAttestationMessage: gloas.PayloadAttestationMessage,
|
|
35
|
+
prioritizeBls = false
|
|
33
36
|
): Promise<PayloadAttestationValidationResult> {
|
|
34
37
|
const {data, validatorIndex} = payloadAttestationMessage;
|
|
35
38
|
const epoch = computeEpochAtSlot(data.slot);
|
|
@@ -66,6 +69,9 @@ async function validatePayloadAttestationMessage(
|
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
const state = chain.getHeadState();
|
|
72
|
+
if (!isStatePostGloas(state)) {
|
|
73
|
+
throw new Error(`Expected gloas+ state for payload attestation validation, got fork=${state.forkName}`);
|
|
74
|
+
}
|
|
69
75
|
|
|
70
76
|
// [REJECT] The message's block `data.beacon_block_root` passes validation.
|
|
71
77
|
// TODO GLOAS: implement this. Technically if we cannot get proto block from fork choice,
|
|
@@ -98,7 +104,7 @@ async function validatePayloadAttestationMessage(
|
|
|
98
104
|
payloadAttestationMessage.signature
|
|
99
105
|
);
|
|
100
106
|
|
|
101
|
-
if (!(await chain.bls.verifySignatureSets([signatureSet]))) {
|
|
107
|
+
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
102
108
|
throw new PayloadAttestationError(GossipAction.REJECT, {
|
|
103
109
|
code: PayloadAttestationErrorCode.INVALID_SIGNATURE,
|
|
104
110
|
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
|
+
import {
|
|
3
|
+
computeEpochAtSlot,
|
|
4
|
+
createSingleSignatureSetFromComponents,
|
|
5
|
+
getProposerPreferencesSigningRoot,
|
|
6
|
+
isStatePostGloas,
|
|
7
|
+
} from "@lodestar/state-transition";
|
|
8
|
+
import {gloas} from "@lodestar/types";
|
|
9
|
+
import {GossipAction, ProposerPreferencesError, ProposerPreferencesErrorCode} from "../errors/index.js";
|
|
10
|
+
import {IBeaconChain} from "../index.js";
|
|
11
|
+
import {RegenCaller} from "../regen/index.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Validates a gossiped `SignedProposerPreferences` per
|
|
15
|
+
* https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/p2p-interface.md#proposer_preferences
|
|
16
|
+
*/
|
|
17
|
+
export async function validateGossipProposerPreferences(
|
|
18
|
+
chain: IBeaconChain,
|
|
19
|
+
signedProposerPreferences: gloas.SignedProposerPreferences
|
|
20
|
+
): Promise<void> {
|
|
21
|
+
const preferences = signedProposerPreferences.message;
|
|
22
|
+
const {proposalSlot, validatorIndex} = preferences;
|
|
23
|
+
const proposalEpoch = computeEpochAtSlot(proposalSlot);
|
|
24
|
+
|
|
25
|
+
// [IGNORE] `preferences.proposal_slot` is in the current or next epoch.
|
|
26
|
+
const currentEpoch = chain.clock.currentEpoch;
|
|
27
|
+
if (proposalEpoch < currentEpoch || proposalEpoch > currentEpoch + 1) {
|
|
28
|
+
throw new ProposerPreferencesError(GossipAction.IGNORE, {
|
|
29
|
+
code: ProposerPreferencesErrorCode.INVALID_EPOCH,
|
|
30
|
+
proposalSlot,
|
|
31
|
+
currentEpoch,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// [IGNORE] `preferences.proposal_slot` has not already passed.
|
|
36
|
+
const currentSlot = chain.clock.currentSlot;
|
|
37
|
+
if (proposalSlot <= currentSlot) {
|
|
38
|
+
throw new ProposerPreferencesError(GossipAction.IGNORE, {
|
|
39
|
+
code: ProposerPreferencesErrorCode.PROPOSAL_SLOT_PASSED,
|
|
40
|
+
proposalSlot,
|
|
41
|
+
currentSlot,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const state = await chain.getHeadStateAtCurrentEpoch(RegenCaller.validateGossipProposerPreferences);
|
|
46
|
+
if (!isStatePostGloas(state)) {
|
|
47
|
+
throw new Error(`Expected gloas+ state for proposer preferences validation, got fork=${state.forkName}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// [REJECT] `preferences.validator_index` is present at the correct slot in the current or next
|
|
51
|
+
// epoch's portion of `state.proposer_lookahead` — i.e. `is_valid_proposal_slot(state, preferences)`
|
|
52
|
+
// returns True.
|
|
53
|
+
const epochOffset = proposalEpoch - state.epoch;
|
|
54
|
+
const proposers = epochOffset === 0 ? state.currentProposers : state.nextProposers;
|
|
55
|
+
const expectedProposer = proposers[proposalSlot % SLOTS_PER_EPOCH];
|
|
56
|
+
if (epochOffset < 0 || epochOffset > 1 || expectedProposer !== validatorIndex) {
|
|
57
|
+
throw new ProposerPreferencesError(GossipAction.REJECT, {
|
|
58
|
+
code: ProposerPreferencesErrorCode.INVALID_PROPOSER,
|
|
59
|
+
proposalSlot,
|
|
60
|
+
validatorIndex,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// [IGNORE] The `signed_proposer_preferences` is the first valid message received from the validator
|
|
65
|
+
// with index `preferences.validator_index` and the given slot `preferences.proposal_slot`.
|
|
66
|
+
if (chain.seenProposerPreferences.isKnown(proposalSlot, validatorIndex)) {
|
|
67
|
+
throw new ProposerPreferencesError(GossipAction.IGNORE, {
|
|
68
|
+
code: ProposerPreferencesErrorCode.ALREADY_KNOWN,
|
|
69
|
+
proposalSlot,
|
|
70
|
+
validatorIndex,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// [REJECT] `signed_proposer_preferences.signature` is valid with respect to the validator's public key.
|
|
75
|
+
const signatureSet = createSingleSignatureSetFromComponents(
|
|
76
|
+
chain.pubkeyCache.getOrThrow(validatorIndex),
|
|
77
|
+
getProposerPreferencesSigningRoot(chain.config, preferences),
|
|
78
|
+
signedProposerPreferences.signature
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true}))) {
|
|
82
|
+
throw new ProposerPreferencesError(GossipAction.REJECT, {
|
|
83
|
+
code: ProposerPreferencesErrorCode.INVALID_SIGNATURE,
|
|
84
|
+
proposalSlot,
|
|
85
|
+
validatorIndex,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Valid
|
|
90
|
+
chain.seenProposerPreferences.add(proposalSlot, validatorIndex);
|
|
91
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {SYNC_COMMITTEE_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
2
|
-
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
2
|
+
import {IBeaconStateView, isStatePostAltair} from "@lodestar/state-transition";
|
|
3
3
|
import {SubnetID, altair} from "@lodestar/types";
|
|
4
4
|
import {toRootHex} from "@lodestar/utils";
|
|
5
5
|
import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js";
|
|
@@ -148,6 +148,10 @@ function getIndicesInSubcommittee(
|
|
|
148
148
|
subnet: SubnetID,
|
|
149
149
|
data: Pick<altair.SyncCommitteeMessage, "slot" | "validatorIndex">
|
|
150
150
|
): IndexInSubcommittee[] | null {
|
|
151
|
+
if (!isStatePostAltair(headState)) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
151
155
|
const syncCommittee = headState.getIndexedSyncCommittee(data.slot);
|
|
152
156
|
const indexesInCommittee = syncCommittee.validatorIndexMap.get(data.validatorIndex);
|
|
153
157
|
if (indexesInCommittee === undefined) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
2
|
-
import {IBeaconStateView, isSyncCommitteeAggregator} from "@lodestar/state-transition";
|
|
2
|
+
import {IBeaconStateView, isStatePostAltair, isSyncCommitteeAggregator} from "@lodestar/state-transition";
|
|
3
3
|
import {ValidatorIndex, altair} from "@lodestar/types";
|
|
4
4
|
import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js";
|
|
5
5
|
import {IBeaconChain} from "../interface.js";
|
|
@@ -107,6 +107,10 @@ function getContributionIndices(
|
|
|
107
107
|
state: IBeaconStateView,
|
|
108
108
|
contribution: altair.SyncCommitteeContribution
|
|
109
109
|
): ValidatorIndex[] {
|
|
110
|
+
if (!isStatePostAltair(state)) {
|
|
111
|
+
throw new Error("Expected Altair state for sync committee contribution");
|
|
112
|
+
}
|
|
113
|
+
|
|
110
114
|
const startIndex = contribution.subcommitteeIndex * SYNC_COMMITTEE_SUBNET_SIZE;
|
|
111
115
|
|
|
112
116
|
const syncCommittee = state.getIndexedSyncCommittee(contribution.slot);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
3
3
|
import {
|
|
4
4
|
IBeaconStateView,
|
|
5
5
|
ParticipationFlags,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
computeStartSlotAtEpoch,
|
|
8
8
|
computeTimeAtSlot,
|
|
9
9
|
getCurrentSlot,
|
|
10
|
+
isStatePostAltair,
|
|
10
11
|
parseAttesterFlags,
|
|
11
12
|
parseParticipationFlags,
|
|
12
13
|
} from "@lodestar/state-transition";
|
|
@@ -740,7 +741,7 @@ export function createValidatorMonitor(
|
|
|
740
741
|
|
|
741
742
|
const rootCache = new RootHexCache(headState);
|
|
742
743
|
|
|
743
|
-
if (
|
|
744
|
+
if (isStatePostAltair(headState)) {
|
|
744
745
|
const prevEpochStartSlot = computeStartSlotAtEpoch(prevEpoch);
|
|
745
746
|
const prevEpochTargetRoot = toRootHex(headState.getBlockRootAtSlot(prevEpochStartSlot));
|
|
746
747
|
|
|
@@ -19,7 +19,7 @@ export class ExecutionPayloadEnvelopeArchiveRepository extends Repository<Slot,
|
|
|
19
19
|
* Id is the slot from the envelope
|
|
20
20
|
*/
|
|
21
21
|
getId(value: gloas.SignedExecutionPayloadEnvelope): Slot {
|
|
22
|
-
return value.message.
|
|
22
|
+
return value.message.payload.slotNumber;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
encodeKey(id: Slot): Uint8Array {
|
|
@@ -216,13 +216,15 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
216
216
|
executionRequests?: ExecutionRequests
|
|
217
217
|
): Promise<ExecutePayloadResponse> {
|
|
218
218
|
const method =
|
|
219
|
-
ForkSeq[fork] >= ForkSeq.
|
|
220
|
-
? "
|
|
221
|
-
: ForkSeq[fork] >= ForkSeq.
|
|
222
|
-
? "
|
|
223
|
-
: ForkSeq[fork] >= ForkSeq.
|
|
224
|
-
? "
|
|
225
|
-
:
|
|
219
|
+
ForkSeq[fork] >= ForkSeq.gloas
|
|
220
|
+
? "engine_newPayloadV5"
|
|
221
|
+
: ForkSeq[fork] >= ForkSeq.electra
|
|
222
|
+
? "engine_newPayloadV4"
|
|
223
|
+
: ForkSeq[fork] >= ForkSeq.deneb
|
|
224
|
+
? "engine_newPayloadV3"
|
|
225
|
+
: ForkSeq[fork] >= ForkSeq.capella
|
|
226
|
+
? "engine_newPayloadV2"
|
|
227
|
+
: "engine_newPayloadV1";
|
|
226
228
|
|
|
227
229
|
const serializedExecutionPayload = serializeExecutionPayload(fork, executionPayload);
|
|
228
230
|
|
|
@@ -244,7 +246,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
244
246
|
}
|
|
245
247
|
const serializedExecutionRequests = serializeExecutionRequests(executionRequests);
|
|
246
248
|
engineRequest = {
|
|
247
|
-
method: "engine_newPayloadV4",
|
|
249
|
+
method: ForkSeq[fork] >= ForkSeq.gloas ? "engine_newPayloadV5" : "engine_newPayloadV4",
|
|
248
250
|
params: [
|
|
249
251
|
serializedExecutionPayload,
|
|
250
252
|
serializedVersionedHashes,
|
|
@@ -348,11 +350,13 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
348
350
|
// Once on capella, should this need to be permanently switched to v2 when payload attrs
|
|
349
351
|
// not provided
|
|
350
352
|
const method =
|
|
351
|
-
ForkSeq[fork] >= ForkSeq.
|
|
352
|
-
? "
|
|
353
|
-
: ForkSeq[fork] >= ForkSeq.
|
|
354
|
-
? "
|
|
355
|
-
:
|
|
353
|
+
ForkSeq[fork] >= ForkSeq.gloas
|
|
354
|
+
? "engine_forkchoiceUpdatedV4"
|
|
355
|
+
: ForkSeq[fork] >= ForkSeq.deneb
|
|
356
|
+
? "engine_forkchoiceUpdatedV3"
|
|
357
|
+
: ForkSeq[fork] >= ForkSeq.capella
|
|
358
|
+
? "engine_forkchoiceUpdatedV2"
|
|
359
|
+
: "engine_forkchoiceUpdatedV1";
|
|
356
360
|
const payloadAttributesRpc = payloadAttributes ? serializePayloadAttributes(payloadAttributes) : undefined;
|
|
357
361
|
// If we are just fcUing and not asking execution for payload, retry is not required
|
|
358
362
|
// and we can move on, as the next fcU will be issued soon on the new slot
|
|
@@ -438,9 +442,12 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
438
442
|
case ForkName.electra:
|
|
439
443
|
method = "engine_getPayloadV4";
|
|
440
444
|
break;
|
|
441
|
-
|
|
445
|
+
case ForkName.fulu:
|
|
442
446
|
method = "engine_getPayloadV5";
|
|
443
447
|
break;
|
|
448
|
+
default:
|
|
449
|
+
method = "engine_getPayloadV6";
|
|
450
|
+
break;
|
|
444
451
|
}
|
|
445
452
|
const payloadResponse = await this.rpc.fetchWithRetries<
|
|
446
453
|
EngineApiRpcReturnTypes[typeof method],
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
SLOTS_PER_EPOCH,
|
|
12
12
|
} from "@lodestar/params";
|
|
13
13
|
import {computeTimeAtSlot} from "@lodestar/state-transition";
|
|
14
|
-
import {ExecutionPayload, RootHex, bellatrix, deneb, ssz} from "@lodestar/types";
|
|
14
|
+
import {ExecutionPayload, RootHex, bellatrix, deneb, gloas, ssz} from "@lodestar/types";
|
|
15
15
|
import {fromHex, toRootHex} from "@lodestar/utils";
|
|
16
16
|
import {ZERO_HASH_HEX} from "../../constants/index.js";
|
|
17
17
|
import {INTEROP_BLOCK_HASH} from "../../node/utils/interop/state.js";
|
|
@@ -132,14 +132,17 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
132
132
|
engine_newPayloadV2: this.notifyNewPayload.bind(this),
|
|
133
133
|
engine_newPayloadV3: this.notifyNewPayload.bind(this),
|
|
134
134
|
engine_newPayloadV4: this.notifyNewPayload.bind(this),
|
|
135
|
+
engine_newPayloadV5: this.notifyNewPayload.bind(this),
|
|
135
136
|
engine_forkchoiceUpdatedV1: this.notifyForkchoiceUpdate.bind(this),
|
|
136
137
|
engine_forkchoiceUpdatedV2: this.notifyForkchoiceUpdate.bind(this),
|
|
137
138
|
engine_forkchoiceUpdatedV3: this.notifyForkchoiceUpdate.bind(this),
|
|
139
|
+
engine_forkchoiceUpdatedV4: this.notifyForkchoiceUpdate.bind(this),
|
|
138
140
|
engine_getPayloadV1: this.getPayloadV1.bind(this),
|
|
139
141
|
engine_getPayloadV2: this.getPayloadV5.bind(this),
|
|
140
142
|
engine_getPayloadV3: this.getPayloadV5.bind(this),
|
|
141
143
|
engine_getPayloadV4: this.getPayloadV5.bind(this),
|
|
142
144
|
engine_getPayloadV5: this.getPayloadV5.bind(this),
|
|
145
|
+
engine_getPayloadV6: this.getPayloadV5.bind(this),
|
|
143
146
|
engine_getPayloadBodiesByHashV1: this.getPayloadBodiesByHash.bind(this),
|
|
144
147
|
engine_getPayloadBodiesByRangeV1: this.getPayloadBodiesByRange.bind(this),
|
|
145
148
|
engine_getClientVersionV1: this.getClientVersionV1.bind(this),
|
|
@@ -379,6 +382,10 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
379
382
|
(executionPayload as ExecutionPayload<ForkPostCapella>).withdrawals = ssz.capella.Withdrawals.defaultValue();
|
|
380
383
|
}
|
|
381
384
|
|
|
385
|
+
if (ForkSeq[fork] >= ForkSeq.gloas && payloadAttributes.slotNumber != null) {
|
|
386
|
+
(executionPayload as gloas.ExecutionPayload).slotNumber = payloadAttributes.slotNumber;
|
|
387
|
+
}
|
|
388
|
+
|
|
382
389
|
this.preparingPayloads.set(payloadId, {
|
|
383
390
|
executionPayload: serializeExecutionPayload(fork, executionPayload),
|
|
384
391
|
blobsBundle: serializeBlobsBundle({
|