Skip to content

syncer: Only relay peer's tip after syncing#409

Open
lukechampine wants to merge 1 commit intomasterfrom
sync-relay
Open

syncer: Only relay peer's tip after syncing#409
lukechampine wants to merge 1 commit intomasterfrom
sync-relay

Conversation

@lukechampine
Copy link
Member

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.

Copilot AI review requested due to automatic review settings March 13, 2026 16:57
@github-project-automation github-project-automation bot moved this to In Progress in Sia Mar 13, 2026
@n8mgr
Copy link
Member

n8mgr commented Mar 13, 2026

@claude review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 relayV2Header so it only runs after a successful sync when remaining == 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.

Copy link
Member

@ChrisSchinnerl ChrisSchinnerl left a comment

Choose a reason for hiding this comment

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

I got nothing to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants