Skip to content

feat: add min_slot filter to selectPeer with fallback#950

Open
markolazic01 wants to merge 3 commits into
blockblaz:mainfrom
markolazic01:sync/filter-peers-head-slot-0
Open

feat: add min_slot filter to selectPeer with fallback#950
markolazic01 wants to merge 3 commits into
blockblaz:mainfrom
markolazic01:sync/filter-peers-head-slot-0

Conversation

@markolazic01
Copy link
Copy Markdown
Contributor

Motivation

Peers reporting head_slot=0 are either freshly connected (no status exchanged yet) or genuinely empty. Routing blocks_by_root requests to them wastes a round-trip and a timeout cycle.

Description

  • Add optional min_slot parameter to selectPeerExcluding that filters out peers whose last-known head_slot is below the threshold
  • Peers with no status default to head_slot=0
  • Falls back to the full candidate set if no peer meets the threshold
  • Thread the parameter through selectPeerCopy, selectPeer, and selectPeerExcluding on Network
  • Existing callers pass null to preserve current behavior

Closes #911

Related: #909

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.

sync: filter peers with head_slot=0 in selectPeer

1 participant