@lodestar/beacon-node 1.39.1 → 1.40.0-dev.059f489b0f
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 +23 -27
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +2 -7
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +0 -12
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/config/constants.d.ts +3 -0
- package/lib/api/impl/config/constants.d.ts.map +1 -1
- package/lib/api/impl/config/constants.js +5 -1
- package/lib/api/impl/config/constants.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 +3 -6
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +30 -3
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +1 -2
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +10 -11
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/rest/base.d.ts.map +1 -1
- package/lib/api/rest/base.js +2 -2
- package/lib/api/rest/base.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +7 -3
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +7 -4
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +23 -14
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +30 -0
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +44 -3
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +15 -10
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +0 -14
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +0 -2
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +9 -9
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +2 -2
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts +1 -4
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +28 -28
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts +3 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +5 -3
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/jobItem.d.ts +2 -2
- package/lib/chain/bls/multithread/jobItem.d.ts.map +1 -1
- package/lib/chain/bls/multithread/jobItem.js +2 -2
- package/lib/chain/bls/multithread/jobItem.js.map +1 -1
- package/lib/chain/bls/singleThread.d.ts +4 -2
- package/lib/chain/bls/singleThread.d.ts.map +1 -1
- package/lib/chain/bls/singleThread.js +4 -2
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.d.ts +2 -2
- package/lib/chain/bls/utils.d.ts.map +1 -1
- package/lib/chain/bls/utils.js +9 -6
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +25 -7
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +213 -50
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +14 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +8 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +48 -0
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -0
- package/lib/chain/errors/executionPayloadBid.js +15 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +48 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js +16 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -0
- package/lib/chain/errors/index.d.ts +3 -0
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +3 -0
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/errors/payloadAttestation.d.ts +34 -0
- package/lib/chain/errors/payloadAttestation.d.ts.map +1 -0
- package/lib/chain/errors/payloadAttestation.js +13 -0
- package/lib/chain/errors/payloadAttestation.js.map +1 -0
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +18 -0
- 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 +7 -5
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +23 -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.map +1 -1
- package/lib/chain/lightClient/index.js +1 -2
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/lightClient/proofs.d.ts.map +1 -1
- package/lib/chain/lightClient/proofs.js +0 -2
- package/lib/chain/lightClient/proofs.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +5 -9
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +12 -141
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +21 -0
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -0
- package/lib/chain/opPools/executionPayloadBidPool.js +57 -0
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -0
- package/lib/chain/opPools/index.d.ts +2 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +2 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/opPool.js +5 -8
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts +24 -0
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/payloadAttestationPool.js +109 -0
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -0
- package/lib/chain/options.d.ts +0 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +0 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +9 -10
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +6 -4
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +5 -14
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -1
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/regen/queued.d.ts +6 -10
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +16 -40
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +6 -8
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +20 -34
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/index.d.ts +3 -1
- package/lib/chain/seenCache/index.d.ts.map +1 -1
- package/lib/chain/seenCache/index.js +3 -1
- package/lib/chain/seenCache/index.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts +5 -0
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js +5 -0
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +12 -0
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -0
- package/lib/chain/seenCache/seenExecutionPayloadBids.js +30 -0
- package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts +15 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js +28 -0
- package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +1 -0
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +3 -3
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +16 -11
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +47 -41
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +1 -2
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js +4 -4
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/index.d.ts +0 -2
- package/lib/chain/stateCache/index.d.ts.map +1 -1
- package/lib/chain/stateCache/index.js +0 -2
- package/lib/chain/stateCache/index.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +7 -7
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +20 -17
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +5 -6
- 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 +35 -14
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts +2 -2
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +28 -9
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +2 -2
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.d.ts.map +1 -1
- package/lib/chain/validation/blobSidecar.js +5 -5
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +8 -6
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.d.ts.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +9 -2
- 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 +5 -5
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts +5 -0
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -0
- package/lib/chain/validation/executionPayloadBid.js +104 -0
- package/lib/chain/validation/executionPayloadBid.js.map +1 -0
- package/lib/chain/validation/executionPayloadEnvelope.d.ts +5 -0
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/validation/executionPayloadEnvelope.js +89 -0
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -0
- package/lib/chain/validation/payloadAttestationMessage.d.ts +9 -0
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -0
- package/lib/chain/validation/payloadAttestationMessage.js +72 -0
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -0
- package/lib/chain/validation/proposerSlashing.js +3 -2
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts +2 -3
- package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.js +8 -3
- package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +3 -3
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/selectionProof.d.ts +2 -3
- package/lib/chain/validation/signatureSets/selectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/selectionProof.js +8 -3
- package/lib/chain/validation/signatureSets/selectionProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +3 -3
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +1 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +3 -3
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.js +1 -1
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +3 -5
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +1 -1
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +2 -0
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +49 -7
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/repositories/checkpointState.d.ts +2 -6
- package/lib/db/repositories/checkpointState.d.ts.map +1 -1
- package/lib/db/repositories/checkpointState.js +3 -16
- package/lib/db/repositories/checkpointState.js.map +1 -1
- package/lib/db/repositories/stateArchive.d.ts +9 -9
- package/lib/db/repositories/stateArchive.d.ts.map +1 -1
- package/lib/db/repositories/stateArchive.js +6 -21
- package/lib/db/repositories/stateArchive.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +9 -6
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +34 -7
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +28 -6
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +67 -17
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +3 -0
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +9 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +3 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +3 -0
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +9 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +3 -0
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +34 -0
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +123 -0
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +20 -2
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +3 -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 +38 -2
- package/lib/network/gossip/scoringParameters.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +77 -1
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +20 -0
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/network.d.ts +3 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +9 -0
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts +6 -0
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +9 -0
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +35 -4
- 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 +16 -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 +3 -0
- 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 +2 -4
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts +1 -2
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js +5 -26
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts +1 -2
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +5 -7
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +1 -2
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +1 -5
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/index.js +2 -2
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.js +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +17 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +3 -4
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/backfill/verify.d.ts +1 -2
- package/lib/sync/backfill/verify.d.ts.map +1 -1
- package/lib/sync/backfill/verify.js +2 -2
- package/lib/sync/backfill/verify.js.map +1 -1
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +0 -1
- 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 +0 -3
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +0 -3
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +2 -2
- 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 +1 -2
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/sszBytes.js +1 -1
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +39 -37
- package/src/api/impl/beacon/state/utils.ts +2 -22
- package/src/api/impl/config/constants.ts +8 -0
- package/src/api/impl/debug/index.ts +2 -6
- package/src/api/impl/lodestar/index.ts +36 -4
- package/src/api/impl/proof/index.ts +1 -2
- package/src/api/impl/validator/index.ts +15 -15
- package/src/api/rest/base.ts +4 -4
- package/src/chain/ColumnReconstructionTracker.ts +8 -4
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +7 -4
- package/src/chain/archiveStore/utils/archiveBlocks.ts +25 -14
- package/src/chain/blocks/blockInput/blockInput.ts +55 -4
- package/src/chain/blocks/importBlock.ts +16 -10
- package/src/chain/blocks/index.ts +0 -19
- package/src/chain/blocks/types.ts +0 -2
- package/src/chain/blocks/verifyBlock.ts +9 -12
- package/src/chain/blocks/verifyBlocksSignatures.ts +4 -12
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +2 -2
- package/src/chain/blocks/writeBlockInputToDb.ts +33 -30
- package/src/chain/bls/multithread/index.ts +7 -4
- package/src/chain/bls/multithread/jobItem.ts +7 -3
- package/src/chain/bls/singleThread.ts +5 -3
- package/src/chain/bls/utils.ts +15 -7
- package/src/chain/chain.ts +247 -65
- package/src/chain/errors/attestationError.ts +11 -1
- package/src/chain/errors/executionPayloadBid.ts +35 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +34 -0
- package/src/chain/errors/index.ts +3 -0
- package/src/chain/errors/payloadAttestation.ts +25 -0
- package/src/chain/forkChoice/index.ts +19 -0
- package/src/chain/initState.ts +7 -5
- package/src/chain/interface.ts +34 -3
- package/src/chain/lightClient/index.ts +1 -2
- package/src/chain/lightClient/proofs.ts +0 -2
- package/src/chain/opPools/aggregatedAttestationPool.ts +19 -191
- package/src/chain/opPools/executionPayloadBidPool.ts +77 -0
- package/src/chain/opPools/index.ts +2 -0
- package/src/chain/opPools/opPool.ts +5 -7
- package/src/chain/opPools/payloadAttestationPool.ts +157 -0
- package/src/chain/options.ts +0 -2
- package/src/chain/prepareNextSlot.ts +8 -12
- package/src/chain/produceBlock/produceBlockBody.ts +13 -6
- package/src/chain/regen/interface.ts +4 -18
- package/src/chain/regen/queued.ts +17 -57
- package/src/chain/regen/regen.ts +22 -43
- package/src/chain/seenCache/index.ts +3 -1
- package/src/chain/seenCache/seenAttesters.ts +5 -0
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +35 -0
- package/src/chain/seenCache/seenExecutionPayloadEnvelope.ts +34 -0
- package/src/chain/seenCache/seenGossipBlockInput.ts +3 -3
- package/src/chain/shufflingCache.ts +67 -50
- package/src/chain/stateCache/fifoBlockStateCache.ts +4 -5
- package/src/chain/stateCache/index.ts +0 -2
- package/src/chain/stateCache/persistentCheckpointsCache.ts +23 -27
- package/src/chain/stateCache/types.ts +5 -10
- package/src/chain/validation/aggregateAndProof.ts +36 -14
- package/src/chain/validation/attestation.ts +36 -19
- package/src/chain/validation/attesterSlashing.ts +9 -7
- package/src/chain/validation/blobSidecar.ts +4 -9
- package/src/chain/validation/block.ts +9 -6
- package/src/chain/validation/blsToExecutionChange.ts +9 -7
- package/src/chain/validation/dataColumnSidecar.ts +4 -9
- package/src/chain/validation/executionPayloadBid.ts +141 -0
- package/src/chain/validation/executionPayloadEnvelope.ts +122 -0
- package/src/chain/validation/payloadAttestationMessage.ts +109 -0
- package/src/chain/validation/proposerSlashing.ts +3 -7
- package/src/chain/validation/signatureSets/aggregateAndProof.ts +9 -14
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -4
- package/src/chain/validation/signatureSets/selectionProof.ts +9 -9
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -4
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -3
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -4
- package/src/chain/validation/syncCommittee.ts +1 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +3 -5
- package/src/chain/validation/voluntaryExit.ts +1 -1
- package/src/chain/validatorMonitor.ts +62 -8
- package/src/db/repositories/checkpointState.ts +3 -19
- package/src/db/repositories/stateArchive.ts +13 -27
- package/src/execution/engine/mock.ts +40 -13
- package/src/index.ts +1 -1
- package/src/metrics/metrics/lodestar.ts +68 -17
- package/src/network/core/networkCore.ts +12 -0
- package/src/network/core/networkCoreWorker.ts +3 -0
- package/src/network/core/networkCoreWorkerHandler.ts +9 -0
- package/src/network/core/types.ts +6 -0
- package/src/network/gossip/gossipsub.ts +147 -1
- package/src/network/gossip/interface.ts +17 -0
- package/src/network/gossip/scoringParameters.ts +44 -2
- package/src/network/gossip/topic.ts +21 -0
- package/src/network/network.ts +12 -0
- package/src/network/options.ts +6 -0
- package/src/network/peers/peerManager.ts +11 -0
- package/src/network/processor/gossipHandlers.ts +49 -4
- package/src/network/processor/gossipQueues/index.ts +16 -0
- package/src/network/processor/index.ts +3 -0
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -4
- package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +5 -32
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +5 -9
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +5 -2
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +1 -5
- package/src/network/reqresp/handlers/index.ts +2 -2
- package/src/network/reqresp/utils/dataColumnResponseValidation.ts +1 -1
- package/src/node/nodejs.ts +18 -3
- package/src/sync/backfill/backfill.ts +3 -4
- package/src/sync/backfill/verify.ts +2 -3
- package/src/sync/range/chain.ts +0 -1
- package/src/sync/range/range.ts +0 -3
- package/src/sync/unknownBlock.ts +0 -3
- package/src/sync/utils/downloadByRange.ts +2 -2
- package/src/sync/utils/downloadByRoot.ts +1 -2
- package/src/util/sszBytes.ts +1 -1
- package/lib/chain/stateCache/blockStateCacheImpl.d.ts +0 -55
- package/lib/chain/stateCache/blockStateCacheImpl.d.ts.map +0 -1
- package/lib/chain/stateCache/blockStateCacheImpl.js +0 -130
- package/lib/chain/stateCache/blockStateCacheImpl.js.map +0 -1
- package/lib/chain/stateCache/inMemoryCheckpointsCache.d.ts +0 -61
- package/lib/chain/stateCache/inMemoryCheckpointsCache.d.ts.map +0 -1
- package/lib/chain/stateCache/inMemoryCheckpointsCache.js +0 -157
- package/lib/chain/stateCache/inMemoryCheckpointsCache.js.map +0 -1
- package/lib/util/bytes.d.ts +0 -3
- package/lib/util/bytes.d.ts.map +0 -1
- package/lib/util/bytes.js +0 -11
- package/lib/util/bytes.js.map +0 -1
- package/src/chain/stateCache/blockStateCacheImpl.ts +0 -150
- package/src/chain/stateCache/inMemoryCheckpointsCache.ts +0 -198
- package/src/util/bytes.ts +0 -11
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
isDenebBlockContents,
|
|
31
31
|
sszTypesFor,
|
|
32
32
|
} from "@lodestar/types";
|
|
33
|
-
import {
|
|
33
|
+
import {fromHex, sleep, toHex, toRootHex} from "@lodestar/utils";
|
|
34
34
|
import {BlockInputSource, isBlockInputBlobs, isBlockInputColumns} from "../../../../chain/blocks/blockInput/index.js";
|
|
35
35
|
import {ImportBlockOpts} from "../../../../chain/blocks/types.js";
|
|
36
36
|
import {verifyBlocksInEpoch} from "../../../../chain/blocks/verifyBlock.js";
|
|
@@ -133,21 +133,31 @@ export function getBeaconBlockApi({
|
|
|
133
133
|
|
|
134
134
|
if (isBlockInputColumns(blockForImport)) {
|
|
135
135
|
for (const dataColumnSidecar of dataColumnSidecars) {
|
|
136
|
-
blockForImport.addColumn(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
blockForImport.addColumn(
|
|
137
|
+
{
|
|
138
|
+
blockRootHex: blockRoot,
|
|
139
|
+
columnSidecar: dataColumnSidecar,
|
|
140
|
+
source: BlockInputSource.api,
|
|
141
|
+
seenTimestampSec,
|
|
142
|
+
},
|
|
143
|
+
// In multi-BN setups (DVT, fallback), the same block may be published to multiple nodes.
|
|
144
|
+
// Data columns may arrive via gossip from another node before the API publish completes,
|
|
145
|
+
// so we allow duplicates here instead of throwing an error.
|
|
146
|
+
{throwOnDuplicateAdd: false}
|
|
147
|
+
);
|
|
142
148
|
}
|
|
143
149
|
} else if (isBlockInputBlobs(blockForImport)) {
|
|
144
150
|
for (const blobSidecar of blobSidecars) {
|
|
145
|
-
blockForImport.addBlob(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
blockForImport.addBlob(
|
|
152
|
+
{
|
|
153
|
+
blockRootHex: blockRoot,
|
|
154
|
+
blobSidecar,
|
|
155
|
+
source: BlockInputSource.api,
|
|
156
|
+
seenTimestampSec,
|
|
157
|
+
},
|
|
158
|
+
// Same as above for columns
|
|
159
|
+
{throwOnDuplicateAdd: false}
|
|
160
|
+
);
|
|
151
161
|
}
|
|
152
162
|
}
|
|
153
163
|
|
|
@@ -285,7 +295,7 @@ export function getBeaconBlockApi({
|
|
|
285
295
|
() =>
|
|
286
296
|
// there is no rush to persist block since we published it to gossip anyway
|
|
287
297
|
chain
|
|
288
|
-
.processBlock(blockForImport,
|
|
298
|
+
.processBlock(blockForImport, opts)
|
|
289
299
|
.catch((e) => {
|
|
290
300
|
if (e instanceof BlockError && e.type.code === BlockErrorCode.PARENT_UNKNOWN) {
|
|
291
301
|
chain.emitter.emit(ChainEvent.unknownParent, {
|
|
@@ -434,11 +444,13 @@ export function getBeaconBlockApi({
|
|
|
434
444
|
const nonFinalizedBlocks = chain.forkChoice.getBlockSummariesByParentRoot(parentRoot);
|
|
435
445
|
await Promise.all(
|
|
436
446
|
nonFinalizedBlocks.map(async (summary) => {
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
const canonical = chain.forkChoice.getCanonicalBlockAtSlot(block.message.slot);
|
|
447
|
+
const blockResult = await chain.getBlockByRoot(summary.blockRoot);
|
|
448
|
+
if (blockResult) {
|
|
449
|
+
const canonical = chain.forkChoice.getCanonicalBlockAtSlot(blockResult.block.message.slot);
|
|
440
450
|
if (canonical) {
|
|
441
|
-
result.push(
|
|
451
|
+
result.push(
|
|
452
|
+
toBeaconHeaderResponse(config, blockResult.block, canonical.blockRoot === summary.blockRoot)
|
|
453
|
+
);
|
|
442
454
|
if (isOptimisticBlock(canonical)) {
|
|
443
455
|
executionOptimistic = true;
|
|
444
456
|
}
|
|
@@ -492,9 +504,9 @@ export function getBeaconBlockApi({
|
|
|
492
504
|
finalized = false;
|
|
493
505
|
|
|
494
506
|
if (summary.blockRoot !== toRootHex(canonicalRoot)) {
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
result.push(toBeaconHeaderResponse(config, block));
|
|
507
|
+
const blockResult = await chain.getBlockByRoot(summary.blockRoot);
|
|
508
|
+
if (blockResult) {
|
|
509
|
+
result.push(toBeaconHeaderResponse(config, blockResult.block));
|
|
498
510
|
}
|
|
499
511
|
}
|
|
500
512
|
})
|
|
@@ -626,6 +638,7 @@ export function getBeaconBlockApi({
|
|
|
626
638
|
const {block, executionOptimistic, finalized} = await getBlockResponse(chain, blockId);
|
|
627
639
|
const fork = config.getForkName(block.message.slot);
|
|
628
640
|
const blockRoot = sszTypesFor(fork).BeaconBlock.hashTreeRoot(block.message);
|
|
641
|
+
const blockRootHex = toRootHex(blockRoot);
|
|
629
642
|
|
|
630
643
|
let data: deneb.BlobSidecars;
|
|
631
644
|
|
|
@@ -642,10 +655,7 @@ export function getBeaconBlockApi({
|
|
|
642
655
|
const blobCount = blobKzgCommitments.length;
|
|
643
656
|
|
|
644
657
|
if (blobCount > 0) {
|
|
645
|
-
|
|
646
|
-
if (dataColumnSidecars.length === 0) {
|
|
647
|
-
dataColumnSidecars = await fromAsync(db.dataColumnSidecarArchive.valuesStream(block.message.slot));
|
|
648
|
-
}
|
|
658
|
+
const dataColumnSidecars = await chain.getDataColumnSidecars(block.message.slot, blockRootHex);
|
|
649
659
|
|
|
650
660
|
if (dataColumnSidecars.length === 0) {
|
|
651
661
|
throw new ApiError(
|
|
@@ -682,10 +692,7 @@ export function getBeaconBlockApi({
|
|
|
682
692
|
data = [];
|
|
683
693
|
}
|
|
684
694
|
} else if (isForkPostDeneb(fork)) {
|
|
685
|
-
|
|
686
|
-
if (!blobSidecars) {
|
|
687
|
-
({blobSidecars} = (await db.blobSidecarsArchive.get(block.message.slot)) ?? {});
|
|
688
|
-
}
|
|
695
|
+
const blobSidecars = await chain.getBlobSidecars(block.message.slot, blockRootHex);
|
|
689
696
|
|
|
690
697
|
if (!blobSidecars) {
|
|
691
698
|
throw new ApiError(
|
|
@@ -715,6 +722,7 @@ export function getBeaconBlockApi({
|
|
|
715
722
|
const {block, executionOptimistic, finalized} = await getBlockResponse(chain, blockId);
|
|
716
723
|
const fork = config.getForkName(block.message.slot);
|
|
717
724
|
const blockRoot = sszTypesFor(fork).BeaconBlock.hashTreeRoot(block.message);
|
|
725
|
+
const blockRootHex = toRootHex(blockRoot);
|
|
718
726
|
|
|
719
727
|
let blobs: deneb.Blobs;
|
|
720
728
|
|
|
@@ -731,10 +739,7 @@ export function getBeaconBlockApi({
|
|
|
731
739
|
const blobCount = blobKzgCommitments.length;
|
|
732
740
|
|
|
733
741
|
if (blobCount > 0) {
|
|
734
|
-
|
|
735
|
-
if (dataColumnSidecars.length === 0) {
|
|
736
|
-
dataColumnSidecars = await fromAsync(db.dataColumnSidecarArchive.valuesStream(block.message.slot));
|
|
737
|
-
}
|
|
742
|
+
const dataColumnSidecars = await chain.getDataColumnSidecars(block.message.slot, blockRootHex);
|
|
738
743
|
|
|
739
744
|
if (dataColumnSidecars.length === 0) {
|
|
740
745
|
throw new ApiError(
|
|
@@ -766,10 +771,7 @@ export function getBeaconBlockApi({
|
|
|
766
771
|
blobs = [];
|
|
767
772
|
}
|
|
768
773
|
} else if (isForkPostDeneb(fork)) {
|
|
769
|
-
|
|
770
|
-
if (!blobSidecars) {
|
|
771
|
-
({blobSidecars} = (await db.blobSidecarsArchive.get(block.message.slot)) ?? {});
|
|
772
|
-
}
|
|
774
|
+
const blobSidecars = await chain.getBlobSidecars(block.message.slot, blockRootHex);
|
|
773
775
|
|
|
774
776
|
if (!blobSidecars) {
|
|
775
777
|
throw new ApiError(
|
|
@@ -2,7 +2,7 @@ import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
|
2
2
|
import {routes} from "@lodestar/api";
|
|
3
3
|
import {CheckpointWithHex, IForkChoice} from "@lodestar/fork-choice";
|
|
4
4
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
5
|
-
import {BeaconStateAllForks} from "@lodestar/state-transition";
|
|
5
|
+
import {BeaconStateAllForks, CachedBeaconStateAllForks} from "@lodestar/state-transition";
|
|
6
6
|
import {BLSPubkey, Epoch, RootHex, Slot, ValidatorIndex, getValidatorStatus, phase0} from "@lodestar/types";
|
|
7
7
|
import {fromHex} from "@lodestar/utils";
|
|
8
8
|
import {IBeaconChain} from "../../../../chain/index.js";
|
|
@@ -41,30 +41,10 @@ export function resolveStateId(
|
|
|
41
41
|
return blockSlot;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export async function getStateResponse(
|
|
45
|
-
chain: IBeaconChain,
|
|
46
|
-
inStateId: routes.beacon.StateId
|
|
47
|
-
): Promise<{state: BeaconStateAllForks; executionOptimistic: boolean; finalized: boolean}> {
|
|
48
|
-
const stateId = resolveStateId(chain.forkChoice, inStateId);
|
|
49
|
-
|
|
50
|
-
const res =
|
|
51
|
-
typeof stateId === "string"
|
|
52
|
-
? await chain.getStateByStateRoot(stateId)
|
|
53
|
-
: typeof stateId === "number"
|
|
54
|
-
? await chain.getStateBySlot(stateId)
|
|
55
|
-
: chain.getStateByCheckpoint(stateId);
|
|
56
|
-
|
|
57
|
-
if (!res) {
|
|
58
|
-
throw new ApiError(404, `State not found for id '${inStateId}'`);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return res;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
44
|
export async function getStateResponseWithRegen(
|
|
65
45
|
chain: IBeaconChain,
|
|
66
46
|
inStateId: routes.beacon.StateId
|
|
67
|
-
): Promise<{state:
|
|
47
|
+
): Promise<{state: CachedBeaconStateAllForks | Uint8Array; executionOptimistic: boolean; finalized: boolean}> {
|
|
68
48
|
const stateId = resolveStateId(chain.forkChoice, inStateId);
|
|
69
49
|
|
|
70
50
|
const res =
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
BASE_REWARDS_PER_EPOCH,
|
|
6
6
|
BLOB_TX_TYPE,
|
|
7
7
|
BLS_WITHDRAWAL_PREFIX,
|
|
8
|
+
BUILDER_INDEX_FLAG,
|
|
9
|
+
BUILDER_INDEX_SELF_BUILD,
|
|
8
10
|
BUILDER_PAYMENT_THRESHOLD_DENOMINATOR,
|
|
9
11
|
BUILDER_PAYMENT_THRESHOLD_NUMERATOR,
|
|
10
12
|
BUILDER_WITHDRAWAL_PREFIX,
|
|
@@ -21,6 +23,7 @@ import {
|
|
|
21
23
|
DOMAIN_BLS_TO_EXECUTION_CHANGE,
|
|
22
24
|
DOMAIN_CONTRIBUTION_AND_PROOF,
|
|
23
25
|
DOMAIN_DEPOSIT,
|
|
26
|
+
DOMAIN_PROPOSER_PREFERENCES,
|
|
24
27
|
DOMAIN_PTC_ATTESTER,
|
|
25
28
|
DOMAIN_RANDAO,
|
|
26
29
|
DOMAIN_SELECTION_PROOF,
|
|
@@ -82,6 +85,7 @@ export const specConstants = {
|
|
|
82
85
|
DOMAIN_APPLICATION_MASK,
|
|
83
86
|
DOMAIN_APPLICATION_BUILDER,
|
|
84
87
|
DOMAIN_BEACON_BUILDER,
|
|
88
|
+
DOMAIN_PROPOSER_PREFERENCES,
|
|
85
89
|
DOMAIN_PTC_ATTESTER,
|
|
86
90
|
|
|
87
91
|
// phase0/validator.md
|
|
@@ -128,6 +132,10 @@ export const specConstants = {
|
|
|
128
132
|
DEPOSIT_REQUEST_TYPE: toHexByte(DEPOSIT_REQUEST_TYPE),
|
|
129
133
|
WITHDRAWAL_REQUEST_TYPE: toHexByte(WITHDRAWAL_REQUEST_TYPE),
|
|
130
134
|
CONSOLIDATION_REQUEST_TYPE: toHexByte(CONSOLIDATION_REQUEST_TYPE),
|
|
135
|
+
|
|
136
|
+
// gloas
|
|
137
|
+
BUILDER_INDEX_FLAG,
|
|
138
|
+
BUILDER_INDEX_SELF_BUILD,
|
|
131
139
|
BUILDER_PAYMENT_THRESHOLD_NUMERATOR,
|
|
132
140
|
BUILDER_PAYMENT_THRESHOLD_DENOMINATOR,
|
|
133
141
|
};
|
|
@@ -3,7 +3,7 @@ import {ApplicationMethods} from "@lodestar/api/server";
|
|
|
3
3
|
import {ExecutionStatus} from "@lodestar/fork-choice";
|
|
4
4
|
import {ZERO_HASH_HEX, isForkPostDeneb, isForkPostFulu} from "@lodestar/params";
|
|
5
5
|
import {BeaconState, deneb, fulu, sszTypesFor} from "@lodestar/types";
|
|
6
|
-
import {
|
|
6
|
+
import {toRootHex} from "@lodestar/utils";
|
|
7
7
|
import {isOptimisticBlock} from "../../../util/forkChoice.js";
|
|
8
8
|
import {getStateSlotFromBytes} from "../../../util/multifork.js";
|
|
9
9
|
import {getBlockResponse} from "../beacon/blocks/utils.js";
|
|
@@ -14,7 +14,6 @@ import {assertUniqueItems} from "../utils.js";
|
|
|
14
14
|
export function getDebugApi({
|
|
15
15
|
chain,
|
|
16
16
|
config,
|
|
17
|
-
db,
|
|
18
17
|
}: Pick<ApiModules, "chain" | "config" | "db">): ApplicationMethods<routes.debug.Endpoints> {
|
|
19
18
|
return {
|
|
20
19
|
async getDebugChainHeadsV2() {
|
|
@@ -104,10 +103,7 @@ export function getDebugApi({
|
|
|
104
103
|
: 0;
|
|
105
104
|
|
|
106
105
|
if (isForkPostFulu(fork) && blobCount > 0) {
|
|
107
|
-
dataColumnSidecars = await
|
|
108
|
-
if (dataColumnSidecars.length === 0) {
|
|
109
|
-
dataColumnSidecars = await fromAsync(db.dataColumnSidecarArchive.valuesStream(block.message.slot));
|
|
110
|
-
}
|
|
106
|
+
dataColumnSidecars = await chain.getDataColumnSidecars(block.message.slot, toRootHex(blockRoot));
|
|
111
107
|
|
|
112
108
|
if (dataColumnSidecars.length === 0) {
|
|
113
109
|
throw Error(
|
|
@@ -154,6 +154,23 @@ export function getLodestarApi({
|
|
|
154
154
|
await network.disconnectPeer(peerId);
|
|
155
155
|
},
|
|
156
156
|
|
|
157
|
+
async addDirectPeer({peer}) {
|
|
158
|
+
const peerId = await network.addDirectPeer(peer);
|
|
159
|
+
if (peerId === null) {
|
|
160
|
+
throw new ApiError(400, `Failed to add direct peer: invalid peer address or ENR "${peer}"`);
|
|
161
|
+
}
|
|
162
|
+
return {data: {peerId}};
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
async removeDirectPeer({peerId}) {
|
|
166
|
+
const removed = await network.removeDirectPeer(peerId);
|
|
167
|
+
return {data: {removed}};
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
async getDirectPeers() {
|
|
171
|
+
return {data: await network.getDirectPeers()};
|
|
172
|
+
},
|
|
173
|
+
|
|
157
174
|
async getPeers({state, direction}) {
|
|
158
175
|
const peers = (await network.dumpPeers()).filter(
|
|
159
176
|
(nodePeer) =>
|
|
@@ -198,7 +215,7 @@ export function getLodestarApi({
|
|
|
198
215
|
const {state, executionOptimistic, finalized} = await getStateResponseWithRegen(chain, stateId);
|
|
199
216
|
|
|
200
217
|
const stateView = (
|
|
201
|
-
state instanceof Uint8Array ? loadState(config, chain.getHeadState(), state).state : state
|
|
218
|
+
state instanceof Uint8Array ? loadState(config, chain.getHeadState(), state).state : state
|
|
202
219
|
) as BeaconStateCapella;
|
|
203
220
|
|
|
204
221
|
const fork = config.getForkName(stateView.slot);
|
|
@@ -238,6 +255,24 @@ export function getLodestarApi({
|
|
|
238
255
|
},
|
|
239
256
|
};
|
|
240
257
|
},
|
|
258
|
+
|
|
259
|
+
async getMonitoredValidatorIndices() {
|
|
260
|
+
return {
|
|
261
|
+
data: chain.validatorMonitor?.getMonitoredValidatorIndices() ?? [],
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
async getCustodyInfo() {
|
|
266
|
+
const {custodyColumns, targetCustodyGroupCount} = chain.custodyConfig;
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
data: {
|
|
270
|
+
earliestCustodiedSlot: chain.earliestAvailableSlot,
|
|
271
|
+
custodyGroupCount: targetCustodyGroupCount,
|
|
272
|
+
custodyColumns,
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
},
|
|
241
276
|
};
|
|
242
277
|
}
|
|
243
278
|
|
|
@@ -249,9 +284,6 @@ function regenRequestToJson(config: ChainForkConfig, regenRequest: RegenRequest)
|
|
|
249
284
|
slot: regenRequest.args[1],
|
|
250
285
|
};
|
|
251
286
|
|
|
252
|
-
case "getCheckpointState":
|
|
253
|
-
return ssz.phase0.Checkpoint.toJson(regenRequest.args[0]);
|
|
254
|
-
|
|
255
287
|
case "getPreState": {
|
|
256
288
|
const slot = regenRequest.args[0].slot;
|
|
257
289
|
return {
|
|
@@ -27,8 +27,7 @@ export function getProofApi(
|
|
|
27
27
|
const state =
|
|
28
28
|
res.state instanceof Uint8Array ? loadState(config, chain.getHeadState(), res.state).state : res.state;
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
state.commit();
|
|
30
|
+
// there should be no state changes in beacon-node so no need to commit() here
|
|
32
31
|
const stateNode = state.node;
|
|
33
32
|
|
|
34
33
|
const proof = createProof(stateNode, {type: ProofType.compactMulti, descriptor});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
2
2
|
import {routes} from "@lodestar/api";
|
|
3
3
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
4
|
-
import {ExecutionStatus} from "@lodestar/fork-choice";
|
|
4
|
+
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
5
5
|
import {
|
|
6
6
|
ForkName,
|
|
7
7
|
ForkPostBellatrix,
|
|
@@ -67,10 +67,11 @@ import {
|
|
|
67
67
|
SyncCommitteeError,
|
|
68
68
|
SyncCommitteeErrorCode,
|
|
69
69
|
} from "../../../chain/errors/index.js";
|
|
70
|
-
import {ChainEvent,
|
|
70
|
+
import {ChainEvent, CommonBlockBody} from "../../../chain/index.js";
|
|
71
71
|
import {PREPARE_NEXT_SLOT_BPS} from "../../../chain/prepareNextSlot.js";
|
|
72
72
|
import {BlockType, ProduceFullDeneb} from "../../../chain/produceBlock/index.js";
|
|
73
73
|
import {RegenCaller} from "../../../chain/regen/index.js";
|
|
74
|
+
import {CheckpointHex} from "../../../chain/stateCache/types.js";
|
|
74
75
|
import {validateApiAggregateAndProof} from "../../../chain/validation/index.js";
|
|
75
76
|
import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js";
|
|
76
77
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
@@ -413,10 +414,10 @@ export function getValidatorApi(
|
|
|
413
414
|
// as of now fee recipient checks can not be performed because builder does not return bid recipient
|
|
414
415
|
{
|
|
415
416
|
commonBlockBodyPromise,
|
|
416
|
-
|
|
417
|
+
parentBlock,
|
|
417
418
|
}: Omit<routes.validator.ExtraProduceBlockOpts, "builderSelection"> & {
|
|
418
419
|
commonBlockBodyPromise: Promise<CommonBlockBody>;
|
|
419
|
-
|
|
420
|
+
parentBlock: ProtoBlock;
|
|
420
421
|
}
|
|
421
422
|
): Promise<ProduceBlindedBlockRes> {
|
|
422
423
|
const version = config.getForkName(slot);
|
|
@@ -447,7 +448,7 @@ export function getValidatorApi(
|
|
|
447
448
|
timer = metrics?.blockProductionTime.startTimer();
|
|
448
449
|
const {block, executionPayloadValue, consensusBlockValue} = await chain.produceBlindedBlock({
|
|
449
450
|
slot,
|
|
450
|
-
|
|
451
|
+
parentBlock,
|
|
451
452
|
randaoReveal,
|
|
452
453
|
graffiti,
|
|
453
454
|
commonBlockBodyPromise,
|
|
@@ -482,10 +483,10 @@ export function getValidatorApi(
|
|
|
482
483
|
feeRecipient,
|
|
483
484
|
strictFeeRecipientCheck,
|
|
484
485
|
commonBlockBodyPromise,
|
|
485
|
-
|
|
486
|
+
parentBlock,
|
|
486
487
|
}: Omit<routes.validator.ExtraProduceBlockOpts, "builderSelection"> & {
|
|
487
488
|
commonBlockBodyPromise: Promise<CommonBlockBody>;
|
|
488
|
-
|
|
489
|
+
parentBlock: ProtoBlock;
|
|
489
490
|
}
|
|
490
491
|
): Promise<ProduceBlockContentsRes & {shouldOverrideBuilder?: boolean}> {
|
|
491
492
|
const source = ProducedBlockSource.engine;
|
|
@@ -496,7 +497,7 @@ export function getValidatorApi(
|
|
|
496
497
|
timer = metrics?.blockProductionTime.startTimer();
|
|
497
498
|
const {block, executionPayloadValue, consensusBlockValue, shouldOverrideBuilder} = await chain.produceBlock({
|
|
498
499
|
slot,
|
|
499
|
-
|
|
500
|
+
parentBlock,
|
|
500
501
|
randaoReveal,
|
|
501
502
|
graffiti,
|
|
502
503
|
feeRecipient,
|
|
@@ -569,7 +570,8 @@ export function getValidatorApi(
|
|
|
569
570
|
notWhileSyncing();
|
|
570
571
|
await waitForSlot(slot); // Must never request for a future slot > currentSlot
|
|
571
572
|
|
|
572
|
-
const
|
|
573
|
+
const parentBlock = chain.getProposerHead(slot);
|
|
574
|
+
const {blockRoot: parentBlockRootHex, slot: parentSlot} = parentBlock;
|
|
573
575
|
const parentBlockRoot = fromHex(parentBlockRootHex);
|
|
574
576
|
notOnOutOfRangeData(parentBlockRoot);
|
|
575
577
|
metrics?.blockProductionSlotDelta.set(slot - parentSlot);
|
|
@@ -638,7 +640,7 @@ export function getValidatorApi(
|
|
|
638
640
|
// can't do fee recipient checks as builder bid doesn't return feeRecipient as of now
|
|
639
641
|
strictFeeRecipientCheck: false,
|
|
640
642
|
commonBlockBodyPromise,
|
|
641
|
-
|
|
643
|
+
parentBlock,
|
|
642
644
|
})
|
|
643
645
|
: Promise.reject(new Error("Builder disabled"));
|
|
644
646
|
|
|
@@ -647,7 +649,7 @@ export function getValidatorApi(
|
|
|
647
649
|
feeRecipient,
|
|
648
650
|
strictFeeRecipientCheck,
|
|
649
651
|
commonBlockBodyPromise,
|
|
650
|
-
|
|
652
|
+
parentBlock,
|
|
651
653
|
}).then((engineBlock) => {
|
|
652
654
|
// Once the engine returns a block, in the event of either:
|
|
653
655
|
// - suspected builder censorship
|
|
@@ -689,7 +691,7 @@ export function getValidatorApi(
|
|
|
689
691
|
chain
|
|
690
692
|
.produceCommonBlockBody({
|
|
691
693
|
slot,
|
|
692
|
-
|
|
694
|
+
parentBlock,
|
|
693
695
|
randaoReveal,
|
|
694
696
|
graffiti: graffitiBytes,
|
|
695
697
|
})
|
|
@@ -1040,9 +1042,7 @@ export function getValidatorApi(
|
|
|
1040
1042
|
const res = await getStateResponseWithRegen(chain, startSlot);
|
|
1041
1043
|
|
|
1042
1044
|
const stateViewDU =
|
|
1043
|
-
res.state instanceof Uint8Array
|
|
1044
|
-
? loadState(config, chain.getHeadState(), res.state).state
|
|
1045
|
-
: res.state.clone();
|
|
1045
|
+
res.state instanceof Uint8Array ? loadState(config, chain.getHeadState(), res.state).state : res.state;
|
|
1046
1046
|
|
|
1047
1047
|
state = createCachedBeaconState(
|
|
1048
1048
|
stateViewDU,
|
package/src/api/rest/base.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import bearerAuthPlugin from "@fastify/bearer-auth";
|
|
2
2
|
import {fastifyCors} from "@fastify/cors";
|
|
3
|
-
import {FastifyInstance, FastifyRequest, errorCodes, fastify} from "fastify";
|
|
3
|
+
import {FastifyError, FastifyInstance, FastifyRequest, errorCodes, fastify} from "fastify";
|
|
4
4
|
import {parse as parseQueryString} from "qs";
|
|
5
5
|
import {addSszContentTypeParser} from "@lodestar/api/server";
|
|
6
6
|
import {ErrorAborted, Gauge, Histogram, Logger} from "@lodestar/utils";
|
|
@@ -91,10 +91,10 @@ export class RestApiServer {
|
|
|
91
91
|
this.activeSockets = new HttpActiveSocketsTracker(server.server, metrics);
|
|
92
92
|
|
|
93
93
|
// To parse our ApiError -> statusCode
|
|
94
|
-
server.setErrorHandler((err, _req, res) => {
|
|
94
|
+
server.setErrorHandler<FastifyError | Error>((err, _req, res) => {
|
|
95
95
|
const stacktraces = opts.stacktraces ? err.stack?.split("\n") : undefined;
|
|
96
|
-
if (err.validation) {
|
|
97
|
-
const {instancePath, message} = err.validation[0];
|
|
96
|
+
if ("validation" in err && err.validation) {
|
|
97
|
+
const {instancePath = "unknown", message} = err.validation?.[0] ?? {};
|
|
98
98
|
const payload: ErrorResponse = {
|
|
99
99
|
code: 400,
|
|
100
100
|
message: `${instancePath.substring(instancePath.lastIndexOf("/") + 1)} ${message}`,
|
|
@@ -8,12 +8,12 @@ import {ChainEventEmitter} from "./emitter.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* Minimum time to wait before attempting reconstruction
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const RECONSTRUCTION_DELAY_MIN_BPS = 667;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Maximum time to wait before attempting reconstruction
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const RECONSTRUCTION_DELAY_MAX_BPS = 1000;
|
|
17
17
|
|
|
18
18
|
export type ColumnReconstructionTrackerInit = {
|
|
19
19
|
logger: Logger;
|
|
@@ -41,11 +41,16 @@ export class ColumnReconstructionTracker {
|
|
|
41
41
|
/** Track if a reconstruction attempt is in-flight */
|
|
42
42
|
running = false;
|
|
43
43
|
|
|
44
|
+
private readonly minDelayMs: number;
|
|
45
|
+
private readonly maxDelayMs: number;
|
|
46
|
+
|
|
44
47
|
constructor(init: ColumnReconstructionTrackerInit) {
|
|
45
48
|
this.logger = init.logger;
|
|
46
49
|
this.emitter = init.emitter;
|
|
47
50
|
this.metrics = init.metrics;
|
|
48
51
|
this.config = init.config;
|
|
52
|
+
this.minDelayMs = this.config.getSlotComponentDurationMs(RECONSTRUCTION_DELAY_MIN_BPS);
|
|
53
|
+
this.maxDelayMs = this.config.getSlotComponentDurationMs(RECONSTRUCTION_DELAY_MAX_BPS);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
triggerColumnReconstruction(blockInput: BlockInputColumns): void {
|
|
@@ -61,8 +66,7 @@ export class ColumnReconstructionTracker {
|
|
|
61
66
|
// just that it has been triggered for this block root.
|
|
62
67
|
this.running = true;
|
|
63
68
|
this.lastBlockRootHex = blockInput.blockRootHex;
|
|
64
|
-
const delay =
|
|
65
|
-
RECONSTRUCTION_DELAY_MIN_MS + Math.random() * (RECONSTRUCTION_DELAY_MAX_MS - RECONSTRUCTION_DELAY_MIN_MS);
|
|
69
|
+
const delay = this.minDelayMs + Math.random() * (this.maxDelayMs - this.minDelayMs);
|
|
66
70
|
sleep(delay)
|
|
67
71
|
.then(() => {
|
|
68
72
|
const logCtx = {slot: blockInput.slot, root: blockInput.blockRootHex};
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
createCachedBeaconState,
|
|
9
9
|
stateTransition,
|
|
10
10
|
} from "@lodestar/state-transition";
|
|
11
|
+
import {byteArrayEquals} from "@lodestar/utils";
|
|
11
12
|
import {IBeaconDb} from "../../../db/index.js";
|
|
13
|
+
import {getStateTypeFromBytes} from "../../../util/multifork.js";
|
|
12
14
|
import {HistoricalStateRegenMetrics} from "./metrics.js";
|
|
13
15
|
import {RegenErrorType} from "./types.js";
|
|
14
16
|
|
|
@@ -35,12 +37,13 @@ export async function getNearestState(
|
|
|
35
37
|
db: IBeaconDb,
|
|
36
38
|
pubkey2index: PubkeyIndexMap
|
|
37
39
|
): Promise<CachedBeaconStateAllForks> {
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
+
const stateBytesArr = await db.stateArchive.binaries({limit: 1, lte: slot, reverse: true});
|
|
41
|
+
if (!stateBytesArr.length) {
|
|
40
42
|
throw new Error("No near state found in the database");
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
const
|
|
45
|
+
const stateBytes = stateBytesArr[0];
|
|
46
|
+
const state = getStateTypeFromBytes(config, stateBytes).deserializeToViewDU(stateBytes);
|
|
44
47
|
syncPubkeyCache(state, pubkey2index);
|
|
45
48
|
|
|
46
49
|
return createCachedBeaconState(
|
|
@@ -96,7 +99,7 @@ export async function getHistoricalState(
|
|
|
96
99
|
throw e;
|
|
97
100
|
}
|
|
98
101
|
blockCount++;
|
|
99
|
-
if (
|
|
102
|
+
if (!byteArrayEquals(state.hashTreeRoot(), block.message.stateRoot)) {
|
|
100
103
|
metrics?.regenErrorCount.inc({reason: RegenErrorType.invalidStateRoot});
|
|
101
104
|
}
|
|
102
105
|
}
|