Skip to content

[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.#7123
gmaxwell wants to merge 1 commit intobitcoin:masterfrom
gmaxwell:actually_trickle

Conversation

@gmaxwell
Copy link
Contributor

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.

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.
@sipa
Copy link
Member

sipa commented Nov 28, 2015 via email

@gmaxwell
Copy link
Contributor Author

Oh man, seem I am recently piece at a time redoing @pstratem 's prior work!

@sipa
Copy link
Member

sipa commented Nov 28, 2015

See #7125.

@gmaxwell
Copy link
Contributor Author

Will open a new version of this after #7125 is merged.

@gmaxwell gmaxwell closed this Nov 29, 2015
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants