@lodestar/beacon-node 1.40.0-dev.c975f70481 → 1.40.0-dev.cfd894719f
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 +5 -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/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 +103 -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 +42 -3
- 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 +6 -3
- package/src/api/impl/validator/index.ts +12 -11
- 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 +140 -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 +52 -3
- 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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CachedBeaconStateGloas,
|
|
3
|
+
computeEpochAtSlot,
|
|
4
|
+
createSingleSignatureSetFromComponents,
|
|
5
|
+
getPayloadAttestationDataSigningRoot,
|
|
6
|
+
} from "@lodestar/state-transition";
|
|
7
|
+
import {RootHex, gloas, ssz} from "@lodestar/types";
|
|
8
|
+
import {toRootHex} from "@lodestar/utils";
|
|
9
|
+
import {GossipAction, PayloadAttestationError, PayloadAttestationErrorCode} from "../errors/index.js";
|
|
10
|
+
import {IBeaconChain} from "../index.js";
|
|
11
|
+
|
|
12
|
+
export type PayloadAttestationValidationResult = {
|
|
13
|
+
attDataRootHex: RootHex;
|
|
14
|
+
validatorCommitteeIndex: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export async function validateApiPayloadAttestationMessage(
|
|
18
|
+
chain: IBeaconChain,
|
|
19
|
+
payloadAttestationMessage: gloas.PayloadAttestationMessage
|
|
20
|
+
): Promise<PayloadAttestationValidationResult> {
|
|
21
|
+
return validatePayloadAttestationMessage(chain, payloadAttestationMessage);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function validateGossipPayloadAttestationMessage(
|
|
25
|
+
chain: IBeaconChain,
|
|
26
|
+
payloadAttestationMessage: gloas.PayloadAttestationMessage
|
|
27
|
+
): Promise<PayloadAttestationValidationResult> {
|
|
28
|
+
return validatePayloadAttestationMessage(chain, payloadAttestationMessage);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function validatePayloadAttestationMessage(
|
|
32
|
+
chain: IBeaconChain,
|
|
33
|
+
payloadAttestationMessage: gloas.PayloadAttestationMessage
|
|
34
|
+
): Promise<PayloadAttestationValidationResult> {
|
|
35
|
+
const {data, validatorIndex} = payloadAttestationMessage;
|
|
36
|
+
const epoch = computeEpochAtSlot(data.slot);
|
|
37
|
+
|
|
38
|
+
// [IGNORE] The message's slot is for the current slot (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance), i.e. `data.slot == current_slot`.
|
|
39
|
+
if (!chain.clock.isCurrentSlotGivenGossipDisparity(data.slot)) {
|
|
40
|
+
throw new PayloadAttestationError(GossipAction.IGNORE, {
|
|
41
|
+
code: PayloadAttestationErrorCode.NOT_CURRENT_SLOT,
|
|
42
|
+
currentSlot: chain.clock.currentSlot,
|
|
43
|
+
slot: data.slot,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// [IGNORE] The `payload_attestation_message` is the first valid message received
|
|
48
|
+
// from the validator with index `payload_attestation_message.validator_index`.
|
|
49
|
+
// A single validator can participate PTC at most once per epoch
|
|
50
|
+
if (chain.seenPayloadAttesters.isKnown(epoch, validatorIndex)) {
|
|
51
|
+
throw new PayloadAttestationError(GossipAction.IGNORE, {
|
|
52
|
+
code: PayloadAttestationErrorCode.PAYLOAD_ATTESTATION_ALREADY_KNOWN,
|
|
53
|
+
validatorIndex,
|
|
54
|
+
slot: data.slot,
|
|
55
|
+
blockRoot: toRootHex(data.beaconBlockRoot),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// [IGNORE] The message's block `data.beacon_block_root` has been seen (via
|
|
60
|
+
// gossip or non-gossip sources) (a client MAY queue attestation for processing
|
|
61
|
+
// once the block is retrieved. Note a client might want to request payload after).
|
|
62
|
+
const block = chain.forkChoice.getBlock(data.beaconBlockRoot);
|
|
63
|
+
if (block === null) {
|
|
64
|
+
throw new PayloadAttestationError(GossipAction.IGNORE, {
|
|
65
|
+
code: PayloadAttestationErrorCode.UNKNOWN_BLOCK_ROOT,
|
|
66
|
+
blockRoot: toRootHex(data.beaconBlockRoot),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const state = chain.getHeadState() as CachedBeaconStateGloas;
|
|
71
|
+
|
|
72
|
+
// [REJECT] The message's block `data.beacon_block_root` passes validation.
|
|
73
|
+
// TODO GLOAS: implement this. Technically if we cannot get proto block from fork choice,
|
|
74
|
+
// it is possible that the block didn't pass the validation
|
|
75
|
+
|
|
76
|
+
// [REJECT] The message's validator index is within the payload committee in
|
|
77
|
+
// `get_ptc(state, data.slot)`. The `state` is the head state corresponding to
|
|
78
|
+
// processing the block up to the current slot as determined by the fork choice.
|
|
79
|
+
const ptc = state.epochCtx.getPayloadTimelinessCommittee(data.slot);
|
|
80
|
+
const validatorCommitteeIndex = ptc.indexOf(validatorIndex);
|
|
81
|
+
|
|
82
|
+
if (validatorCommitteeIndex === -1) {
|
|
83
|
+
throw new PayloadAttestationError(GossipAction.REJECT, {
|
|
84
|
+
code: PayloadAttestationErrorCode.INVALID_ATTESTER,
|
|
85
|
+
attesterIndex: validatorIndex,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// [REJECT] `payload_attestation_message.signature` is valid with respect to the validator's public key.
|
|
90
|
+
const signatureSet = createSingleSignatureSetFromComponents(
|
|
91
|
+
chain.index2pubkey[validatorIndex],
|
|
92
|
+
getPayloadAttestationDataSigningRoot(state, data),
|
|
93
|
+
payloadAttestationMessage.signature
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
if (!(await chain.bls.verifySignatureSets([signatureSet]))) {
|
|
97
|
+
throw new PayloadAttestationError(GossipAction.REJECT, {
|
|
98
|
+
code: PayloadAttestationErrorCode.INVALID_SIGNATURE,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Valid
|
|
103
|
+
chain.seenPayloadAttesters.add(epoch, validatorIndex);
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
attDataRootHex: toRootHex(ssz.gloas.PayloadAttestationData.hashTreeRoot(data)),
|
|
107
|
+
validatorCommitteeIndex,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -45,12 +45,7 @@ async function validateProposerSlashing(
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const signatureSets = getProposerSlashingSignatureSets(
|
|
49
|
-
chain.config,
|
|
50
|
-
chain.index2pubkey,
|
|
51
|
-
state.slot,
|
|
52
|
-
proposerSlashing
|
|
53
|
-
);
|
|
48
|
+
const signatureSets = getProposerSlashingSignatureSets(chain.config, state.slot, proposerSlashing);
|
|
54
49
|
if (!(await chain.bls.verifySignatureSets(signatureSets, {batchable: true, priority: prioritizeBls}))) {
|
|
55
50
|
throw new ProposerSlashingError(GossipAction.REJECT, {
|
|
56
51
|
code: ProposerSlashingErrorCode.INVALID,
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {PublicKey} from "@chainsafe/blst";
|
|
2
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
3
2
|
import {DOMAIN_AGGREGATE_AND_PROOF, ForkSeq} from "@lodestar/params";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
computeSigningRoot,
|
|
7
|
-
computeStartSlotAtEpoch,
|
|
8
|
-
createSingleSignatureSetFromComponents,
|
|
9
|
-
} from "@lodestar/state-transition";
|
|
10
|
-
import {Epoch, SignedAggregateAndProof, ssz} from "@lodestar/types";
|
|
3
|
+
import {ISignatureSet, SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
4
|
+
import {Epoch, SignedAggregateAndProof, ValidatorIndex, ssz} from "@lodestar/types";
|
|
11
5
|
|
|
12
6
|
export function getAggregateAndProofSigningRoot(
|
|
13
7
|
config: BeaconConfig,
|
|
@@ -27,12 +21,13 @@ export function getAggregateAndProofSigningRoot(
|
|
|
27
21
|
export function getAggregateAndProofSignatureSet(
|
|
28
22
|
config: BeaconConfig,
|
|
29
23
|
epoch: Epoch,
|
|
30
|
-
|
|
24
|
+
aggregatorIndex: ValidatorIndex,
|
|
31
25
|
aggregateAndProof: SignedAggregateAndProof
|
|
32
26
|
): ISignatureSet {
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
aggregateAndProof
|
|
37
|
-
|
|
27
|
+
return {
|
|
28
|
+
type: SignatureSetType.indexed,
|
|
29
|
+
index: aggregatorIndex,
|
|
30
|
+
signingRoot: getAggregateAndProofSigningRoot(config, epoch, aggregateAndProof),
|
|
31
|
+
signature: aggregateAndProof.signature,
|
|
32
|
+
};
|
|
38
33
|
}
|
|
@@ -3,7 +3,6 @@ import {DOMAIN_CONTRIBUTION_AND_PROOF} from "@lodestar/params";
|
|
|
3
3
|
import {
|
|
4
4
|
CachedBeaconStateAllForks,
|
|
5
5
|
ISignatureSet,
|
|
6
|
-
Index2PubkeyCache,
|
|
7
6
|
SignatureSetType,
|
|
8
7
|
computeSigningRoot,
|
|
9
8
|
} from "@lodestar/state-transition";
|
|
@@ -11,7 +10,6 @@ import {altair, ssz} from "@lodestar/types";
|
|
|
11
10
|
|
|
12
11
|
export function getContributionAndProofSignatureSet(
|
|
13
12
|
config: BeaconConfig,
|
|
14
|
-
index2pubkey: Index2PubkeyCache,
|
|
15
13
|
state: CachedBeaconStateAllForks,
|
|
16
14
|
signedContributionAndProof: altair.SignedContributionAndProof
|
|
17
15
|
): ISignatureSet {
|
|
@@ -22,8 +20,8 @@ export function getContributionAndProofSignatureSet(
|
|
|
22
20
|
);
|
|
23
21
|
const signingData = signedContributionAndProof.message;
|
|
24
22
|
return {
|
|
25
|
-
type: SignatureSetType.
|
|
26
|
-
|
|
23
|
+
type: SignatureSetType.indexed,
|
|
24
|
+
index: signedContributionAndProof.message.aggregatorIndex,
|
|
27
25
|
signingRoot: computeSigningRoot(ssz.altair.ContributionAndProof, signingData, domain),
|
|
28
26
|
signature: signedContributionAndProof.signature,
|
|
29
27
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {PublicKey} from "@chainsafe/blst";
|
|
2
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
3
2
|
import {DOMAIN_SELECTION_PROOF} from "@lodestar/params";
|
|
4
|
-
import {ISignatureSet,
|
|
5
|
-
import {Slot, phase0, ssz} from "@lodestar/types";
|
|
3
|
+
import {ISignatureSet, SignatureSetType, computeSigningRoot} from "@lodestar/state-transition";
|
|
4
|
+
import {Slot, ValidatorIndex, phase0, ssz} from "@lodestar/types";
|
|
6
5
|
|
|
7
6
|
export function getSelectionProofSigningRoot(config: BeaconConfig, slot: Slot): Uint8Array {
|
|
8
7
|
// previously, we call `const selectionProofDomain = config.getDomain(state.slot, DOMAIN_SELECTION_PROOF, slot)`
|
|
@@ -16,12 +15,13 @@ export function getSelectionProofSigningRoot(config: BeaconConfig, slot: Slot):
|
|
|
16
15
|
export function getSelectionProofSignatureSet(
|
|
17
16
|
config: BeaconConfig,
|
|
18
17
|
slot: Slot,
|
|
19
|
-
|
|
18
|
+
aggregatorIndex: ValidatorIndex,
|
|
20
19
|
aggregateAndProof: phase0.SignedAggregateAndProof
|
|
21
20
|
): ISignatureSet {
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
return {
|
|
22
|
+
type: SignatureSetType.indexed,
|
|
23
|
+
index: aggregatorIndex,
|
|
24
|
+
signingRoot: getSelectionProofSigningRoot(config, slot),
|
|
25
|
+
signature: aggregateAndProof.message.selectionProof,
|
|
26
|
+
};
|
|
27
27
|
}
|
|
@@ -3,7 +3,6 @@ import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params";
|
|
|
3
3
|
import {
|
|
4
4
|
CachedBeaconStateAllForks,
|
|
5
5
|
ISignatureSet,
|
|
6
|
-
Index2PubkeyCache,
|
|
7
6
|
SignatureSetType,
|
|
8
7
|
computeSigningRoot,
|
|
9
8
|
} from "@lodestar/state-transition";
|
|
@@ -11,15 +10,14 @@ import {altair, ssz} from "@lodestar/types";
|
|
|
11
10
|
|
|
12
11
|
export function getSyncCommitteeSignatureSet(
|
|
13
12
|
config: BeaconConfig,
|
|
14
|
-
index2pubkey: Index2PubkeyCache,
|
|
15
13
|
state: CachedBeaconStateAllForks,
|
|
16
14
|
syncCommittee: altair.SyncCommitteeMessage
|
|
17
15
|
): ISignatureSet {
|
|
18
16
|
const domain = config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE, syncCommittee.slot);
|
|
19
17
|
|
|
20
18
|
return {
|
|
21
|
-
type: SignatureSetType.
|
|
22
|
-
|
|
19
|
+
type: SignatureSetType.indexed,
|
|
20
|
+
index: syncCommittee.validatorIndex,
|
|
23
21
|
signingRoot: computeSigningRoot(ssz.Root, syncCommittee.beaconBlockRoot, domain),
|
|
24
22
|
signature: syncCommittee.signature,
|
|
25
23
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {PublicKey} from "@chainsafe/blst";
|
|
2
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
3
2
|
import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params";
|
|
4
3
|
import {CachedBeaconStateAltair, ISignatureSet, SignatureSetType, computeSigningRoot} from "@lodestar/state-transition";
|
|
@@ -8,12 +7,12 @@ export function getSyncCommitteeContributionSignatureSet(
|
|
|
8
7
|
config: BeaconConfig,
|
|
9
8
|
state: CachedBeaconStateAltair,
|
|
10
9
|
contribution: altair.SyncCommitteeContribution,
|
|
11
|
-
|
|
10
|
+
participantIndices: number[]
|
|
12
11
|
): ISignatureSet {
|
|
13
12
|
const domain = config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE, contribution.slot);
|
|
14
13
|
return {
|
|
15
14
|
type: SignatureSetType.aggregate,
|
|
16
|
-
|
|
15
|
+
indices: participantIndices,
|
|
17
16
|
signingRoot: computeSigningRoot(ssz.Root, contribution.beaconBlockRoot, domain),
|
|
18
17
|
signature: contribution.signature,
|
|
19
18
|
};
|
|
@@ -3,7 +3,6 @@ import {DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF} from "@lodestar/params";
|
|
|
3
3
|
import {
|
|
4
4
|
CachedBeaconStateAllForks,
|
|
5
5
|
ISignatureSet,
|
|
6
|
-
Index2PubkeyCache,
|
|
7
6
|
SignatureSetType,
|
|
8
7
|
computeSigningRoot,
|
|
9
8
|
} from "@lodestar/state-transition";
|
|
@@ -11,7 +10,6 @@ import {altair, ssz} from "@lodestar/types";
|
|
|
11
10
|
|
|
12
11
|
export function getSyncCommitteeSelectionProofSignatureSet(
|
|
13
12
|
config: BeaconConfig,
|
|
14
|
-
index2pubkey: Index2PubkeyCache,
|
|
15
13
|
state: CachedBeaconStateAllForks,
|
|
16
14
|
contributionAndProof: altair.ContributionAndProof
|
|
17
15
|
): ISignatureSet {
|
|
@@ -22,8 +20,8 @@ export function getSyncCommitteeSelectionProofSignatureSet(
|
|
|
22
20
|
subcommitteeIndex: contributionAndProof.contribution.subcommitteeIndex,
|
|
23
21
|
};
|
|
24
22
|
return {
|
|
25
|
-
type: SignatureSetType.
|
|
26
|
-
|
|
23
|
+
type: SignatureSetType.indexed,
|
|
24
|
+
index: contributionAndProof.aggregatorIndex,
|
|
27
25
|
signingRoot: computeSigningRoot(ssz.altair.SyncAggregatorSelectionData, signingData, domain),
|
|
28
26
|
signature: contributionAndProof.selectionProof,
|
|
29
27
|
};
|
|
@@ -89,7 +89,7 @@ async function validateSyncCommitteeSigOnly(
|
|
|
89
89
|
syncCommittee: altair.SyncCommitteeMessage,
|
|
90
90
|
prioritizeBls = false
|
|
91
91
|
): Promise<void> {
|
|
92
|
-
const signatureSet = getSyncCommitteeSignatureSet(chain.config,
|
|
92
|
+
const signatureSet = getSyncCommitteeSignatureSet(chain.config, headState, syncCommittee);
|
|
93
93
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
94
94
|
throw new SyncCommitteeError(GossipAction.REJECT, {
|
|
95
95
|
code: SyncCommitteeErrorCode.INVALID_SIGNATURE,
|
|
@@ -21,7 +21,6 @@ export async function validateSyncCommitteeGossipContributionAndProof(
|
|
|
21
21
|
const contributionAndProof = signedContributionAndProof.message;
|
|
22
22
|
const {contribution, aggregatorIndex} = contributionAndProof;
|
|
23
23
|
const {subcommitteeIndex, slot} = contribution;
|
|
24
|
-
const {index2pubkey} = chain;
|
|
25
24
|
|
|
26
25
|
const headState = chain.getHeadState();
|
|
27
26
|
validateGossipSyncCommitteeExceptSig(chain, headState, subcommitteeIndex, {
|
|
@@ -74,14 +73,13 @@ export async function validateSyncCommitteeGossipContributionAndProof(
|
|
|
74
73
|
// i.e. state.validators[contribution_and_proof.aggregator_index].pubkey in get_sync_subcommittee_pubkeys(state, contribution.subcommittee_index).
|
|
75
74
|
// > Checked in validateGossipSyncCommitteeExceptSig()
|
|
76
75
|
|
|
77
|
-
const participantPubkeys = syncCommitteeParticipantIndices.map((validatorIndex) => index2pubkey[validatorIndex]);
|
|
78
76
|
const signatureSets = [
|
|
79
77
|
// [REJECT] The contribution_and_proof.selection_proof is a valid signature of the SyncAggregatorSelectionData
|
|
80
78
|
// derived from the contribution by the validator with index contribution_and_proof.aggregator_index.
|
|
81
|
-
getSyncCommitteeSelectionProofSignatureSet(chain.config,
|
|
79
|
+
getSyncCommitteeSelectionProofSignatureSet(chain.config, headState, contributionAndProof),
|
|
82
80
|
|
|
83
81
|
// [REJECT] The aggregator signature, signed_contribution_and_proof.signature, is valid.
|
|
84
|
-
getContributionAndProofSignatureSet(chain.config,
|
|
82
|
+
getContributionAndProofSignatureSet(chain.config, headState, signedContributionAndProof),
|
|
85
83
|
|
|
86
84
|
// [REJECT] The aggregate signature is valid for the message beacon_block_root and aggregate pubkey derived from
|
|
87
85
|
// the participation info in aggregation_bits for the subcommittee specified by the contribution.subcommittee_index.
|
|
@@ -89,7 +87,7 @@ export async function validateSyncCommitteeGossipContributionAndProof(
|
|
|
89
87
|
chain.config,
|
|
90
88
|
headState as CachedBeaconStateAltair,
|
|
91
89
|
contribution,
|
|
92
|
-
|
|
90
|
+
syncCommitteeParticipantIndices
|
|
93
91
|
),
|
|
94
92
|
];
|
|
95
93
|
|
|
@@ -59,7 +59,7 @@ async function validateVoluntaryExit(
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const signatureSet = getVoluntaryExitSignatureSet(chain.config,
|
|
62
|
+
const signatureSet = getVoluntaryExitSignatureSet(chain.config, state.slot, voluntaryExit);
|
|
63
63
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
|
|
64
64
|
throw new VoluntaryExitError(GossipAction.REJECT, {
|
|
65
65
|
code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
altair,
|
|
25
25
|
deneb,
|
|
26
26
|
} from "@lodestar/types";
|
|
27
|
-
import {LogData, LogHandler, LogLevel, Logger, MapDef, MapDefMax, toRootHex} from "@lodestar/utils";
|
|
27
|
+
import {LogData, LogHandler, LogLevel, Logger, MapDef, MapDefMax, prettyPrintIndices, toRootHex} from "@lodestar/utils";
|
|
28
28
|
import {GENESIS_SLOT} from "../constants/constants.js";
|
|
29
29
|
import {RegistryMetricCreator} from "../metrics/index.js";
|
|
30
30
|
|
|
@@ -39,7 +39,8 @@ const MAX_CACHED_DISTINCT_TARGETS = 4;
|
|
|
39
39
|
const LATE_ATTESTATION_SUBMISSION_BPS = 5000;
|
|
40
40
|
const LATE_BLOCK_SUBMISSION_BPS = 2500;
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
/** Number of epochs to retain registered validators after their last registration */
|
|
43
|
+
const RETAIN_REGISTERED_VALIDATORS_EPOCHS = 2;
|
|
43
44
|
|
|
44
45
|
type Seconds = number;
|
|
45
46
|
export enum OpSource {
|
|
@@ -97,6 +98,8 @@ export type ValidatorMonitor = {
|
|
|
97
98
|
): void;
|
|
98
99
|
onceEveryEndOfEpoch(state: CachedBeaconStateAllForks): void;
|
|
99
100
|
scrapeMetrics(slotClock: Slot): void;
|
|
101
|
+
/** Returns the list of validator indices currently being monitored */
|
|
102
|
+
getMonitoredValidatorIndices(): ValidatorIndex[];
|
|
100
103
|
};
|
|
101
104
|
|
|
102
105
|
export type ValidatorMonitorOpts = {
|
|
@@ -284,6 +287,9 @@ export function createValidatorMonitor(
|
|
|
284
287
|
logger[logLevel](message, context);
|
|
285
288
|
};
|
|
286
289
|
|
|
290
|
+
// Calculate retain time dynamically based on slot duration (2 epochs)
|
|
291
|
+
const retainRegisteredValidatorsMs = SLOTS_PER_EPOCH * config.SLOT_DURATION_MS * RETAIN_REGISTERED_VALIDATORS_EPOCHS;
|
|
292
|
+
|
|
287
293
|
/** The validators that require additional monitoring. */
|
|
288
294
|
const validators = new MapDef<ValidatorIndex, MonitoredValidator>(() => ({
|
|
289
295
|
summaries: new Map<Epoch, EpochSummary>(),
|
|
@@ -306,11 +312,19 @@ export function createValidatorMonitor(
|
|
|
306
312
|
|
|
307
313
|
let lastRegisteredStatusEpoch = -1;
|
|
308
314
|
|
|
315
|
+
// Track validator additions/removals per epoch for logging
|
|
316
|
+
const addedValidatorsInEpoch: Set<ValidatorIndex> = new Set();
|
|
317
|
+
const removedValidatorsInEpoch: Set<ValidatorIndex> = new Set();
|
|
318
|
+
|
|
309
319
|
const validatorMonitorMetrics = metricsRegister ? createValidatorMonitorMetrics(metricsRegister) : null;
|
|
310
320
|
|
|
311
321
|
const validatorMonitor: ValidatorMonitor = {
|
|
312
322
|
registerLocalValidator(index) {
|
|
323
|
+
const isNewValidator = !validators.has(index);
|
|
313
324
|
validators.getOrDefault(index).lastRegisteredTimeMs = Date.now();
|
|
325
|
+
if (isNewValidator) {
|
|
326
|
+
addedValidatorsInEpoch.add(index);
|
|
327
|
+
}
|
|
314
328
|
},
|
|
315
329
|
|
|
316
330
|
registerLocalValidatorInSyncCommittee(index, untilEpoch) {
|
|
@@ -673,11 +687,29 @@ export function createValidatorMonitor(
|
|
|
673
687
|
|
|
674
688
|
// Prune validators not seen in a while
|
|
675
689
|
for (const [index, validator] of validators.entries()) {
|
|
676
|
-
if (Date.now() - validator.lastRegisteredTimeMs >
|
|
690
|
+
if (Date.now() - validator.lastRegisteredTimeMs > retainRegisteredValidatorsMs) {
|
|
677
691
|
validators.delete(index);
|
|
692
|
+
removedValidatorsInEpoch.add(index);
|
|
678
693
|
}
|
|
679
694
|
}
|
|
680
695
|
|
|
696
|
+
// Log validator monitor status every epoch
|
|
697
|
+
const allIndices = Array.from(validators.keys()).sort((a, b) => a - b);
|
|
698
|
+
const addedIndices = Array.from(addedValidatorsInEpoch).sort((a, b) => a - b);
|
|
699
|
+
const removedIndices = Array.from(removedValidatorsInEpoch).sort((a, b) => a - b);
|
|
700
|
+
|
|
701
|
+
log("Validator monitor status", {
|
|
702
|
+
epoch: computeEpochAtSlot(headState.slot),
|
|
703
|
+
added: addedIndices.length > 0 ? prettyPrintIndices(addedIndices) : "none",
|
|
704
|
+
removed: removedIndices.length > 0 ? prettyPrintIndices(removedIndices) : "none",
|
|
705
|
+
total: validators.size,
|
|
706
|
+
indices: prettyPrintIndices(allIndices),
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
// Clear tracking sets for next epoch
|
|
710
|
+
addedValidatorsInEpoch.clear();
|
|
711
|
+
removedValidatorsInEpoch.clear();
|
|
712
|
+
|
|
681
713
|
// Compute summaries of previous epoch attestation performance
|
|
682
714
|
const prevEpoch = computeEpochAtSlot(headState.slot) - 1;
|
|
683
715
|
|
|
@@ -736,6 +768,13 @@ export function createValidatorMonitor(
|
|
|
736
768
|
scrapeMetrics(slotClock) {
|
|
737
769
|
validatorMonitorMetrics?.validatorsConnected.set(validators.size);
|
|
738
770
|
|
|
771
|
+
// Update static metric with connected validator indices
|
|
772
|
+
if (validatorMonitorMetrics?.validatorsConnectedIndices) {
|
|
773
|
+
validatorMonitorMetrics.validatorsConnectedIndices.reset();
|
|
774
|
+
const allIndices = Array.from(validators.keys()).sort((a, b) => a - b);
|
|
775
|
+
validatorMonitorMetrics.validatorsConnectedIndices.set({indices: prettyPrintIndices(allIndices)}, 1);
|
|
776
|
+
}
|
|
777
|
+
|
|
739
778
|
const epoch = computeEpochAtSlot(slotClock);
|
|
740
779
|
const slotInEpoch = slotClock % SLOTS_PER_EPOCH;
|
|
741
780
|
|
|
@@ -815,6 +854,10 @@ export function createValidatorMonitor(
|
|
|
815
854
|
validatorMonitorMetrics?.prevEpochSyncCommitteeHits.set(prevEpochSyncCommitteeHits);
|
|
816
855
|
validatorMonitorMetrics?.prevEpochSyncCommitteeMisses.set(prevEpochSyncCommitteeMisses);
|
|
817
856
|
},
|
|
857
|
+
|
|
858
|
+
getMonitoredValidatorIndices() {
|
|
859
|
+
return Array.from(validators.keys()).sort((a, b) => a - b);
|
|
860
|
+
},
|
|
818
861
|
};
|
|
819
862
|
|
|
820
863
|
// Register a single collect() function to run all validatorMonitor metrics
|
|
@@ -1098,6 +1141,12 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator) {
|
|
|
1098
1141
|
help: "Count of validators that are specifically monitored by this beacon node",
|
|
1099
1142
|
}),
|
|
1100
1143
|
|
|
1144
|
+
validatorsConnectedIndices: register.gauge<{indices: string}>({
|
|
1145
|
+
name: "validator_monitor_indices",
|
|
1146
|
+
help: "Static metric with connected validator indices as label, value is always 1",
|
|
1147
|
+
labelNames: ["indices"],
|
|
1148
|
+
}),
|
|
1149
|
+
|
|
1101
1150
|
validatorsInSyncCommittee: register.gauge({
|
|
1102
1151
|
name: "validator_monitor_validators_in_sync_committee",
|
|
1103
1152
|
help: "Count of validators monitored by this beacon node that are part of sync committee",
|
|
@@ -9,7 +9,7 @@ import {Bucket, getBucketNameByValue} from "../buckets.js";
|
|
|
9
9
|
export class CheckpointStateRepository extends BinaryRepository<Uint8Array> {
|
|
10
10
|
constructor(config: ChainForkConfig, db: Db) {
|
|
11
11
|
const bucket = Bucket.allForks_checkpointState;
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
super(config, db, bucket, getBucketNameByValue(bucket));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -212,6 +212,31 @@ export function createLodestarMetrics(
|
|
|
212
212
|
}),
|
|
213
213
|
},
|
|
214
214
|
|
|
215
|
+
unfinalizedBlockWritesQueue: {
|
|
216
|
+
length: register.gauge({
|
|
217
|
+
name: "lodestar_unfinalized_block_writes_queue_length",
|
|
218
|
+
help: "Count of total unfinalized block writes queue length",
|
|
219
|
+
}),
|
|
220
|
+
droppedJobs: register.gauge({
|
|
221
|
+
name: "lodestar_unfinalized_block_writes_queue_dropped_jobs_total",
|
|
222
|
+
help: "Count of total unfinalized block writes queue dropped jobs",
|
|
223
|
+
}),
|
|
224
|
+
jobTime: register.histogram({
|
|
225
|
+
name: "lodestar_unfinalized_block_writes_queue_job_time_seconds",
|
|
226
|
+
help: "Time to process unfinalized block writes queue job in seconds",
|
|
227
|
+
buckets: [0.01, 0.1, 1, 4, 12],
|
|
228
|
+
}),
|
|
229
|
+
jobWaitTime: register.histogram({
|
|
230
|
+
name: "lodestar_unfinalized_block_writes_queue_job_wait_time_seconds",
|
|
231
|
+
help: "Time from job added to the unfinalized block writes queue to starting in seconds",
|
|
232
|
+
buckets: [0.01, 0.1, 1, 4, 12],
|
|
233
|
+
}),
|
|
234
|
+
concurrency: register.gauge({
|
|
235
|
+
name: "lodestar_unfinalized_block_writes_queue_concurrency",
|
|
236
|
+
help: "Current concurrency of unfinalized block writes queue",
|
|
237
|
+
}),
|
|
238
|
+
},
|
|
239
|
+
|
|
215
240
|
engineHttpProcessorQueue: {
|
|
216
241
|
length: register.gauge({
|
|
217
242
|
name: "lodestar_engine_http_processor_queue_length",
|
|
@@ -1116,6 +1141,46 @@ export function createLodestarMetrics(
|
|
|
1116
1141
|
help: "Total number of empty returns in SyncContributionAndProofPool.getAggregate(slot, root)",
|
|
1117
1142
|
}),
|
|
1118
1143
|
},
|
|
1144
|
+
payloadAttestationPool: {
|
|
1145
|
+
size: register.gauge({
|
|
1146
|
+
name: "lodestar_oppool_payload_attestation_pool_size",
|
|
1147
|
+
help: "Current size of the PayloadAttestationPool = total payload attestations unique by data and slot",
|
|
1148
|
+
}),
|
|
1149
|
+
payloadAttDataPerSlot: register.gauge({
|
|
1150
|
+
name: "lodestar_oppool_payload_attestation_pool_payload_attestation_data_per_slot_total",
|
|
1151
|
+
help: "Total number of payload attestation data per slot in PayloadAttestationPool",
|
|
1152
|
+
}),
|
|
1153
|
+
gossipInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
|
|
1154
|
+
name: "lodestar_oppool_payload_attestation_pool_gossip_insert_outcome_total",
|
|
1155
|
+
help: "Total number of InsertOutcome as a result of adding a payload attestation message from gossip to the pool",
|
|
1156
|
+
labelNames: ["insertOutcome"],
|
|
1157
|
+
}),
|
|
1158
|
+
apiInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
|
|
1159
|
+
name: "lodestar_oppool_payload_attestation_pool_api_insert_outcome_total",
|
|
1160
|
+
help: "Total number of InsertOutcome as a result of adding a payload attestation message from api to the pool",
|
|
1161
|
+
labelNames: ["insertOutcome"],
|
|
1162
|
+
}),
|
|
1163
|
+
getPayloadAttestationsCacheMisses: register.counter({
|
|
1164
|
+
name: "lodestar_oppool_payload_attestation_pool_get_payload_attestations_cache_misses_total",
|
|
1165
|
+
help: "Total number of getPayloadAttestationsForBlock calls with no aggregate for slot and payload attestation data root",
|
|
1166
|
+
}),
|
|
1167
|
+
},
|
|
1168
|
+
executionPayloadBidPool: {
|
|
1169
|
+
size: register.gauge({
|
|
1170
|
+
name: "lodestar_oppool_execution_payload_bid_pool_size",
|
|
1171
|
+
help: "Current size of the ExecutionPayloadBidPool = total number of bids",
|
|
1172
|
+
}),
|
|
1173
|
+
gossipInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
|
|
1174
|
+
name: "lodestar_oppool_execution_payload_bid_pool_gossip_insert_outcome_total",
|
|
1175
|
+
help: "Total number of InsertOutcome as a result of adding an execution payload bid from gossip to the pool",
|
|
1176
|
+
labelNames: ["insertOutcome"],
|
|
1177
|
+
}),
|
|
1178
|
+
apiInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
|
|
1179
|
+
name: "lodestar_oppool_execution_payload_bid_pool_api_insert_outcome_total",
|
|
1180
|
+
help: "Total number of InsertOutcome as a result of adding an execution payload bid from api to the pool",
|
|
1181
|
+
labelNames: ["insertOutcome"],
|
|
1182
|
+
}),
|
|
1183
|
+
},
|
|
1119
1184
|
},
|
|
1120
1185
|
|
|
1121
1186
|
chain: {
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
capella,
|
|
16
16
|
deneb,
|
|
17
17
|
fulu,
|
|
18
|
+
gloas,
|
|
18
19
|
phase0,
|
|
19
20
|
} from "@lodestar/types";
|
|
20
21
|
import {Logger} from "@lodestar/utils";
|
|
@@ -37,6 +38,9 @@ export enum GossipType {
|
|
|
37
38
|
light_client_finality_update = "light_client_finality_update",
|
|
38
39
|
light_client_optimistic_update = "light_client_optimistic_update",
|
|
39
40
|
bls_to_execution_change = "bls_to_execution_change",
|
|
41
|
+
execution_payload = "execution_payload",
|
|
42
|
+
payload_attestation_message = "payload_attestation_message",
|
|
43
|
+
execution_payload_bid = "execution_payload_bid",
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
export type SequentialGossipType = Exclude<GossipType, GossipType.beacon_attestation>;
|
|
@@ -71,6 +75,9 @@ export type GossipTopicTypeMap = {
|
|
|
71
75
|
[GossipType.light_client_finality_update]: {type: GossipType.light_client_finality_update};
|
|
72
76
|
[GossipType.light_client_optimistic_update]: {type: GossipType.light_client_optimistic_update};
|
|
73
77
|
[GossipType.bls_to_execution_change]: {type: GossipType.bls_to_execution_change};
|
|
78
|
+
[GossipType.execution_payload]: {type: GossipType.execution_payload};
|
|
79
|
+
[GossipType.payload_attestation_message]: {type: GossipType.payload_attestation_message};
|
|
80
|
+
[GossipType.execution_payload_bid]: {type: GossipType.execution_payload_bid};
|
|
74
81
|
};
|
|
75
82
|
|
|
76
83
|
export type GossipTopicMap = {
|
|
@@ -100,6 +107,9 @@ export type GossipTypeMap = {
|
|
|
100
107
|
[GossipType.light_client_finality_update]: LightClientFinalityUpdate;
|
|
101
108
|
[GossipType.light_client_optimistic_update]: LightClientOptimisticUpdate;
|
|
102
109
|
[GossipType.bls_to_execution_change]: capella.SignedBLSToExecutionChange;
|
|
110
|
+
[GossipType.execution_payload]: gloas.SignedExecutionPayloadEnvelope;
|
|
111
|
+
[GossipType.payload_attestation_message]: gloas.PayloadAttestationMessage;
|
|
112
|
+
[GossipType.execution_payload_bid]: gloas.SignedExecutionPayloadBid;
|
|
103
113
|
};
|
|
104
114
|
|
|
105
115
|
export type GossipFnByType = {
|
|
@@ -124,6 +134,13 @@ export type GossipFnByType = {
|
|
|
124
134
|
[GossipType.bls_to_execution_change]: (
|
|
125
135
|
blsToExecutionChange: capella.SignedBLSToExecutionChange
|
|
126
136
|
) => Promise<void> | void;
|
|
137
|
+
[GossipType.execution_payload]: (
|
|
138
|
+
executionPayloadEnvelope: gloas.SignedExecutionPayloadEnvelope
|
|
139
|
+
) => Promise<void> | void;
|
|
140
|
+
[GossipType.payload_attestation_message]: (
|
|
141
|
+
payloadAttestationMessage: gloas.PayloadAttestationMessage
|
|
142
|
+
) => Promise<void> | void;
|
|
143
|
+
[GossipType.execution_payload_bid]: (executionPayloadBid: gloas.SignedExecutionPayloadBid) => Promise<void> | void;
|
|
127
144
|
};
|
|
128
145
|
|
|
129
146
|
export type GossipFn = GossipFnByType[keyof GossipFnByType];
|