Addrman offline attempts #8065

pull gmaxwell wants to merge 2 commits into bitcoin:master from gmaxwell:addrman_offline_attempts changing 5 files +31 −17
  1. gmaxwell commented at 7:26 AM on May 17, 2016: contributor

    If a node is offline failed outbound connection attempts will crank up the addrman counter and effectively blow away our state.

    This change reduces the problem by only counting attempts made while the node believes it has outbound connections to at least two netgroups.

    Connect and addnode connections are also not counted, as there is no reason to unequally penalize them for their more frequent connections -- though there should be no real effect from this unless their addnode configureation is later removed.

    Wasteful repeated connection attempts while only a few connections are up are avoided via nLastTry.

    This is still somewhat incomplete protection because our outbound peers could be down but not timed out or might all be on 'local' networks (although the requirement for multiple netgroups helps).

    ( reopen of #6030 )

  2. gmaxwell cross-referenced this on May 17, 2016 from issue Avoid counting failed connect attempts when probably offline. by gmaxwell
  3. jonasschnelli added the label P2P on May 17, 2016
  4. pstratem commented at 10:07 PM on May 17, 2016: contributor

    This should probably be checking for connections to at least two netgroups outside of RFC1918 IP space, but this is certainly an improvement.

  5. gmaxwell commented at 9:17 AM on May 18, 2016: contributor

    @pstratem checking connections is better than no check at all. This PR is from April 2015, so I'm not inclined to expand the scope any further right now. If this is accepted I'll happily open a follow on PR to make it stronger.

  6. arowser commented at 8:43 AM on May 25, 2016: contributor

    Can one of the admins verify this patch?

  7. sipa commented at 5:23 PM on May 25, 2016: member

    Needs rebase.

  8. sipa commented at 12:32 PM on May 26, 2016: member

    Did you accidentally include #7992?

  9. sipa commented at 12:35 PM on May 26, 2016: member

    utACK 66cefd47194a8aa7478dbea9a1b96640febeeda7

  10. Avoid counting failed connect attempts when probably offline.
    If a node is offline failed outbound connection attempts will crank up
     the addrman counter and effectively blow away our state.
    
    This change reduces the problem by only counting attempts made while
     the node believes it has outbound connections to at least two
     netgroups.
    
    Connect and addnode connections are also not counted, as there is no
     reason to unequally penalize them for their more frequent
     connections -- though there should be no real effect from this
     unless their addnode configureation is later removed.
    
    Wasteful repeated connection attempts while only a few connections are
     up are avoided via nLastTry.
    
    This is still somewhat incomplete protection because our outbound
     peers could be down but not timed out or might all be on 'local'
     networks (although the requirement for multiple netgroups helps).
    c769c4af11
  11. Do not increment nAttempts by more than one for every Good connection.
    This slows the increase of the nAttempts in addrman while partitioned,
     even if the node hasn't yet noticed the partitioning.
    6182d10503
  12. sipa commented at 10:27 PM on May 26, 2016: member

    Running a public node with #7960 #8007 #8065 #8080 #8082 #8084 #8086 for testing.

  13. sipa commented at 2:52 PM on June 7, 2016: member

    This should be easy to test manually: add a debug log entry above the info.nAttempts increment in CAddrMan::Attempt_(), and see how often it triggers with network connected and disconnected.

  14. laanwj commented at 10:58 AM on June 8, 2016: member

    utACK 6182d10

  15. laanwj merged this on Jun 8, 2016
  16. laanwj closed this on Jun 8, 2016

  17. laanwj referenced this in commit 67c91f8c4c on Jun 8, 2016
  18. sickpig referenced this in commit 7bb7ee7b1e on Apr 14, 2017
  19. sickpig referenced this in commit e35c03a72f on Apr 14, 2017
  20. sickpig referenced this in commit acc6b17a1a on Apr 14, 2017
  21. sickpig referenced this in commit 45bef70677 on Apr 14, 2017
  22. sickpig referenced this in commit 77a5dbc995 on Apr 14, 2017
  23. sickpig referenced this in commit 91b33b058c on Apr 14, 2017
  24. sickpig cross-referenced this on Apr 14, 2017 from issue [port] PR #8065 Addrman offline attempts by sickpig
  25. sickpig cross-referenced this on Apr 14, 2017 from issue [port] PR #8282 net: Feeler connections to increase online addrs in the tried table by sickpig
  26. dgenr8 cross-referenced this on May 18, 2017 from issue Networking improvements by dgenr8
  27. codablock referenced this in commit d8211d2538 on Sep 16, 2017
  28. codablock referenced this in commit ce90bf9e00 on Sep 19, 2017
  29. codablock referenced this in commit 00c84ca53e on Dec 22, 2017
  30. andvgal referenced this in commit 123e32fe1a on Jan 6, 2019
  31. Fuzzbawls cross-referenced this on Mar 4, 2020 from issue Tracking: Backport upstream network encapsulation by Fuzzbawls
  32. Fuzzbawls cross-referenced this on Mar 24, 2020 from issue [Net] Addrman offline attempts by Fuzzbawls
  33. furszy referenced this in commit 195d46690c on Mar 27, 2020
  34. akshaynexus referenced this in commit 23f7fe49b0 on Mar 30, 2020
  35. wqking referenced this in commit 69fa150dcb on Aug 24, 2020
  36. PRCYDev cross-referenced this on Jan 25, 2021 from issue Tracking: Backport upstream network encapsulation by PRCYDev
  37. nuttycom cross-referenced this on Feb 23, 2021 from issue Verify that expected services are available from peer nodes & disconnect otherwise. by nuttycom
  38. bitcoin 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: 2026-05-20 06:55 UTC