Skip to content

netsync: Mark blocks as known via headers.#3704

Merged
davecgh merged 1 commit into
decred:masterfrom
davecgh:netsync_hdr_known_inv
Jun 23, 2026
Merged

netsync: Mark blocks as known via headers.#3704
davecgh merged 1 commit into
decred:masterfrom
davecgh:netsync_hdr_known_inv

Conversation

@davecgh

@davecgh davecgh commented Jun 4, 2026

Copy link
Copy Markdown
Member

Currently, the known blocks for each peer are only updated when receiving and sending inv announcements for blocks and when receiving the blocks themselves. That historically covered all relevant cases since syncing was purely done via getblocks and the resulting inv announcements.

However, block announcements are now done via header announcements instead and that path does not currently add the associated block as known inventory when it sees the header. This ultimately leads to some unnecessary extra work that gets thrown away.

This resolves that issue by updating the logic that processes announced headers to add the associated block to the known inventory accordingly.

@davecgh davecgh added this to the 2.2.0 milestone Jun 4, 2026
Currently, the known blocks for each peer are only updated when
receiving and sending inv announcements for blocks and when receiving
the blocks themselves.  That historically covered all relevant cases
since syncing was purely done via getblocks and the resulting inv
announcements.

However, block announcements are now done via header announcements
instead and that path does not currently add the associated block as
known inventory when it sees the header.  This ultimately leads to some
unnecessary extra work that gets thrown away.

This resolves that issue by updating the logic that processes announced
headers to add the associated block to the known inventory accordingly.
@davecgh davecgh force-pushed the netsync_hdr_known_inv branch from 255dc9e to 13092c3 Compare June 23, 2026 14:45
@davecgh davecgh merged commit 13092c3 into decred:master Jun 23, 2026
32 checks passed
@davecgh davecgh deleted the netsync_hdr_known_inv branch June 23, 2026 14:50
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.

3 participants