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

Abierto
#814 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 6 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
86
Forks
34
Merge medio
9 d 20 h
PR fusionados (30 d)
77

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lambdaclass/ethlambda

Todos los issues de lambdaclass/ethlambda

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.