[WIP] Make trickle logic useful again, delay trickle when past upload limit.#7123
Closed
gmaxwell wants to merge 1 commit intobitcoin:masterfrom
gmaxwell:actually_trickle
Closed
[WIP] Make trickle logic useful again, delay trickle when past upload limit.#7123gmaxwell wants to merge 1 commit intobitcoin:masterfrom gmaxwell:actually_trickle
gmaxwell wants to merge 1 commit intobitcoin:masterfrom
gmaxwell:actually_trickle
Conversation
These change should improve privacy, discourage some resource wasting behavior from parties trying to attack user privacy, and provides additional node bandwidth control. When Bitcoin Core was changed to not use fixed sleeps in network message handling this mostly broke the trickle logic: Instead of picking a new random node to bypass the delay every 100ms, it now chooses a new one every time through the message processing loop which can be much faster and can be remotely triggered. As a result a vast majority of invs simply blew through without any delay. This patch drops the old 1/4 random selection logic and elects two trickle peers which will get immediate forwards. These peers are selected at random from the top four peers ordered by their ability to take unfiltered relays, being outbound, being network nodes, and highest uptime. All other peers have their INVs triggered on a shared random delay (with a mean of 1 second). The selection criteria tries to find a stable set of non-attacker controlled nodes that work and stick with them. Two are used so that even if one was the original source of the only transactions ready to send the transactions will not be guaranteed to end their journey here. It also should improve robustness to dysfunctional nodes. When the upload limit is passed, this responds by increasing the batching interval by another second. Preliminary testing suggests this significantly reduces the number of transaction getdatas the node receives. Finally, this sorts transaction INV before sending them to reduce the potential for information to leak in INV ordering.
Member
|
See also #5989.
|
Contributor
Author
|
Oh man, seem I am recently piece at a time redoing @pstratem 's prior work! |
Member
|
See #7125. |
Contributor
Author
|
Will open a new version of this after #7125 is merged. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
These change should improve privacy, discourage some resource
wasting behavior from parties trying to attack user privacy, and
provides additional node bandwidth control.
When Bitcoin Core was changed to not use fixed sleeps in network
message handling this mostly broke the trickle logic: Instead of
picking a new random node to bypass the delay every 100ms, it now
chooses a new one every time through the message processing loop
which can be much faster and can be remotely triggered.
As a result a vast majority of invs simply blew through without
any delay.
This patch drops the old 1/4 random selection logic and elects two
trickle peers which will get immediate forwards. These peers
are selected at random from the top four peers ordered by their
ability to take unfiltered relays, being outbound, being
network nodes, and highest uptime. All other peers have their
INVs triggered on a shared random delay (with a mean of 1 second).
The selection criteria tries to find a stable set of non-attacker
controlled nodes that work and stick with them.
Two are used so that even if one was the original source of the
only transactions ready to send the transactions will not
be guaranteed to end their journey here. It also should improve
robustness to dysfunctional nodes.
When the upload limit is passed, this responds by increasing the
batching interval by another second. Preliminary testing suggests
this significantly reduces the number of transaction getdatas
the node receives.
Finally, this sorts transaction INV before sending them to reduce
the potential for information to leak in INV ordering.