Replace global trickle node with random delays #7125

pull sipa wants to merge 1 commits into bitcoin:master from sipa:timetrickle changing 5 files +47 −36
  1. sipa commented at 2:56 pm on November 28, 2015: member

    This is based upon and partially replaces #5989, and rebased on top of #7100.

    We used to have a trickle node, a node which was chosen in each iteration of the send loop that was privileged and allowed to send out queued up non-time critical messages. Since the removal of the fixed sleeps in the network code, this resulted in fast and attackable (see #7123) treatment of such broadcasts.

    This pull request changes each of these trickle-dependant mechanisms with a per-node and per-feature random delay timer, improving privacy and performance by making queueing useful again.

    The commits are mostly squashed/rebased versions taken from #5989 by @pstratem, except:

    • No randomization of tx invs (more code changes, and may not interact well with transactions that need to be sent after their dependencies).
    • No removal of the “1/4 blast to all” behaviour, as #7123 proposes an alternative.
    • No removal of the “announce yourself to outbound peers” behaviour.
  2. sipa force-pushed on Nov 28, 2015
  3. sipa force-pushed on Nov 28, 2015
  4. sipa force-pushed on Nov 28, 2015
  5. sipa force-pushed on Nov 29, 2015
  6. sipa commented at 12:21 pm on November 29, 2015: member
    Rebased on top of #7125, and make blocks not use the vInventoryToSend system anymore (making it safer to make it filter like #7100).
  7. sipa force-pushed on Nov 29, 2015
  8. sipa force-pushed on Nov 30, 2015
  9. sipa commented at 12:37 pm on November 30, 2015: member
    Rebased on top of #7133.
  10. sipa force-pushed on Nov 30, 2015
  11. laanwj added the label P2P on Dec 1, 2015
  12. gmaxwell commented at 0:25 am on December 5, 2015: contributor
    Could use some rebasing love, as the bloomy stuff was merged.
  13. sipa force-pushed on Dec 5, 2015
  14. sipa commented at 6:25 am on December 5, 2015: member
    Rebased.
  15. laanwj added the label Needs backport on Dec 9, 2015
  16. laanwj added this to the milestone 0.12.0 on Dec 9, 2015
  17. laanwj commented at 8:02 am on December 9, 2015: member

    Some nodes connect to to as many peers as possible and flood them with pings, apparently to trigger the issue where pings interfere with trickle delays. So this is being actively exploited.

    Added 0.12 milestone.

  18. gmaxwell commented at 11:00 am on December 10, 2015: contributor
    I am currently testing this on top of 0.12.
  19. morcos commented at 4:27 pm on December 10, 2015: member
    utACK
  20. in src/main.cpp: in 33a0ec2c6b outdated
    5390         //
    5391-        if (fSendTrickle)
    5392-        {
    5393+
    5394+        if (pto->nNextLocalAddrSend < nNow) {
    5395+            AdvertizeLocal(pto);
    


    sdaftuar commented at 4:11 pm on December 11, 2015:
    Should we be guarding this with a !IsInitialBlockDownload() as before?
  21. sipa force-pushed on Dec 11, 2015
  22. sipa commented at 9:13 pm on December 11, 2015: member
    Addressed @sdaftuar’s comment, rebased, and switched to Poisson-distributed sends, so nobody can ever make a guess about when the next send will happen.
  23. Replace trickle nodes with per-node/message Poisson delays
    We used to have a trickle node, a node which was chosen in each iteration of
    the send loop that was privileged and allowed to send out queued up non-time
    critical messages. Since the removal of the fixed sleeps in the network code,
    this resulted in fast and attackable treatment of such broadcasts.
    
    This pull request changes the 3 remaining trickle use cases by random delays:
    * Local address broadcast (while also removing the the wiping of the seen filter)
    * Address relay
    * Inv relay (for transactions; blocks are always relayed immediately)
    
    The code is based on older commits by Patrick Strateman.
    5400ef6bcb
  24. sipa force-pushed on Dec 11, 2015
  25. gmaxwell commented at 12:22 pm on December 14, 2015: contributor
    ACK
  26. laanwj merged this on Dec 14, 2015
  27. laanwj closed this on Dec 14, 2015

  28. laanwj referenced this in commit 7a5040155e on Dec 14, 2015
  29. sipa referenced this in commit 10b88be798 on Dec 14, 2015
  30. laanwj removed the label Needs backport on Feb 4, 2016
  31. laanwj commented at 8:07 am on February 4, 2016: member
    This is cherry-picked to 0.12 as 10b88be79856ee7ee66f69705c16b335941e396e
  32. dgenr8 commented at 0:06 am on March 17, 2018: contributor
    Where was the discussion of the choice of 5 seconds as the mean delay between inventory broadcasts? This was 7-10x the median transaction propagation time of the entire network at that time.
  33. random-zebra referenced this in commit 8bbc0650e6 on Jul 1, 2020
  34. laanwj referenced this in commit 1a9fa4c5ba on Dec 7, 2020
  35. sidhujag referenced this in commit bf48f3125c on Dec 7, 2020
  36. zkbot referenced this in commit 65dff184f6 on Aug 4, 2021
  37. zkbot referenced this in commit 6f38962577 on Aug 5, 2021
  38. zkbot referenced this in commit 1aa59fd4ac on Aug 5, 2021
  39. zkbot referenced this in commit 8c3d670c8a on Aug 9, 2021
  40. zkbot referenced this in commit 1dc1ababa9 on Aug 9, 2021
  41. zkbot referenced this in commit 18fe0a377b on Aug 9, 2021
  42. zkbot referenced this in commit 1cb1ed2653 on Aug 10, 2021
  43. DrahtBot locked this on Feb 15, 2022

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-17 18:12 UTC

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