Skip to content

P2P [BlockRelayInvsFlow]: Track and suppress unrequired BlockInv message broadcasting. #869

Open
D-Stacks wants to merge 4 commits intokaspanet:masterfrom
D-Stacks:track_and_filter_blockinv_messages-
Open

P2P [BlockRelayInvsFlow]: Track and suppress unrequired BlockInv message broadcasting. #869
D-Stacks wants to merge 4 commits intokaspanet:masterfrom
D-Stacks:track_and_filter_blockinv_messages-

Conversation

@D-Stacks
Copy link
Collaborator

@D-Stacks D-Stacks commented Feb 8, 2026

This PR builds on #810 by adding tracking and suppression of duplicate BlockInv relays, both in respect to their processing, and in regards to the broadcasting of invs to peers that have announced them to us, while we were processing a corresponding inv.

The flow context now keeps a struct that tracks and maps hashes currently being processed by the node to the peers that announced them; we use that to skip redundant processing, and after a block, from a BlockInv, is processed, we can use this to filter out peers from the resulting broadcast, which have in the meantime announced the block to us.

Currently de-duplication of processing happens at the request-scope stage, which still costs about 200–600 µs per inv — time that could be spent awaiting for the next inv from the router. It also offers no way to suppress broadcasts to the peer-set which has, in the meantime, announced the block to us.

This change addresses both issues and (from my local measurements) reduces BlockInv relay traffic by ~30%, significantly cutting down the spam in regards to this message, and allows for general healthier dequeuing of relevant BlockInv relay messages, that are more likely to advance the node's state.

@D-Stacks D-Stacks marked this pull request as draft February 8, 2026 14:08
@D-Stacks D-Stacks marked this pull request as ready for review February 8, 2026 14:08
@D-Stacks D-Stacks changed the title P2P [RelayRelayInvsFlow]: Track and suppress unrequired BlockInv message broadcasting. P2P [BlockRelayInvsFlow]: Track and suppress unrequired BlockInv message broadcasting. Feb 8, 2026
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.

1 participant