Validator client: support Electra, Fulu and Gloas only; drop Lean and pre-Electra fork handling

未關閉
#790 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 6 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
重構
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust
領域
backend

研究方向

Start with the listed fork handling in crates/validator, especially beacon_node/block_contents.rs, beacon_node/http.rs, and lib.rs, then inspect the boundary tests in attestation.rs and signing.rs. First decide whether Electra remains supported; the issue describes the tradeoff but leaves it open. Done means startup rejects unsupported schedules, client fork matches cover the chosen forks, and the boundary tests target the new supported range.

由索引模型根據 Issue 內容生成。

描述

The validator client (crates/validator) should support Electra, Fulu and Gloas only, and stop carrying code for ForkName::Lean and the pre-Electra forks.

Why

The client already only works from Electra on. It submits SingleAttestations to /eth/v2/beacon/pool/attestations at every fork. It also refuses pre-Electra blocks (ProducedBlock::from_ssz) and aggregates ("electra is the earliest supported"). Every network we run against (mainnet, Sepolia, Hoodi, Platåberget) is past Electra.

The code still handles the earlier forks anyway, and Lean shows up only because ForkName is shared with the lean chain in ethlambda-types. Config::fork_at_epoch never returns Lean. Each of these branches guards a state that can't occur, but a reviewer still has to reason about it. The review of #789 spent several comments on this: whether the Lean arm's error is retryable, and whether committee 0 is right before Electra.

Line numbers below are as of 9be2506c:

  • Arms that exist only to fail. Phase0 | Altair | Bellatrix | Capella | Deneb | Lean arms appear in beacon_node/block_contents.rs:316 and beacon_node/http.rs:881. #789 adds highest_attestation_index with a pre-Electra arm and a Lean arm, which returns a retryable InconsistentResponse after the request was already made.
  • Pre-Gloas attestation data is requested under the slot's own fork, as far back as Phase0. a_pre_gloas_slot_is_asked_about_under_its_own_fork asserts ForkName::Phase0. attestation_data_path sends committee_index=0 before Gloas, and every validator signs that same data. That would also be wrong before Electra, where data.index must be the attester's own committee.
  • The sync committee subscription gate checks < ForkName::Altair (lib.rs:817).
  • Tests pinned to the Phase0/Altair boundary: attestation.rs:769-818 (the Eth-Consensus-Version header test) and the boundary tests in signing.rs (around lines 461, 621 and 703).

Proposal

  1. Refuse to start before Electra. If the beacon node's schedule (from /eth/v1/config/spec) puts the current epoch before Electra, stop at startup with one clear error.
  2. Give the client its own fork type, e.g. enum ValidatorFork { Electra, Fulu, Gloas } with TryFrom<ForkName>. Convert once, where fork_at_epoch is called, so every match in the client has three arms and no Lean or pre-Electra ones. A fork added after Gloas still breaks every match until someone decides what it means.
  3. Remove the pre-Electra branches: the < Altair sync gate, the pre-Electra and Lean arms in block and aggregate decoding and in highest_attestation_index, and comments that describe pre-Electra semantics (e.g. the index as a committee).
  4. Move the boundary tests from Phase0/Altair to the Electra/Fulu or Fulu/Gloas boundary, so they still check that headers and domains follow the right epoch.

Consider dropping Electra too

Every network the client targets is already past Fulu:

  • mainnet: Fulu at epoch 411392, December 2025
  • Sepolia: epoch 272640
  • Hoodi: epoch 50688
  • Platåberget and the kurtosis battery (tooling/kurtosis-assertoor/network_params.yaml): Fulu from genesis

Supporting only Fulu and Gloas would remove the code that exists for Electra alone. That mainly means the per-blob-proof block contents (ProducedBlock::from_ssz's Electra arm and Contents::WithBlobProofs, which Fulu's cell proofs replaced) and whatever publishes them. It would also move the many tests that use Electra as their default fork over to Fulu. The startup check in step 1 would then refuse anything before Fulu, and the client's fork type would have two variants.

The cost is losing any network that is still on Electra, such as a local devnet configured with Electra at genesis and a later Fulu epoch. Worth deciding before step 2, since it changes the enum.

Out of scope

  • config_from_spec_response keeps parsing the whole fork schedule. Fork versions and epochs are configuration, not fork handling.
  • The altair:: sync committee containers stay. They are the containers in use today, not pre-Electra support.
主要語言
Rust
星號
86
分支
34
平均合併
9 天 20 小時
30 天內合併 PR
77

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

lambdaclass/ethlambda 的其他 Issue

查看 lambdaclass/ethlambda 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。