Skip to content

Conversation

@ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Sep 17, 2025

A follow-up to #3848, completing #3844.

This PR enhances the PeerResponse messages with optional peer heights, which are then used to filter out candidate peers which are lower than equal to our node in terms of their current block height.

Edit: the most recent iteration adds a last_height_seen field to the CandidatePeer, and updates it whenever we receive a PeerResponse; we later use it in order to make sure that at least half of the peers we attempt to connect to (in case we have too few of them) are at a greater height than us.

Closes #3844
CC #3580

@ljedrz ljedrz requested a review from vicsn September 17, 2025 09:47
@vicsn vicsn requested a review from kaimast September 17, 2025 14:40
vicsn
vicsn previously approved these changes Sep 22, 2025
Copy link
Collaborator

@vicsn vicsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Looking forward to the other reviews, after which we can start testing to observe sparsely connected client connectivity

@ljedrz ljedrz force-pushed the feat/harden_peer_response_picks branch from 176dab7 to b0936b4 Compare October 2, 2025 14:31
@ljedrz
Copy link
Collaborator Author

ljedrz commented Oct 2, 2025

Rebased.

@vicsn If possible, I'd prefer #3905 to be merged first, as this PR will be a lot easier to rebase.

@ljedrz ljedrz requested review from kaimast and vicsn October 7, 2025 09:08
Copy link
Collaborator

@vicsn vicsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vicsn vicsn merged commit afef566 into ProvableHQ:staging Oct 7, 2025
5 checks passed
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.

[Feature] Sort peers by height

4 participants