@lodestar/beacon-node 1.40.0-dev.c975f70481 → 1.40.0-dev.f016f9d123
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 +8 -18
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +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 +15 -2
- 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 +9 -8
- package/lib/api/impl/validator/index.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/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +4 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +2 -0
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +6 -0
- 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 +2 -6
- 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 +1 -8
- 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/writeBlockInputToDb.d.ts +1 -4
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +20 -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 +21 -4
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +180 -15
- 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/interface.d.ts +21 -3
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.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/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/prepareNextSlot.js +6 -4
- 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 +5 -3
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +3 -8
- 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 +1 -2
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +2 -16
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +3 -7
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +3 -16
- 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/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 +27 -8
- 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 +1 -1
- 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 +3 -3
- 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 +5 -4
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +3 -3
- 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 +1 -1
- 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.js +0 -1
- package/lib/db/repositories/checkpointState.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +27 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +64 -0
- package/lib/metrics/metrics/lodestar.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/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +34 -3
- 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/sync/backfill/backfill.js +2 -2
- 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/package.json +15 -15
- package/src/api/impl/beacon/blocks/index.ts +8 -18
- package/src/api/impl/debug/index.ts +2 -6
- package/src/api/impl/lodestar/index.ts +18 -3
- package/src/api/impl/validator/index.ts +12 -11
- package/src/chain/ColumnReconstructionTracker.ts +8 -4
- package/src/chain/archiveStore/utils/archiveBlocks.ts +4 -0
- package/src/chain/blocks/blockInput/blockInput.ts +8 -0
- package/src/chain/blocks/importBlock.ts +2 -6
- package/src/chain/blocks/index.ts +0 -19
- package/src/chain/blocks/types.ts +0 -2
- package/src/chain/blocks/verifyBlock.ts +0 -9
- package/src/chain/blocks/verifyBlocksSignatures.ts +4 -12
- package/src/chain/blocks/writeBlockInputToDb.ts +24 -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 +205 -23
- 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/interface.ts +32 -1
- package/src/chain/opPools/executionPayloadBidPool.ts +77 -0
- package/src/chain/opPools/index.ts +2 -0
- package/src/chain/opPools/payloadAttestationPool.ts +157 -0
- package/src/chain/prepareNextSlot.ts +6 -6
- package/src/chain/produceBlock/produceBlockBody.ts +7 -5
- package/src/chain/regen/interface.ts +2 -12
- package/src/chain/regen/queued.ts +3 -23
- package/src/chain/regen/regen.ts +4 -24
- 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/validation/aggregateAndProof.ts +36 -14
- package/src/chain/validation/attestation.ts +33 -16
- package/src/chain/validation/attesterSlashing.ts +1 -6
- package/src/chain/validation/blobSidecar.ts +2 -7
- package/src/chain/validation/block.ts +5 -4
- package/src/chain/validation/dataColumnSidecar.ts +2 -7
- 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 +1 -6
- 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 +1 -1
- package/src/metrics/metrics/lodestar.ts +65 -0
- 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/processor/gossipHandlers.ts +48 -3
- 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/sync/backfill/backfill.ts +2 -2
- 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
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
defaultTopicScoreParams,
|
|
6
6
|
} from "@chainsafe/libp2p-gossipsub/score";
|
|
7
7
|
import {BeaconConfig} from "@lodestar/config";
|
|
8
|
-
import {ATTESTATION_SUBNET_COUNT, SLOTS_PER_EPOCH, TARGET_AGGREGATORS_PER_COMMITTEE} from "@lodestar/params";
|
|
8
|
+
import {ATTESTATION_SUBNET_COUNT, PTC_SIZE, SLOTS_PER_EPOCH, TARGET_AGGREGATORS_PER_COMMITTEE} from "@lodestar/params";
|
|
9
9
|
import {computeCommitteeCount} from "@lodestar/state-transition";
|
|
10
10
|
import {getActiveForkBoundaries} from "../forks.js";
|
|
11
11
|
import {Eth2Context} from "./gossipsub.js";
|
|
@@ -24,6 +24,9 @@ const VOLUNTARY_EXIT_WEIGHT = 0.05;
|
|
|
24
24
|
const PROPOSER_SLASHING_WEIGHT = 0.05;
|
|
25
25
|
const ATTESTER_SLASHING_WEIGHT = 0.05;
|
|
26
26
|
const BLS_TO_EXECUTION_CHANGE_WEIGHT = 0.05;
|
|
27
|
+
const EXECUTION_PAYLOAD_WEIGHT = 0.5;
|
|
28
|
+
const PAYLOAD_ATTESTATION_WEIGHT = 0.05;
|
|
29
|
+
const EXECUTION_PAYLOAD_BID_WEIGHT = 0.05;
|
|
27
30
|
|
|
28
31
|
const beaconAttestationSubnetWeight = 1 / ATTESTATION_SUBNET_COUNT;
|
|
29
32
|
const maxPositiveScore =
|
|
@@ -34,7 +37,10 @@ const maxPositiveScore =
|
|
|
34
37
|
VOLUNTARY_EXIT_WEIGHT +
|
|
35
38
|
PROPOSER_SLASHING_WEIGHT +
|
|
36
39
|
ATTESTER_SLASHING_WEIGHT +
|
|
37
|
-
BLS_TO_EXECUTION_CHANGE_WEIGHT
|
|
40
|
+
BLS_TO_EXECUTION_CHANGE_WEIGHT +
|
|
41
|
+
EXECUTION_PAYLOAD_WEIGHT +
|
|
42
|
+
PAYLOAD_ATTESTATION_WEIGHT +
|
|
43
|
+
EXECUTION_PAYLOAD_BID_WEIGHT);
|
|
38
44
|
|
|
39
45
|
/**
|
|
40
46
|
* The following params is implemented by Lighthouse at
|
|
@@ -172,6 +178,26 @@ function getAllTopicsScoreParams(
|
|
|
172
178
|
expectedMessageRate: 1 / 5 / SLOTS_PER_EPOCH,
|
|
173
179
|
firstMessageDecayTime: epochDurationMs * 100,
|
|
174
180
|
});
|
|
181
|
+
topicsParams[
|
|
182
|
+
stringifyGossipTopic(config, {
|
|
183
|
+
type: GossipType.payload_attestation_message,
|
|
184
|
+
boundary,
|
|
185
|
+
})
|
|
186
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
187
|
+
topicWeight: PAYLOAD_ATTESTATION_WEIGHT,
|
|
188
|
+
expectedMessageRate: PTC_SIZE,
|
|
189
|
+
firstMessageDecayTime: epochDurationMs * 100,
|
|
190
|
+
});
|
|
191
|
+
topicsParams[
|
|
192
|
+
stringifyGossipTopic(config, {
|
|
193
|
+
type: GossipType.execution_payload_bid,
|
|
194
|
+
boundary,
|
|
195
|
+
})
|
|
196
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
197
|
+
topicWeight: EXECUTION_PAYLOAD_BID_WEIGHT,
|
|
198
|
+
expectedMessageRate: 1024, // TODO GLOAS: Need an estimate for this
|
|
199
|
+
firstMessageDecayTime: epochDurationMs * 100,
|
|
200
|
+
});
|
|
175
201
|
|
|
176
202
|
// other topics
|
|
177
203
|
topicsParams[
|
|
@@ -190,6 +216,22 @@ function getAllTopicsScoreParams(
|
|
|
190
216
|
currentSlot: eth2Context.currentSlot,
|
|
191
217
|
},
|
|
192
218
|
});
|
|
219
|
+
topicsParams[
|
|
220
|
+
stringifyGossipTopic(config, {
|
|
221
|
+
type: GossipType.execution_payload,
|
|
222
|
+
boundary,
|
|
223
|
+
})
|
|
224
|
+
] = getTopicScoreParams(config, precomputedParams, {
|
|
225
|
+
topicWeight: EXECUTION_PAYLOAD_WEIGHT,
|
|
226
|
+
expectedMessageRate: 1,
|
|
227
|
+
firstMessageDecayTime: epochDurationMs * 20,
|
|
228
|
+
meshMessageInfo: {
|
|
229
|
+
decaySlots: SLOTS_PER_EPOCH * 5,
|
|
230
|
+
capFactor: 3,
|
|
231
|
+
activationWindow: epochDurationMs,
|
|
232
|
+
currentSlot: eth2Context.currentSlot,
|
|
233
|
+
},
|
|
234
|
+
});
|
|
193
235
|
|
|
194
236
|
const activeValidatorCount = eth2Context.activeValidatorCount;
|
|
195
237
|
const {aggregatorsPerslot, committeesPerSlot} = expectedAggregatorCountPerSlot(activeValidatorCount);
|
|
@@ -69,6 +69,9 @@ function stringifyGossipTopicType(topic: GossipTopic): string {
|
|
|
69
69
|
case GossipType.light_client_finality_update:
|
|
70
70
|
case GossipType.light_client_optimistic_update:
|
|
71
71
|
case GossipType.bls_to_execution_change:
|
|
72
|
+
case GossipType.execution_payload:
|
|
73
|
+
case GossipType.payload_attestation_message:
|
|
74
|
+
case GossipType.execution_payload_bid:
|
|
72
75
|
return topic.type;
|
|
73
76
|
case GossipType.beacon_attestation:
|
|
74
77
|
case GossipType.sync_committee:
|
|
@@ -114,6 +117,12 @@ export function getGossipSSZType(topic: GossipTopic) {
|
|
|
114
117
|
: ssz.altair.LightClientFinalityUpdate;
|
|
115
118
|
case GossipType.bls_to_execution_change:
|
|
116
119
|
return ssz.capella.SignedBLSToExecutionChange;
|
|
120
|
+
case GossipType.execution_payload:
|
|
121
|
+
return ssz.gloas.SignedExecutionPayloadEnvelope;
|
|
122
|
+
case GossipType.payload_attestation_message:
|
|
123
|
+
return ssz.gloas.PayloadAttestationMessage;
|
|
124
|
+
case GossipType.execution_payload_bid:
|
|
125
|
+
return ssz.gloas.SignedExecutionPayloadBid;
|
|
117
126
|
}
|
|
118
127
|
}
|
|
119
128
|
|
|
@@ -190,6 +199,9 @@ export function parseGossipTopic(forkDigestContext: ForkDigestContext, topicStr:
|
|
|
190
199
|
case GossipType.light_client_finality_update:
|
|
191
200
|
case GossipType.light_client_optimistic_update:
|
|
192
201
|
case GossipType.bls_to_execution_change:
|
|
202
|
+
case GossipType.execution_payload:
|
|
203
|
+
case GossipType.payload_attestation_message:
|
|
204
|
+
case GossipType.execution_payload_bid:
|
|
193
205
|
return {type: gossipTypeStr, boundary, encoding};
|
|
194
206
|
}
|
|
195
207
|
|
|
@@ -240,6 +252,12 @@ export function getCoreTopicsAtFork(
|
|
|
240
252
|
{type: GossipType.attester_slashing},
|
|
241
253
|
];
|
|
242
254
|
|
|
255
|
+
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
256
|
+
topics.push({type: GossipType.execution_payload});
|
|
257
|
+
topics.push({type: GossipType.payload_attestation_message});
|
|
258
|
+
topics.push({type: GossipType.execution_payload_bid});
|
|
259
|
+
}
|
|
260
|
+
|
|
243
261
|
// After fulu also track data_column_sidecar_{index}
|
|
244
262
|
if (ForkSeq[fork] >= ForkSeq.fulu) {
|
|
245
263
|
topics.push(...getDataColumnSidecarTopics(networkConfig));
|
|
@@ -329,4 +347,7 @@ export const gossipTopicIgnoreDuplicatePublishError: Record<GossipType, boolean>
|
|
|
329
347
|
[GossipType.light_client_finality_update]: false,
|
|
330
348
|
[GossipType.light_client_optimistic_update]: false,
|
|
331
349
|
[GossipType.bls_to_execution_change]: true,
|
|
350
|
+
[GossipType.execution_payload]: true,
|
|
351
|
+
[GossipType.payload_attestation_message]: true,
|
|
352
|
+
[GossipType.execution_payload_bid]: true,
|
|
332
353
|
};
|
|
@@ -48,6 +48,8 @@ import {
|
|
|
48
48
|
import {IBeaconChain} from "../../chain/interface.js";
|
|
49
49
|
import {validateGossipBlobSidecar} from "../../chain/validation/blobSidecar.js";
|
|
50
50
|
import {validateGossipDataColumnSidecar} from "../../chain/validation/dataColumnSidecar.js";
|
|
51
|
+
import {validateGossipExecutionPayloadBid} from "../../chain/validation/executionPayloadBid.js";
|
|
52
|
+
import {validateGossipExecutionPayloadEnvelope} from "../../chain/validation/executionPayloadEnvelope.js";
|
|
51
53
|
import {
|
|
52
54
|
AggregateAndProofValidationResult,
|
|
53
55
|
GossipAttestation,
|
|
@@ -64,6 +66,7 @@ import {
|
|
|
64
66
|
} from "../../chain/validation/index.js";
|
|
65
67
|
import {validateLightClientFinalityUpdate} from "../../chain/validation/lightClientFinalityUpdate.js";
|
|
66
68
|
import {validateLightClientOptimisticUpdate} from "../../chain/validation/lightClientOptimisticUpdate.js";
|
|
69
|
+
import {validateGossipPayloadAttestationMessage} from "../../chain/validation/payloadAttestationMessage.js";
|
|
67
70
|
import {OpSource} from "../../chain/validatorMonitor.js";
|
|
68
71
|
import {Metrics} from "../../metrics/index.js";
|
|
69
72
|
import {kzgCommitmentToVersionedHash} from "../../util/blobs.js";
|
|
@@ -436,14 +439,11 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
436
439
|
blsVerifyOnMainThread: true,
|
|
437
440
|
// to track block process steps
|
|
438
441
|
seenTimestampSec,
|
|
439
|
-
// gossip block is validated, we want to process it asap
|
|
440
|
-
eagerPersistBlock: true,
|
|
441
442
|
})
|
|
442
443
|
.then(() => {
|
|
443
444
|
// Returns the delay between the start of `block.slot` and `current time`
|
|
444
445
|
const delaySec = chain.clock.secFromSlot(slot);
|
|
445
446
|
metrics?.gossipBlock.elapsedTimeTillProcessed.observe(delaySec);
|
|
446
|
-
chain.seenBlockInputCache.prune(blockInput.blockRootHex);
|
|
447
447
|
})
|
|
448
448
|
.catch((e) => {
|
|
449
449
|
// Adjust verbosity based on error type
|
|
@@ -818,6 +818,51 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
818
818
|
|
|
819
819
|
chain.emitter.emit(routes.events.EventType.blsToExecutionChange, blsToExecutionChange);
|
|
820
820
|
},
|
|
821
|
+
[GossipType.execution_payload]: async ({
|
|
822
|
+
gossipData,
|
|
823
|
+
topic,
|
|
824
|
+
}: GossipHandlerParamGeneric<GossipType.execution_payload>) => {
|
|
825
|
+
const {serializedData} = gossipData;
|
|
826
|
+
const executionPayloadEnvelope = sszDeserialize(topic, serializedData);
|
|
827
|
+
await validateGossipExecutionPayloadEnvelope(chain, executionPayloadEnvelope);
|
|
828
|
+
|
|
829
|
+
// TODO GLOAS: Handle valid envelope. Need an import flow that calls `processExecutionPayloadEnvelope` and fork choice
|
|
830
|
+
},
|
|
831
|
+
[GossipType.payload_attestation_message]: async ({
|
|
832
|
+
gossipData,
|
|
833
|
+
topic,
|
|
834
|
+
}: GossipHandlerParamGeneric<GossipType.payload_attestation_message>) => {
|
|
835
|
+
const {serializedData} = gossipData;
|
|
836
|
+
const payloadAttestationMessage = sszDeserialize(topic, serializedData);
|
|
837
|
+
const validationResult = await validateGossipPayloadAttestationMessage(chain, payloadAttestationMessage);
|
|
838
|
+
|
|
839
|
+
try {
|
|
840
|
+
const insertOutcome = chain.payloadAttestationPool.add(
|
|
841
|
+
payloadAttestationMessage,
|
|
842
|
+
validationResult.attDataRootHex,
|
|
843
|
+
validationResult.validatorCommitteeIndex
|
|
844
|
+
);
|
|
845
|
+
metrics?.opPool.payloadAttestationPool.gossipInsertOutcome.inc({insertOutcome});
|
|
846
|
+
} catch (e) {
|
|
847
|
+
logger.error("Error adding to payloadAttestation pool", {}, e as Error);
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
[GossipType.execution_payload_bid]: async ({
|
|
851
|
+
gossipData,
|
|
852
|
+
topic,
|
|
853
|
+
}: GossipHandlerParamGeneric<GossipType.execution_payload_bid>) => {
|
|
854
|
+
const {serializedData} = gossipData;
|
|
855
|
+
const executionPayloadBid = sszDeserialize(topic, serializedData);
|
|
856
|
+
await validateGossipExecutionPayloadBid(chain, executionPayloadBid);
|
|
857
|
+
|
|
858
|
+
// Handle valid payload bid by storing in a bid pool
|
|
859
|
+
try {
|
|
860
|
+
const insertOutcome = chain.executionPayloadBidPool.add(executionPayloadBid.message);
|
|
861
|
+
metrics?.opPool.executionPayloadBidPool.gossipInsertOutcome.inc({insertOutcome});
|
|
862
|
+
} catch (e) {
|
|
863
|
+
logger.error("Error adding to executionPayloadBid pool", {}, e as Error);
|
|
864
|
+
}
|
|
865
|
+
},
|
|
821
866
|
};
|
|
822
867
|
}
|
|
823
868
|
|
|
@@ -67,6 +67,22 @@ const linearGossipQueueOpts: {
|
|
|
67
67
|
type: QueueType.FIFO,
|
|
68
68
|
dropOpts: {type: DropType.count, count: 1},
|
|
69
69
|
},
|
|
70
|
+
[GossipType.execution_payload]: {
|
|
71
|
+
maxLength: 1024,
|
|
72
|
+
type: QueueType.FIFO,
|
|
73
|
+
dropOpts: {type: DropType.count, count: 1},
|
|
74
|
+
},
|
|
75
|
+
[GossipType.payload_attestation_message]: {
|
|
76
|
+
maxLength: 1024,
|
|
77
|
+
type: QueueType.FIFO,
|
|
78
|
+
dropOpts: {type: DropType.count, count: 1},
|
|
79
|
+
},
|
|
80
|
+
// TODO GLOAS: It is hard to predict how many bids are there. Put 1024 for max length for now
|
|
81
|
+
[GossipType.execution_payload_bid]: {
|
|
82
|
+
maxLength: 1024,
|
|
83
|
+
type: QueueType.FIFO,
|
|
84
|
+
dropOpts: {type: DropType.count, count: 1},
|
|
85
|
+
},
|
|
70
86
|
};
|
|
71
87
|
|
|
72
88
|
const indexedGossipQueueOpts: {
|
|
@@ -78,6 +78,9 @@ const executeGossipWorkOrderObj: Record<GossipType, WorkOpts> = {
|
|
|
78
78
|
[GossipType.sync_committee]: {},
|
|
79
79
|
[GossipType.light_client_finality_update]: {},
|
|
80
80
|
[GossipType.light_client_optimistic_update]: {},
|
|
81
|
+
[GossipType.execution_payload]: {bypassQueue: true},
|
|
82
|
+
[GossipType.payload_attestation_message]: {},
|
|
83
|
+
[GossipType.execution_payload_bid]: {},
|
|
81
84
|
};
|
|
82
85
|
const executeGossipWorkOrder = Object.keys(executeGossipWorkOrderObj) as (keyof typeof executeGossipWorkOrderObj)[];
|
|
83
86
|
|
|
@@ -4,7 +4,6 @@ import {GENESIS_SLOT, isForkPostDeneb, isForkPostFulu} from "@lodestar/params";
|
|
|
4
4
|
import {RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
|
|
5
5
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
6
6
|
import {deneb, phase0} from "@lodestar/types";
|
|
7
|
-
import {fromHex} from "@lodestar/utils";
|
|
8
7
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
9
8
|
import {IBeaconDb} from "../../../db/index.js";
|
|
10
9
|
import {prettyPrintPeerId} from "../../util.ts";
|
|
@@ -22,7 +21,6 @@ export async function* onBeaconBlocksByRange(
|
|
|
22
21
|
const endSlot = startSlot + count;
|
|
23
22
|
|
|
24
23
|
const finalized = db.blockArchive;
|
|
25
|
-
const unfinalized = db.block;
|
|
26
24
|
// in the case of initializing from a non-finalized state, we don't have the finalized block so this api does not work
|
|
27
25
|
// chain.forkChoice.getFinalizeBlock().slot
|
|
28
26
|
const finalizedSlot = chain.forkChoice.getFinalizedCheckpointSlot();
|
|
@@ -65,7 +63,7 @@ export async function* onBeaconBlocksByRange(
|
|
|
65
63
|
// re-org there's no need to abort the request
|
|
66
64
|
// Spec: https://github.com/ethereum/consensus-specs/blob/a1e46d1ae47dd9d097725801575b46907c12a1f8/specs/eip4844/p2p-interface.md#blobssidecarsbyrange-v1
|
|
67
65
|
|
|
68
|
-
const blockBytes = await
|
|
66
|
+
const blockBytes = await chain.getSerializedBlockByRoot(block.blockRoot);
|
|
69
67
|
if (!blockBytes) {
|
|
70
68
|
throw new ResponseError(
|
|
71
69
|
RespStatus.SERVER_ERROR,
|
|
@@ -74,7 +72,7 @@ export async function* onBeaconBlocksByRange(
|
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
yield {
|
|
77
|
-
data: blockBytes,
|
|
75
|
+
data: blockBytes.block,
|
|
78
76
|
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(block.slot)),
|
|
79
77
|
};
|
|
80
78
|
}
|
|
@@ -1,48 +1,21 @@
|
|
|
1
1
|
import {ResponseOutgoing} from "@lodestar/reqresp";
|
|
2
2
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
3
|
-
import {Slot} from "@lodestar/types";
|
|
4
3
|
import {toRootHex} from "@lodestar/utils";
|
|
5
4
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
6
|
-
import {IBeaconDb} from "../../../db/index.js";
|
|
7
|
-
import {getSlotFromSignedBeaconBlockSerialized} from "../../../util/sszBytes.js";
|
|
8
5
|
import {BeaconBlocksByRootRequest} from "../../../util/types.js";
|
|
9
6
|
|
|
10
7
|
export async function* onBeaconBlocksByRoot(
|
|
11
8
|
requestBody: BeaconBlocksByRootRequest,
|
|
12
|
-
chain: IBeaconChain
|
|
13
|
-
db: IBeaconDb
|
|
9
|
+
chain: IBeaconChain
|
|
14
10
|
): AsyncIterable<ResponseOutgoing> {
|
|
15
11
|
for (const blockRoot of requestBody) {
|
|
16
12
|
const root = blockRoot;
|
|
17
|
-
const
|
|
18
|
-
let blockBytes: Uint8Array | null = null;
|
|
19
|
-
|
|
20
|
-
// finalized block has summary in forkchoice but it stays in blockArchive db
|
|
21
|
-
if (summary) {
|
|
22
|
-
blockBytes = await db.block.getBinary(root);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let slot: Slot | undefined = undefined;
|
|
26
|
-
if (!blockBytes) {
|
|
27
|
-
const blockEntry = await db.blockArchive.getBinaryEntryByRoot(root);
|
|
28
|
-
if (blockEntry) {
|
|
29
|
-
slot = blockEntry.key;
|
|
30
|
-
blockBytes = blockEntry.value;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (blockBytes) {
|
|
35
|
-
if (slot === undefined) {
|
|
36
|
-
const slotFromBytes = getSlotFromSignedBeaconBlockSerialized(blockBytes);
|
|
37
|
-
if (slotFromBytes === null) {
|
|
38
|
-
throw Error(`Invalid block bytes for block root ${toRootHex(root)}`);
|
|
39
|
-
}
|
|
40
|
-
slot = slotFromBytes;
|
|
41
|
-
}
|
|
13
|
+
const block = await chain.getSerializedBlockByRoot(toRootHex(root));
|
|
42
14
|
|
|
15
|
+
if (block) {
|
|
43
16
|
yield {
|
|
44
|
-
data:
|
|
45
|
-
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(slot)),
|
|
17
|
+
data: block.block,
|
|
18
|
+
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(block.slot)),
|
|
46
19
|
};
|
|
47
20
|
}
|
|
48
21
|
}
|
|
@@ -2,16 +2,13 @@ import {BLOB_SIDECAR_FIXED_SIZE} from "@lodestar/params";
|
|
|
2
2
|
import {RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
|
|
3
3
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
4
4
|
import {RootHex} from "@lodestar/types";
|
|
5
|
-
import {
|
|
5
|
+
import {toRootHex} from "@lodestar/utils";
|
|
6
6
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
7
|
-
import {IBeaconDb} from "../../../db/index.js";
|
|
8
|
-
import {BLOB_SIDECARS_IN_WRAPPER_INDEX} from "../../../db/repositories/blobSidecars.js";
|
|
9
7
|
import {BlobSidecarsByRootRequest} from "../../../util/types.js";
|
|
10
8
|
|
|
11
9
|
export async function* onBlobSidecarsByRoot(
|
|
12
10
|
requestBody: BlobSidecarsByRootRequest,
|
|
13
|
-
chain: IBeaconChain
|
|
14
|
-
db: IBeaconDb
|
|
11
|
+
chain: IBeaconChain
|
|
15
12
|
): AsyncIterable<ResponseOutgoing> {
|
|
16
13
|
const finalizedSlot = chain.forkChoice.getFinalizedBlock().slot;
|
|
17
14
|
|
|
@@ -34,14 +31,13 @@ export async function* onBlobSidecarsByRoot(
|
|
|
34
31
|
|
|
35
32
|
// Check if we need to load sidecars for a new block root
|
|
36
33
|
if (lastFetchedSideCars === null || lastFetchedSideCars.blockRoot !== blockRootHex) {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
34
|
+
const blobSidecarsBytes = await chain.getSerializedBlobSidecars(block.slot, blockRootHex);
|
|
35
|
+
if (!blobSidecarsBytes) {
|
|
39
36
|
// Handle the same to onBeaconBlocksByRange
|
|
40
37
|
throw new ResponseError(RespStatus.SERVER_ERROR, `No item for root ${block.blockRoot} slot ${block.slot}`);
|
|
41
38
|
}
|
|
42
|
-
const blobSideCarsBytes = blobSideCarsBytesWrapped.slice(BLOB_SIDECARS_IN_WRAPPER_INDEX);
|
|
43
39
|
|
|
44
|
-
lastFetchedSideCars = {blockRoot: blockRootHex, bytes:
|
|
40
|
+
lastFetchedSideCars = {blockRoot: blockRootHex, bytes: blobSidecarsBytes};
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
const blobSidecarBytes = lastFetchedSideCars.bytes.slice(
|
|
@@ -38,7 +38,6 @@ export async function* onDataColumnSidecarsByRange(
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const finalized = db.dataColumnSidecarArchive;
|
|
41
|
-
const unfinalized = db.dataColumnSidecar;
|
|
42
41
|
const finalizedSlot = chain.forkChoice.getFinalizedBlock().slot;
|
|
43
42
|
|
|
44
43
|
// Finalized range of columns
|
|
@@ -92,7 +91,11 @@ export async function* onDataColumnSidecarsByRange(
|
|
|
92
91
|
// at the time of the start of the request. Spec is clear the chain of columns must be consistent, but on
|
|
93
92
|
// re-org there's no need to abort the request
|
|
94
93
|
// Spec: https://github.com/ethereum/consensus-specs/blob/ad36024441cf910d428d03f87f331fbbd2b3e5f1/specs/fulu/p2p-interface.md#L425-L429
|
|
95
|
-
const dataColumnSidecars = await
|
|
94
|
+
const dataColumnSidecars = await chain.getSerializedDataColumnSidecars(
|
|
95
|
+
block.slot,
|
|
96
|
+
block.blockRoot,
|
|
97
|
+
availableColumns
|
|
98
|
+
);
|
|
96
99
|
|
|
97
100
|
const unavailableColumnIndices: ColumnIndex[] = [];
|
|
98
101
|
for (let i = 0; i < dataColumnSidecars.length; i++) {
|
|
@@ -61,11 +61,7 @@ export async function* onDataColumnSidecarsByRoot(
|
|
|
61
61
|
continue;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
const dataColumns =
|
|
65
|
-
? // Non-finalized sidecars are stored by block root
|
|
66
|
-
await db.dataColumnSidecar.getManyBinary(blockRoot, availableColumns)
|
|
67
|
-
: // Finalized sidecars are archived and stored by slot
|
|
68
|
-
await db.dataColumnSidecarArchive.getManyBinary(slot, availableColumns);
|
|
64
|
+
const dataColumns = await chain.getSerializedDataColumnSidecars(slot, blockRootHex, availableColumns);
|
|
69
65
|
|
|
70
66
|
const unavailableColumnIndices: ColumnIndex[] = [];
|
|
71
67
|
for (let i = 0; i < dataColumns.length; i++) {
|
|
@@ -42,12 +42,12 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
|
|
|
42
42
|
[ReqRespMethod.BeaconBlocksByRoot]: (req) => {
|
|
43
43
|
const fork = chain.config.getForkName(chain.clock.currentSlot);
|
|
44
44
|
const body = BeaconBlocksByRootRequestType(fork, chain.config).deserialize(req.data);
|
|
45
|
-
return onBeaconBlocksByRoot(body, chain
|
|
45
|
+
return onBeaconBlocksByRoot(body, chain);
|
|
46
46
|
},
|
|
47
47
|
[ReqRespMethod.BlobSidecarsByRoot]: (req) => {
|
|
48
48
|
const fork = chain.config.getForkName(chain.clock.currentSlot);
|
|
49
49
|
const body = BlobSidecarsByRootRequestType(fork, chain.config).deserialize(req.data);
|
|
50
|
-
return onBlobSidecarsByRoot(body, chain
|
|
50
|
+
return onBlobSidecarsByRoot(body, chain);
|
|
51
51
|
},
|
|
52
52
|
[ReqRespMethod.BlobSidecarsByRange]: (req) => {
|
|
53
53
|
const body = ssz.deneb.BlobSidecarsByRangeRequest.deserialize(req.data);
|
|
@@ -750,7 +750,7 @@ export class BackfillSync extends (EventEmitter as {new (): BackfillSyncEmitter}
|
|
|
750
750
|
|
|
751
751
|
// GENESIS_SLOT doesn't has valid signature
|
|
752
752
|
if (anchorBlock.message.slot === GENESIS_SLOT) return;
|
|
753
|
-
await verifyBlockProposerSignature(this.chain.config, this.chain.
|
|
753
|
+
await verifyBlockProposerSignature(this.chain.config, this.chain.bls, [anchorBlock]);
|
|
754
754
|
|
|
755
755
|
// We can write to the disk if this is ahead of prevFinalizedCheckpointBlock otherwise
|
|
756
756
|
// we will need to go make checks on the top of sync loop before writing as it might
|
|
@@ -815,7 +815,7 @@ export class BackfillSync extends (EventEmitter as {new (): BackfillSyncEmitter}
|
|
|
815
815
|
|
|
816
816
|
// If any of the block's proposer signature fail, we can't trust this peer at all
|
|
817
817
|
if (verifiedBlocks.length > 0) {
|
|
818
|
-
await verifyBlockProposerSignature(this.chain.config, this.chain.
|
|
818
|
+
await verifyBlockProposerSignature(this.chain.config, this.chain.bls, verifiedBlocks);
|
|
819
819
|
|
|
820
820
|
// This is bad, like super bad. Abort the backfill
|
|
821
821
|
if (!nextAnchor)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
3
|
-
import {ISignatureSet,
|
|
3
|
+
import {ISignatureSet, getBlockProposerSignatureSet} from "@lodestar/state-transition";
|
|
4
4
|
import {Root, SignedBeaconBlock, Slot, ssz} from "@lodestar/types";
|
|
5
5
|
import {IBlsVerifier} from "../../chain/bls/index.js";
|
|
6
6
|
import {BackfillSyncError, BackfillSyncErrorCode} from "./errors.js";
|
|
@@ -42,14 +42,13 @@ export function verifyBlockSequence(
|
|
|
42
42
|
|
|
43
43
|
export async function verifyBlockProposerSignature(
|
|
44
44
|
config: BeaconConfig,
|
|
45
|
-
index2pubkey: Index2PubkeyCache,
|
|
46
45
|
bls: IBlsVerifier,
|
|
47
46
|
blocks: SignedBeaconBlock[]
|
|
48
47
|
): Promise<void> {
|
|
49
48
|
if (blocks.length === 1 && blocks[0].message.slot === GENESIS_SLOT) return;
|
|
50
49
|
const signatures = blocks.reduce((sigs: ISignatureSet[], block) => {
|
|
51
50
|
// genesis block doesn't have valid signature
|
|
52
|
-
if (block.message.slot !== GENESIS_SLOT) sigs.push(getBlockProposerSignatureSet(config,
|
|
51
|
+
if (block.message.slot !== GENESIS_SLOT) sigs.push(getBlockProposerSignatureSet(config, block));
|
|
53
52
|
return sigs;
|
|
54
53
|
}, []);
|
|
55
54
|
|
package/src/sync/range/chain.ts
CHANGED
package/src/sync/range/range.ts
CHANGED
|
@@ -188,9 +188,6 @@ export class RangeSync extends (EventEmitter as {new (): RangeSyncEmitter}) {
|
|
|
188
188
|
// when this runs, syncing is the most important thing and gossip is not likely to run
|
|
189
189
|
// so we can utilize worker threads to verify signatures
|
|
190
190
|
blsVerifyOnMainThread: false,
|
|
191
|
-
// we want to be safe to only persist blocks after verifying it to avoid any attacks that may cause our DB
|
|
192
|
-
// to grow too much
|
|
193
|
-
eagerPersistBlock: false,
|
|
194
191
|
};
|
|
195
192
|
|
|
196
193
|
if (this.opts?.disableProcessAsChainSegment) {
|
package/src/sync/unknownBlock.ts
CHANGED
|
@@ -423,8 +423,6 @@ export class BlockInputSync {
|
|
|
423
423
|
// see https://github.com/ChainSafe/lodestar/issues/5650
|
|
424
424
|
ignoreIfFinalized: true,
|
|
425
425
|
blsVerifyOnMainThread: true,
|
|
426
|
-
// block is validated with correct root, we want to process it as soon as possible
|
|
427
|
-
eagerPersistBlock: true,
|
|
428
426
|
})
|
|
429
427
|
);
|
|
430
428
|
|
|
@@ -434,7 +432,6 @@ export class BlockInputSync {
|
|
|
434
432
|
if (!res.err) {
|
|
435
433
|
// no need to update status to "processed", delete anyway
|
|
436
434
|
this.pendingBlocks.delete(pendingBlock.blockInput.blockRootHex);
|
|
437
|
-
this.chain.seenBlockInputCache.prune(pendingBlock.blockInput.blockRootHex);
|
|
438
435
|
|
|
439
436
|
// Send child blocks to the processor
|
|
440
437
|
for (const descendantBlock of getDescendantBlocks(pendingBlock.blockInput.blockRootHex, this.pendingBlocks)) {
|