syncer: Only relay peer's tip after syncing#409
Open
lukechampine wants to merge 1 commit intomasterfrom
Open
Conversation
Member
|
@claude review |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates syncer behavior to reduce noisy “unknown parent” header announcements by relaying a peer’s v2 header only once they’ve fully synced, which should lower pointless relays (and associated warnings) in instant-synced scenarios.
Changes:
- Move
relayV2Headerso it only runs after a successful sync whenremaining == 0(peer fully sent headers). - Update the inline comment to reflect the new “relay tip after syncing” behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
85fb736 to
578b70c
Compare
578b70c to
6261921
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should reduce the frequency of "peer relayed a v2 header with unknown parent" log messages, particularly in instant-synced node.
Imagine we're running a node that is instant-synced to block 500,000. A new peer joins the network, starts syncing from 0, and connects to us. Currently, after every batch of 10,000 blocks, this new peer will relay a header to us. But since we instant-synced, we don't recognize any header below 500,000, so we'll end up getting 50 "unknown parent" warnings. This PR changes the behavior so that only the final (tip) header is relayed. So, fewer pointless relays, and the one that does get relayed will almost certainly be known to us (since it's some other peer's tip) or will directly attach to our tip (yay).
It's possible that this was the root cause of the high ingress some nodes were seeing, but I wouldn't bet on it. If the high ingress continues, we should ask those nodes to run with extra debug logging (or try to reproduce it on our own nodes) in order to better triangulate the issue.