sync: make blocks_by_root peer selection slot-aware
- Dominant language
- Zig
- Stars
- 97
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
Follow-up from PR #909 review.
Hive sync test 285 exposed that `blocks_by_root` peer selection can pick a connected peer whose latest Status reports `head_slot=0`, even when the requested root is for a block at slot N>0. PR #909 tactically pins checkpoint parent walks to the peer that just served the prior status/chunk, but the broader fix should make peer selection slot-aware.
Proposed direction:
- Add a `min_slot` / requested-slot hint to blocks-by-root peer selection.
- Filter candidates whose latest known `Status.head_slot < min_slot`.
- Treat unknown status carefully (probably allowed only when no status-aware candidate exists, or after explicit policy decision).
- Mirror LeanSpec's `PeerManager.select_peer_for_request(min_slot=...)` behavior.
This should cover gossip/cached-descendant parent fetches too, not only checkpoint-sync walks.
Context: https://github.com/blockblaz/zeam/pull/909#pullrequestreview-4339494528
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with Hive sync test 285 and the blocks_by_root peer-selection path, then compare the behavior with PR #909 and LeanSpec's PeerManager.select_peer_for_request(min_slot=...). Trace both checkpoint-sync walks and gossip or cached-descendant parent fetches. Done means candidates are filtered by the requested minimum slot and unknown-status handling follows an explicit policy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- zig
- Domain
- distributed-systems, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100