validator: support distributed validators (beacon_committee_selections and sync_committee_selections)
Les mainteneurs répondent en général sous 6 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- rust
- Domaine
- backend-api-design
Piste de recherche
Start with crates/validator/src/aggregation_selection.rs, subscriptions.rs, aggregation.rs, signing.rs, and sync_committee.rs, then inspect the validator CLI in bin/ethlambda/src/validator.rs. Trace how selection proofs are cached and used for attester and sync duties, and check the Beacon API selection endpoints described in the issue. Done means distributed mode is opt-in, uses middleware-returned proofs for both duty types, handles middleware failures as specified, and passes the listed tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
The validator client cannot run behind distributed validator middleware such as Obol Charon. Behind it, each validator client holds one share of a validator's key. It decides on its own whether the validator aggregates, from a selection proof signed with that share alone, and the answer is wrong.
Code references are at main @ 5d8628e9.
How a distributed validator works
The validator's key is split into shares across several operators. Each operator runs a normal validator client loaded with its share, pointed at the middleware, which sits in front of a beacon node and speaks the Beacon API to the client. The middleware combines a threshold of partial signatures into one signature under the validator's key.
That works for attestations and blocks with no change to the client: it signs with its share and the middleware does the rest. It does not work for aggregation. Whether a validator aggregates is decided by hashing its selection proof (the slot signed under the selection domain). A partial signature hashes to a different value than the combined one, so each client reaches its own, wrong, verdict.
The Beacon API has two endpoints for this. They are "implemented by a distributed validator middleware client", and "consensus clients need not support this endpoint and may return a 501" (ethereum/beacon-APIs @ 6bc8c7bd, apis/validator/beacon_committee_selections.yaml:4-11, apis/validator/sync_committee_selections.yaml:4-12).
POST /eth/v1/validator/beacon_committee_selectionstakes{validator_index, slot, selection_proof}with the partial proof and returns the combined one. Clients "must query this endpoint at the start of an epoch" for every validator with attester duties.POST /eth/v1/validator/sync_committee_selectionsdoes the same for sync committee contributions, withsubcommittee_index, "at the start of each slot".
What happens today
Neither endpoint is called, and ethlambda validator has no flag for a distributed setup (bin/ethlambda/src/validator.rs:19-169). The aggregation decision is made locally in three places:
- Attestation aggregation.
selection_forsigns the slot and appliesis_aggregatorto the signature (crates/validator/src/aggregation_selection.rs:92-101, rule at:59-70).- At the start of an epoch,
subscriptions::subscribeuses it to setis_aggregatoron every committee subscription (crates/validator/src/subscriptions.rs:96-135). The beacon node decides from that flag whether to collect the committee's votes. - In each slot,
AggregationService::aggregateuses it again to decide which duties aggregate, and puts the proof in theAggregateAndProof(crates/validator/src/aggregation.rs:108-140).
- At the start of an epoch,
- The proof cache.
SigningContextremembers each selection proof by(pubkey, slot)so the subscription and the aggregation share one signature (crates/validator/src/signing.rs:87-88,sign_selection_proofat:597). - Sync committee contributions.
SyncCommitteeService::aggregatesigns a selection proof per (validator, subnet) at the contribution deadline and appliesis_sync_committee_aggregatorto it (crates/validator/src/sync_committee.rs:216-240, rule at:57).
Behind middleware, each operator's client would then:
- claim aggregator duties it does not have, and miss the ones it has, in the subscriptions;
- fetch and sign aggregates for slots where the validator was not selected, which the middleware cannot combine because the other operators decided differently;
- put a partial proof in the
AggregateAndProof, which no beacon node accepts.
The validator's attestations and blocks would still work. Its aggregation and sync contribution duties would not.
What other clients do
| Client | Flag | Where it calls the endpoints | Read at |
|---|---|---|---|
| Lighthouse | --distributed (validator_client/src/cli.rs:194-200) |
beacon_committee_selections once an epoch with every duty's partial proof, retried at the next slot if it fails (validator_client/validator_services/src/duties_service.rs:172-227, :1741-1755). sync_committee_selections in validator_services/src/sync.rs:571-580. |
unstable @ 11813cfb |
| Prysm | --distributed (cmd/validator/flags/flags.go:425-428) |
distributedSelector sends partial proofs to the middleware for attestations and sync committees (validator/client/aggregator_selector.go:202-281, :343-376). |
develop @ 0c1e3d24 |
| Teku | --Xobol-dvt-integration-enabled, hidden, off by default (teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorClientOptions.java:77-87, validator/api/.../ValidatorConfig.java:73) |
validator/client/.../DvtAttestationAggregations.java:113 and duties/synccommittee/ObolDvtSyncAggregatorSelectionProofProvider.java:86. |
master @ 62a54b96 |
| Nimbus | --distributed, "Enable usage of Obol middleware (BETA)" (beacon_chain/conf.nim:1107-1110) |
beacon_chain/validator_client/selection_proofs.nim:153-178 and :436-461. |
unstable @ 9bed158a |
| Lodestar | --distributed (packages/cli/src/cmds/validator/options.ts:442-445, wired at packages/validator/src/validator.ts:304, :343) |
packages/validator/src/services/attestationDuties.ts:212-215 and syncCommitteeDuties.ts:147-150. |
unstable @ 77088eb7 |
All five have the mode, and all five keep it off by default.
Proposal
Add an opt-in distributed mode, off by default.
- Attester aggregation.
- At the start of each epoch, after duties are fetched, sign every duty's selection proof as today, then send them in one
beacon_committee_selectionsrequest (current epoch, then next epoch, as the spec allows). - Store the combined proofs the middleware returns in the
SigningContextcache in place of the partial ones. - Compute
is_aggregatorfrom the combined proof, for the subscription and for the aggregation tick. - Put the combined proof in the
AggregateAndProof.
- At the start of each epoch, after duties are fetched, sign every duty's selection proof as today, then send them in one
- Sync contributions.
- At the start of each slot, sign the selection proofs for every sync duty and subnet and send them in one
sync_committee_selectionsrequest. - Use the combined proofs at the contribution deadline.
- At the start of each slot, sign the selection proofs for every sync duty and subnet and send them in one
- Failure. If the middleware does not answer, aggregate for nobody. The verdict from the partial proof is wrong, so falling back to it only adds bad aggregates. Retry the request at the next slot, as Lighthouse does.
- No change to the beacon node. The spec puts the endpoints on the middleware.
ethlambda beacondoes not serve them, and does not need to.
To decide
- The flag's name.
--distributedis what other clients use, andethlambda keygenalready has a--distributedflag with an unrelated meaning (naming lean keys by pubkey,bin/ethlambda/src/keygen.rs:60-63). They are different sub-commands, so they do not collide, but the shared name may confuse. - When to call. The spec asks for the start of the epoch for attester selections. Today the subscriptions are sent from a task spawned after the slot's block (
crates/validator/src/lib.rs:472-500). The middleware call would go there, ahead of the subscription it feeds. - Other assumptions to check. Whether anything else in the client assumes its key is the validator's full key. Behind middleware the client signs with a share, so any check of a signature or proof must be against the share's pubkey. The verification of remote-signer answers (
SigningContext::verified,signing.rs:188) is one place to confirm, for an operator who keeps the share in Web3Signer. - What to test against. A kurtosis devnet with Charon would show it end to end. Is there one we can run?
Tests
- A mock that answers
beacon_committee_selectionswith a proof chosen to select (or not select) the validator: the subscription'sis_aggregator, the aggregation tick and the publishedAggregateAndProofall follow the returned proof. - The same for
sync_committee_selectionsand the publishedContributionAndProof. - With the mode off, no selections request is ever made.
- A middleware error: the epoch's subscriptions go out with
is_aggregator: falseand no aggregate is attempted.
- Langage dominant
- Rust
- Étoiles
- 86
- Forks
- 34
- Merge moyen
- 9 j 20 h
- PR mergées (30 j)
- 77
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de lambdaclass/ethlambda
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
lambdaclass/ethlambda#850 ·
Les mainteneurs répondent en général sous 6 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
lambdaclass/ethlambda#777 · 1 réaction ·
Les mainteneurs répondent en général sous 6 jours
-
Run all gossip validation testsPeut-être à nouveau libre @dicethedev l’a pris il y a 9 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
lambdaclass/ethlambda#725 · 2 commentaires ·
Les mainteneurs répondent en général sous 6 jours
-
Handle malformed DB dataPeut-être à nouveau libre @dicethedev l’a pris il y a 115 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
lambdaclass/ethlambda#529 · 4 commentaires ·
Les mainteneurs répondent en général sous 6 jours
-
Document architectural choicesPeut-être à nouveau libre @dicethedev l’a pris il y a 115 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
lambdaclass/ethlambda#521 · 2 commentaires ·
Les mainteneurs répondent en général sous 6 jours
Toutes les issues de lambdaclass/ethlambda
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
bytecodealliance/wrpc#1785 ·
Les mainteneurs répondent en général sous 1 jour
-
2 advisory ignore entries no longer match anything (`quick-xml` already patched in `Cargo.lock`)Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
longbridge/nsh#2758 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
antithesishq/bombadil#473 ·
Les mainteneurs répondent en général sous 2 jours
-
bench/api.sh exec test fails with curl exit 52, and --ignore-failure still records the timingsOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
libracoder/kiri#669 ·
Les mainteneurs répondent en général sous 1 jour