Skip to content

peer: Randomize inv batching delays#3363

Merged
davecgh merged 1 commit intodecred:masterfrom
jrick:invjitter
Jun 12, 2024
Merged

peer: Randomize inv batching delays#3363
davecgh merged 1 commit intodecred:masterfrom
jrick:invjitter

Conversation

@jrick
Copy link
Member

@jrick jrick commented Jun 11, 2024

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.

@jrick jrick force-pushed the invjitter branch 2 times, most recently from 5a60ab9 to 53f96d8 Compare June 11, 2024 21:12
@davecgh davecgh added this to the 2.0.3 milestone Jun 11, 2024
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

The overall change is a good idea.

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

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.
@davecgh davecgh merged commit 55596c2 into decred:master Jun 12, 2024
@jrick jrick deleted the invjitter branch June 12, 2024 22:41
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.

2 participants