Beacon API: cap the slot a beacon_committee_subscriptions entry joins a subnet until

Ouverte
#814 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 6 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
rust

Piste de recherche

Start with post_committee_subscriptions in crates/net/rpc/src/beacon/validator.rs and compare its slot handling with post_sync_committee_subscriptions in crates/net/rpc/src/beacon/sync_committee.rs. Read the referenced sync clamp test, then check the aggregator subnet join and expiry paths in crates/net/p2p/src/gossipsub/handler.rs. Done means future slots are capped or rejected at the stated epoch bound, the behavior is tested, and the outdated clause is removed from docs/rpc.md.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Problem. POST /eth/v1/validator/beacon_committee_subscriptions lets the caller choose how long the node stays on an attestation subnet, with no upper bound.

  • post_committee_subscriptions (crates/net/rpc/src/beacon/validator.rs:307-331) passes each aggregator entry's slot through as sent.
  • join_aggregator_subnets (crates/net/p2p/src/gossipsub/handler.rs:1156-1186) keeps the largest slot it has seen for a subnet.
  • leave_expired_aggregator_subnets (handler.rs:1251-1264) leaves the subnet only once that slot has passed.

So one request with is_aggregator: true and a far-future slot keeps the node subscribed until restart. That costs it bandwidth and gossip validation on that subnet. With 64 entries, one per subnet, it holds every attestation subnet. The sync committee endpoint does not have this gap: post_sync_committee_subscriptions clamps until_epoch to the end of the next sync committee period (crates/net/rpc/src/beacon/sync_committee.rs:320-338).

Why it is out of scope. lambdaclass/ethlambda#778 is docs-only. It documents the gap in docs/rpc.md's "What the servers trust" ("an attestation subnet's is not capped") and does not change it.

Fix. Clamp, or refuse with a 400, any slot past the last slot of the furthest epoch attester duties are served for. That epoch is epoch_upper_bound, the wall-clock or head epoch plus one (validator.rs:422-425, enforced by attester_duties at validator.rs:688). A validator client cannot hold a legitimate duty beyond it.

  • Model the change and its test on the sync clamp (subscriptions_group_by_subnet_keep_the_latest_epoch_and_clamp_it, sync_committee.rs:872).
  • Then drop the "not capped" clause from docs/rpc.md.
Langage dominant
Rust
Étoiles
86
Forks
34
Merge moyen
9 j 20 h
PR mergées (30 j)
77

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de lambdaclass/ethlambda

Toutes les issues de lambdaclass/ethlambda

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.