Bound how far Beacon API requests can advance a state before validating them

オープン
#701 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

Read the implementations and related PRs #663, #671, and #646 for the attester and proposer duties, sync duties, and block publication paths. Trace where each path calls process_slots and how it determines the head, then inspect the relevant tests. Done means each path rejects requests that would advance too far when the head lags, while preserving the stated late or missing boundary block cases.

索引モデルが issue の本文から書いたものです。

説明

Several Beacon API paths advance a stored state with process_slots to answer a request, bounded only by the wall clock, not by the head. With the head lagging the clock (syncing, stalled, or behind after downtime) — or with an attacker choosing an old parent — one request can run hundreds of epoch transitions (~0.7–0.9 s each on mainnet, per #632/#633) on a blocking thread. The cache doesn't save it: its key includes the head root, which moves while syncing.

The existing 503 while-syncing guards don't cover this: SyncStatusController reports synced during a beacon catch-up (#636, "still open" #1).

Path PR Advance Status
POST /eth/v1/validator/duties/attester/{epoch}, GET /eth/v{1,2}/validator/duties/proposer/{epoch} #663 head → wall_epoch + 1 merged without a cap ("fix in another PR")
POST /eth/v1/validator/duties/sync/{epoch} #671 head → first epoch of clock_period (a period is 256 epochs) approved, cap requested
POST /eth/v2/beacon/blocks #646 any known parent → block slot, before the signature check cap requested

Proposal

  • Duties (#663): 503 when epoch > head_epoch + 2.
  • Sync duties (#671): only advance when first_epoch(requested_period - 1) <= head_epoch + 1, else 503. This also avoids answering a committee the chain may not produce: sync duties carry no dependent_root, so a VC can't detect a wrong answer.
  • Block publication (#646): 400 when the parent is below the finalized checkpoint or more than a couple of epochs behind the block's slot.

Each keeps the honest case these PRs were written for (a late or missing boundary block) and refuses the expensive, speculative ones. A test per path with the head several epochs behind the clock should assert the refusal.

主要言語
Rust
スター
86
フォーク
34
平均マージ
9日 20時間
マージ済み PR(30日)
77

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lambdaclass/ethlambda のほかの issue

lambdaclass/ethlambda の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。