[WIP] Make trickle logic useful again, delay trickle when past upload limit. #7123

pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:actually_trickle changing 2 files +87 −22
  1. gmaxwell commented at 10:27 am on November 28, 2015: 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.

  2. Make trickle logic useful again, delay trickle when past upload limit.
    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.
    dc6115cd12
  3. gmaxwell added the label P2P on Nov 28, 2015
  4. gmaxwell added the label Privacy on Nov 28, 2015
  5. sipa commented at 10:53 am on November 28, 2015: member
    See also #5989.
  6. gmaxwell commented at 11:01 am on November 28, 2015: contributor
    Oh man, seem I am recently piece at a time redoing @pstratem ’s prior work!
  7. sipa commented at 3:02 pm on November 28, 2015: member
    See #7125.
  8. gmaxwell commented at 0:06 am on November 29, 2015: contributor
    Will open a new version of this after #7125 is merged.
  9. gmaxwell closed this on Nov 29, 2015

  10. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me