Beacon events report `execution_optimistic: false` for every gloas head and block

Aperta
#844 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with crates/net/rpc/src/shared/optimistic.rs to understand block_is_optimistic and envelope_is_optimistic, then inspect the event call sites in crates/blockchain/src/events.rs and the storage maps they read. Check how the helper can live in a crate shared by RPC and blockchain. Done means a gloas head whose parent payload is recorded as Syncing emits head and head_v2 with execution_optimistic: true, while pre-gloas behavior stays unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem. The head, head_v2, block and finalized_checkpoint events take execution_optimistic from Store::is_beacon_optimistic, i.e. the store's optimistic_roots set:

  • crates/blockchain/src/events.rs:806 (block);
  • events.rs:1162 (head, head_v2, chain_reorg);
  • events.rs:1249 (the second head_v2);
  • events.rs:1313 (finalized_checkpoint).

Only pre-gloas blocks ever enter that set. beacon_engine::new_payload_request returns None for a gloas block (crates/blockchain/src/beacon_engine.rs:134), so its import is PayloadValidity::NotRequired, and fork_choice::on_block adds a root only on Optimistic (crates/blockchain/state_transition/src/beacon/fork_choice.rs:5198-5203). From gloas on, every one of these events therefore reports execution_optimistic: false, even when the chain rests on a payload the execution client answered SYNCING. A consumer that holds off on optimistic heads (lighthouse suppresses those head events) is told the head is validated when it is not.

The Beacon API responses already get this right. crates/net/rpc/src/shared/optimistic.rs has block_is_optimistic (line 113), which walks back to the latest FULL payload a block builds on and reads its recorded verdict, and envelope_is_optimistic (line 100). docs/rpc.md ("execution_optimistic under gloas") describes the rule.

Why not in lambdaclass/ethlambda#748. That PR fixed the one event it added whose verdict is in hand, execution_payload, by passing the import's own verdict in. The other topics predate it on main (head_v2 inherits head's value), and the fix needs the walk in shared/optimistic.rs, which lives in ethlambda-rpc, a crate ethlambda-blockchain cannot depend on.

Fix. Move payload_link, payload_is_not_valid, block_is_optimistic and envelope_is_optimistic down to a crate both can use (ethlambda-storage, next to the maps they read, or ethlambda-state-transition), and have the events call block_is_optimistic where they now call is_beacon_optimistic. Pre-gloas results are unchanged, since the walk reads the optimistic set for a pre-gloas block. A test: a gloas head whose parent payload is recorded Syncing emits head/head_v2 with execution_optimistic: true.

Lingua principale
Rust
Stelle
86
Fork
34
Merge medio
9g 20h
PR unite (30g)
77

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lambdaclass/ethlambda

Tutte le issue di lambdaclass/ethlambda

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.