Skip to content

sync: filter peers with head_slot=0 in selectPeer #911

@zclawz

Description

@zclawz

Context

From PR #909 review (ch4r10t33r, item #2).

Peers that report 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.

Proposal

Add an optional min_slot parameter to selectPeer() that filters out peers whose last-known head_slot is below the threshold.

Acceptance criteria

  • selectPeer accepts an optional minimum slot
  • Peers with head_slot < min_slot excluded from candidate set
  • Falls back to full set if no peer meets threshold
  • Existing callers unchanged

Related: PR #909

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions