-
Notifications
You must be signed in to change notification settings - Fork 958
Open
Labels
major-taskA significant amount of work or conceptual task.A significant amount of work or conceptual task.syncing
Description
Currently forwards sync fetches ranges of blocks by range from either head or latest finalized until reaching the target, from a set of peers with the same status messages. This approach has fundamental issues that make the sync complex and susceptible to griefing attacks. (I'll describe those later)
Proposal
Divide forward sync into two phases:
- Header backfill: construct an in-memory tree from all unknown received by peers (status, unknown attestations, etc) and backfill until reaching a known block or conflicting with finality.
- Forward sync with knowledge of what block roots to expect at each slot and perfect peer grouping.
This model allows us to address all those issues and delete a lot of code. All lookup sync, by_range routes, batching, optimistic batches, among others, are deleted.
Progress
Internal impl
PoC dapplion#46
- Add more test coverage of sync tests (agnostic of range or lookup sync) Tree-sync friendly lookup sync tests #8592
- When creating a lookup fetch its ancestor headers until one is known or conflicts with finality
- Introduce a new ReqResp route
headers_by_rootto make 1. fast and efficient - Make lookup sync downloads more efficient by buffering downloads (like range sync does)
- Make lookup sync processing efficient by processing its components in batch
- Remove the max-depth limit of lookup and sync, and trigger lookup sync when a peer's status message contains an unknown root
- Delete range sync
Spec
- Add
headers_by_rootp2p spec
Related resources
- Early exploration on modifying the spec to address one of the issues above Add BlocksBy* protocols with specific block_root #7096
jimmygchen, gitToki, eserilev and pawanjay176
Metadata
Metadata
Assignees
Labels
major-taskA significant amount of work or conceptual task.A significant amount of work or conceptual task.syncing