Open
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
- PoC Tree sync WIP dapplion/lighthouse#46
- Add
headers_by_root
p2p spec
Related resources
- Early exploration on modifying the spec to address one of the issues above Add BlocksBy* protocols with specific block_root #7096