Avoid querying DNS seeds, if we have open connections. #4559

pull jgarzik wants to merge 1 commits into bitcoin:master from jgarzik:maybe-dns-seed changing 2 files +14 −1
  1. jgarzik commented at 10:44 PM on July 18, 2014: contributor

    Possibly we can fiddle with these parameters, e.g. pick "if peers < 4 after 30 seconds, query seed"

  2. jgarzik commented at 5:21 PM on July 19, 2014: contributor

    Tweaked,

    • Want "more than one" peer, to skip DNS seed query (partition)
    • 30 seconds is a long time to pause, and seems likely to trigger human impatience timeouts. Reduced to 10 seconds, then changed to 11 as a post-vacation present for Gavin
  3. in src/net.cpp:None in 9297a48432 outdated
    1226 | @@ -1227,6 +1227,18 @@ void MapPort(bool)
    1227 |  
    1228 |  void ThreadDNSAddressSeed()
    1229 |  {
    1230 | +    // goal: only query DNS seeds if address need is acute
    1231 | +    if ((addrman.size() > 0) &&
    1232 | +        (!GetBoolArg("-alwaysdnsseed", false))) {
    


    laanwj commented at 5:33 AM on July 20, 2014:

    Maybe call this option '-forcednsseed'?


    Diapolo commented at 8:48 AM on July 20, 2014:

    @laanwj Agreed, sounds better and easier to understand.

  4. laanwj commented at 5:34 AM on July 20, 2014: member

    ACK on concept, haven't tested yet.

  5. laanwj commented at 9:47 AM on July 24, 2014: member

    ACK, works great for me, every time

    2014-07-24 09:39:07 P2P peers available. Skipped DNS seeding.
    
  6. sipa commented at 10:00 AM on July 24, 2014: member

    Untested ACK; I prefer -forcednsseed as well.

  7. sipa commented at 10:01 AM on July 24, 2014: member

    Or what about -dnsseeddelay, which is 11 by default? Setting it to 0 is equal to forcing dns seeding?

  8. laanwj commented at 9:53 AM on July 25, 2014: member

    I'm not sure it is an parameter that makes much sense to customize. Usually you'll either want full control over bootstrapping (-dnsseed=0), use DNS seeds when needed after a 'sane' delay (the default), or force DNS seed usage immediately (-forcednsseed, main use case faster debugging/troubleshooting of DNS seeds code).

  9. sipa commented at 2:46 PM on July 27, 2014: member

    Fair enough.

  10. Avoid querying DNS seeds, if we have open connections.
    The goal is to increase independence and privacy.
    2e7009d67b
  11. jgarzik commented at 3:06 PM on July 29, 2014: contributor

    Updated to use -forcednsseed, and also updates the --help text.

  12. BitcoinPullTester commented at 3:21 PM on July 29, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4559_2e7009d67b862cf822a1c70e181de6af659a3096/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  13. laanwj merged this on Jul 29, 2014
  14. laanwj closed this on Jul 29, 2014

  15. laanwj referenced this in commit 4ad23d2110 on Jul 29, 2014
  16. in src/init.cpp:None in 2e7009d67b
     239 | @@ -240,7 +240,8 @@ std::string HelpMessage(HelpMessageMode mode)
     240 |      strUsage += "  -connect=<ip>          " + _("Connect only to the specified node(s)") + "\n";
     241 |      strUsage += "  -discover              " + _("Discover own IP address (default: 1 when listening and no -externalip)") + "\n";
     242 |      strUsage += "  -dns                   " + _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + _("(default: 1)") + "\n";
     243 | -    strUsage += "  -dnsseed               " + _("Find peers using DNS lookup (default: 1 unless -connect)") + "\n";
     244 | +    strUsage += "  -dnsseed               " + _("Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)") + "\n";
     245 | +    strUsage += "  -forcednsseed          " + _("Always query for peer addresses via DNS lookup (default: 0)") + "\n";
    


    Diapolo commented at 7:51 AM on July 30, 2014:

    Nit: This is now missplaced, when considering an alphabetical ordering.

  17. jgarzik deleted the branch on Aug 24, 2014
  18. 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: 2026-04-17 12:15 UTC

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