Skip to content

Backfill sync with beacon_blocks_by_head#82

Open
dapplion wants to merge 3 commits into
lookup-ancestor-blocksfrom
backfill-by-head-clean
Open

Backfill sync with beacon_blocks_by_head#82
dapplion wants to merge 3 commits into
lookup-ancestor-blocksfrom
backfill-by-head-clean

Conversation

@dapplion

Copy link
Copy Markdown
Owner

Reworks backfill to walk the parent chain with beacon_blocks_by_head instead of epoch-ranged blocks_by_range.

The store anchor (oldest_block_parent) is the cursor: fetch a run of ancestors from it, fetch their data columns by root, verify and import, advance the anchor, repeat — one segment in flight at a time, no batch buffer or epoch bookkeeping.

Everything is pinned to the trusted checkpoint anchor (block roots chain back to it; proposer signatures and KZG proofs are verified before import), so it's fully deterministic and infallible: a bad peer or bad data is penalized and refetched, and there's no terminal failed state.

Gloas envelope-by-root backfill is deferred. Stacked on #81.

dapplion added 3 commits June 11, 2026 23:02
Replace the buffered epoch-batch backfill engine with a linear pipeline
that walks the parent chain of the store anchor using beacon_blocks_by_head:
fetch a run of ancestors, fetch their custody data columns by root, couple
into RangeSyncBlock, process, and advance the anchor.

- api_types: add SyncRequestId::BackfillBlocksByHead; make CustodyRequester
  an enum (SingleLookup / Backfill) with BackfillCustodyId.
- network_context: backfill-origin blocks_by_head + custody-by-root requests.
- manager/router: route backfill by_head and custody responses to backfill.
- backfill_sync: linear Idle -> FetchingAncestors -> FetchingData -> Processing
  state machine; store AnchorInfo is the cursor.

Gloas envelope backfill is deferred.
…alties

- Reuse a single SyncRequestId::BlocksByHead carrying a BlocksByHeadRequester
  enum (Lookup/Backfill) and one blocks_by_head_requests map, instead of a
  separate backfill request id and map. Delete the now-unused
  RangeRequestId::BackfillSync.
- Make backfill infallible: drop BackFillError/fail_sync and the Failed/restart
  machinery. On bad peers or data it penalizes and re-requests, or pauses; the
  store anchor lets it resume from scratch at any point.
- Penalize exactly the peers that served a faulty segment (block peer plus the
  custody-column peers carried on the in-flight step) instead of an accumulated
  participating_peers set.
Gloas data lives in the execution payload envelope, which we do not
backfill. Couple Gloas blocks via RangeSyncBlock::new_gloas(block, None)
and skip the custody-by-root fetch for them, instead of pausing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant