peer: Randomize inv batching delays#3363
Merged
davecgh merged 1 commit intodecred:masterfrom Jun 12, 2024
Merged
Conversation
5a60ab9 to
53f96d8
Compare
davecgh
reviewed
Jun 12, 2024
Member
davecgh
left a comment
There was a problem hiding this comment.
The overall change is a good idea.
davecgh
reviewed
Jun 12, 2024
davecgh
approved these changes
Jun 12, 2024
Member
davecgh
left a comment
There was a problem hiding this comment.
Updates look good. They took care of the allocations and panics outside of init.
This changes the inventory batching delay from a static 500ms ticker to a random delay uniformly distributed between 100-500ms. The intention is to improve privacy while simultaneously increasing the network propagation speed of inventoried messages (including transactions, blocks, and mixing messages) and continuing to keep inventory batching useful and occurring when many messages are inventoried in the same short duration. As this change rolls out to more nodes on the network, this will cause not only more random jitter into the sending and timing of messages, but also change the message paths. Currently, with every peer using a 500ms ticker, if no changes occur to the graph of connected nodes, messages will always propagate the nodes in the same order. However, if all nodes are randomizing their inventory batching delays, the next peer who will relay a message first during the next hop will always be different.
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 changes the inventory batching delay from a static 500ms ticker to a random delay uniformly distributed between 100-500ms. The intention is to improve privacy while simultaneously increasing the network propagation speed of inventoried messages (including transactions, blocks, and mixing messages) and continuing to keep inventory batching useful and occurring when many messages are inventoried in the same short duration.
As this change rolls out to more nodes on the network, this will cause not only more random jitter into the sending and timing of messages, but also change the message paths. Currently, with every peer using a 500ms ticker, if no changes occur to the graph of connected nodes, messages will always propagate the nodes in the same order. However, if all nodes are randomizing their inventory batching delays, the next peer who will relay a message first during the next hop will always be different.