doc: Change documentation for =0 for non-boolean options #14100

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2018_08_nodoc changing 1 files +6 −6
  1. laanwj commented at 9:12 am on August 29, 2018: member

    PR #12713 changed the interpretation for negation of non-boolean options (e.g. -noconnect) to no longer set the option to 0, but to remove it from the options.

    I think this is better because it gets rid of the special meaning of '0'.

    However it needs to be documented. I attempt to do so in this PR. Addresses #14064.

    There might be options I missed, please help check:

    • -connect
    • -proxy
    • -onion
    • -debug
    • -debuglogfile

    Needs a manpage update.

  2. laanwj added the label Docs on Aug 29, 2018
  3. laanwj added the label Backport on Aug 29, 2018
  4. laanwj added this to the milestone 0.17.0 on Aug 29, 2018
  5. laanwj commented at 9:19 am on August 29, 2018: member

    Wait, I think I’m misunderstanding this, -connect does still check for “0” explicitly:

    0        if (connect.size() != 1 || connect[0] != "0") {
    1            connOptions.m_specified_outgoing = connect;
    2        }
    

    Is this only for backwards compatibility? I checked that at least both -noconnect and -connect=0 still work.

    Whereas -debuglogfile uses IsArgNegated:

    0g_logger->m_print_to_file = !gArgs.IsArgNegated("-debuglogfile");
    

    Tested: -nodebuglogfile works, but -debuglogfile=0 doesn’t. This is the only argument that uses IsArgNegated.

    (all in all, this change is still correct, I think)

  6. laanwj force-pushed on Aug 29, 2018
  7. DrahtBot commented at 12:09 pm on August 29, 2018: member
    • #14032 (Add p2p layer encryption with ECDH/ChaCha20Poly1305 by jonasschnelli)
    • #13676 (Explain that mempool memory is added to -dbcache during IBD by Sjors)
    • #10443 (Add fee_est tool for debugging fee estimation code by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. laanwj force-pushed on Aug 29, 2018
  9. laanwj added the label Needs backport on Aug 29, 2018
  10. laanwj removed the label Backport on Aug 29, 2018
  11. practicalswift commented at 3:20 pm on August 29, 2018: contributor
    ACK 9e7ddf97d581b5d7e04193567c60cb4e0cc19401
  12. MarcoFalke commented at 7:00 pm on August 29, 2018: member

    For all options that are not a file, the existing way of -opt=0 should not be deprecated. You don’t deprecate these here, just mention the other alternative for consistency with -nodebuglogfile, so I guess it it fine.

    utACK 9e7ddf97d581b5d7e04193567c60cb4e0cc19401

  13. MarcoFalke commented at 7:01 pm on August 29, 2018: member
    Note the related commit d5690f1ab87678278d622ea82f3fa569314a2144
  14. MarcoFalke commented at 7:03 pm on August 29, 2018: member
    Note that manpages would have to be regenerated on 0.17 after backport
  15. laanwj commented at 10:03 am on August 30, 2018: member

    Note the related commit d5690f1

    AHHHHHH okay, really, I don’t know anymore I thought I had puzzled together a consistent picture of what was the idea here but it seems to be moving in all directions at once but yes I forgot about #10085

    -noconnect works fine and I use it a lot for internal tests. It’s a little bit more consistent to not mention it explicitly in the help I guess but please don’t say that things don’t work if they do!

    I’m even confused at my own behavior there

    Edit: as for bitcoin.conf, FWIW it looks like the only way to specify “no debug log” in bitcoin.conf is by adding nodebuglogfile=1, simply nodebuglogfile doesn’t work and is ignored – would be better to throw an error that suggests the syntax to be used, it’s kindof hard to guess (done in #14105)

  16. ken2812221 commented at 7:17 pm on August 31, 2018: contributor
    So I found a funny result of -nodebuglogfile=0, it would log to file 1.
  17. DrahtBot added the label Needs rebase on Sep 4, 2018
  18. doc: Change documentation for =0 for non-boolean options
    PR #12713 changed the interpretation for negation of non-boolean options
    (e.g. -noconnect) to no longer set the option to 0, but to remove it
    from the options.
    
    I think this is better because it gets rid of the special meaning of
    '0'.
    
    However it needs to be documented. I attempt to do so in this PR.
    Addreses #14064.
    e9a78e9b3b
  19. laanwj commented at 12:18 pm on September 5, 2018: member

    So I found a funny result of -nodebuglogfile=0, it would log to file 1.

    That’s pretty cute, though I don’t think we want to document that.

    Rebased.

  20. laanwj force-pushed on Sep 5, 2018
  21. in src/init.cpp:403 in e9a78e9b3b
    399@@ -400,7 +400,7 @@ void SetupServerArgs()
    400     gArgs.AddArg("-banscore=<n>", strprintf("Threshold for disconnecting misbehaving peers (default: %u)", DEFAULT_BANSCORE_THRESHOLD), false, OptionsCategory::CONNECTION);
    401     gArgs.AddArg("-bantime=<n>", strprintf("Number of seconds to keep misbehaving peers from reconnecting (default: %u)", DEFAULT_MISBEHAVING_BANTIME), false, OptionsCategory::CONNECTION);
    402     gArgs.AddArg("-bind=<addr>", "Bind to given address and always listen on it. Use [host]:port notation for IPv6", false, OptionsCategory::CONNECTION);
    403-    gArgs.AddArg("-connect=<ip>", "Connect only to the specified node; -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode). This option can be specified multiple times to connect to multiple nodes.", false, OptionsCategory::CONNECTION);
    404+    gArgs.AddArg("-connect=<ip>", "Connect only to the specified node; -noconnect disables automatic connections (the rules for this peer are the same as for -addnode). This option can be specified multiple times to connect to multiple nodes.", false, OptionsCategory::CONNECTION);
    


    MarcoFalke commented at 12:31 pm on September 5, 2018:
    Could say -noconnect or -connect=0 to document that for this option both variants are supposed to work?

    laanwj commented at 12:38 pm on September 5, 2018:
    nah, I’d really like to encourage only the ‘proper’ syntax, there’s probably no point in deprecating connect=0 but still I think it’s good to be consistent in encouraging use of -noX for non-boolean options, not X=0.
  22. in src/init.cpp:417 in e9a78e9b3b
    413@@ -414,12 +414,12 @@ void SetupServerArgs()
    414     gArgs.AddArg("-maxsendbuffer=<n>", strprintf("Maximum per-connection send buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXSENDBUFFER), false, OptionsCategory::CONNECTION);
    415     gArgs.AddArg("-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)", DEFAULT_MAX_TIME_ADJUSTMENT), false, OptionsCategory::CONNECTION);
    416     gArgs.AddArg("-maxuploadtarget=<n>", strprintf("Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)", DEFAULT_MAX_UPLOAD_TARGET), false, OptionsCategory::CONNECTION);
    417-    gArgs.AddArg("-onion=<ip:port>", "Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)", false, OptionsCategory::CONNECTION);
    418+    gArgs.AddArg("-onion=<ip:port>", "Use separate SOCKS5 proxy to reach peers via Tor hidden services, set -noonion to disable (default: -proxy)", false, OptionsCategory::CONNECTION);
    


    MarcoFalke commented at 12:32 pm on September 5, 2018:
    Same here?
  23. in src/init.cpp:422 in e9a78e9b3b
    419     gArgs.AddArg("-onlynet=<net>", "Make outgoing connections only through network <net> (ipv4, ipv6 or onion). Incoming connections are not affected by this option. This option can be specified multiple times to allow multiple networks.", false, OptionsCategory::CONNECTION);
    420     gArgs.AddArg("-peerbloomfilters", strprintf("Support filtering of blocks and transaction with bloom filters (default: %u)", DEFAULT_PEERBLOOMFILTERS), false, OptionsCategory::CONNECTION);
    421     gArgs.AddArg("-permitbaremultisig", strprintf("Relay non-P2SH multisig (default: %u)", DEFAULT_PERMIT_BAREMULTISIG), false, OptionsCategory::CONNECTION);
    422     gArgs.AddArg("-port=<port>", strprintf("Listen for connections on <port> (default: %u, testnet: %u, regtest: %u)", defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), false, OptionsCategory::CONNECTION);
    423-    gArgs.AddArg("-proxy=<ip:port>", "Connect through SOCKS5 proxy", false, OptionsCategory::CONNECTION);
    424+    gArgs.AddArg("-proxy=<ip:port>", "Connect through SOCKS5 proxy, set -noproxy to disable (default: disabled)", false, OptionsCategory::CONNECTION);
    


    MarcoFalke commented at 12:33 pm on September 5, 2018:
    Same here?
  24. in src/init.cpp:470 in e9a78e9b3b
    466@@ -467,7 +467,7 @@ void SetupServerArgs()
    467     gArgs.AddArg("-limitdescendantsize=<n>", strprintf("Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT), true, OptionsCategory::DEBUG_TEST);
    468     gArgs.AddArg("-vbparams=deployment:start:end", "Use given start/end times for specified version bits deployment (regtest-only)", true, OptionsCategory::DEBUG_TEST);
    469     gArgs.AddArg("-addrmantest", "Allows to test address relay on localhost", true, OptionsCategory::DEBUG_TEST);
    470-    gArgs.AddArg("-debug=<category>", strprintf("Output debugging information (default: %u, supplying <category> is optional)", 0) + ". " +
    471+    gArgs.AddArg("-debug=<category>", "Output debugging information (default: -nodebug, supplying <category> is optional). "
    


    MarcoFalke commented at 12:34 pm on September 5, 2018:
    Could say -nodebug or -debug=0 to document that for this option both variants are supposed to work?

    laanwj commented at 12:39 pm on September 5, 2018:
    if the point is supposed to work then that needs a test, not documentation I don’t want to make this overly verbose documenting one method that works is good enough from the perspective of a user !
  25. MarcoFalke commented at 12:34 pm on September 5, 2018: member
    re-utACK with some questions
  26. DrahtBot removed the label Needs rebase on Sep 5, 2018
  27. MarcoFalke referenced this in commit 95d731d9b3 on Sep 5, 2018
  28. MarcoFalke merged this on Sep 5, 2018
  29. MarcoFalke closed this on Sep 5, 2018

  30. MarcoFalke referenced this in commit 2936dbc557 on Sep 5, 2018
  31. laanwj referenced this in commit 6ba1f15432 on Sep 6, 2018
  32. laanwj referenced this in commit a6aca8dc2f on Sep 6, 2018
  33. fanquake commented at 11:02 am on September 6, 2018: member
    Backported in #14152.
  34. fanquake removed the label Needs backport on Sep 6, 2018
  35. HashUnlimited referenced this in commit 2d0f2e338f on Sep 14, 2018
  36. uhliksk referenced this in commit da0356d1ef on Oct 18, 2018
  37. deadalnix referenced this in commit 05a9f3dd46 on Jan 19, 2020
  38. Munkybooty referenced this in commit 492bc9374c on Jul 1, 2021
  39. Munkybooty referenced this in commit e07f2cf0fd on Jul 1, 2021
  40. Munkybooty referenced this in commit 9b3d0a2c97 on Jul 2, 2021
  41. Munkybooty referenced this in commit 44b6238ddb on Jul 3, 2021
  42. UdjinM6 referenced this in commit fe87c21bf2 on Jul 3, 2021
  43. Munkybooty referenced this in commit a7f6bc83c5 on Jul 3, 2021
  44. UdjinM6 referenced this in commit 76378771c5 on Jul 3, 2021
  45. Munkybooty referenced this in commit 13eb54157c on Jul 7, 2021
  46. Munkybooty referenced this in commit 7405b236e2 on Jul 8, 2021
  47. PastaPastaPasta referenced this in commit 6575bcdf9e on Jul 19, 2021
  48. PastaPastaPasta referenced this in commit 23c024eca9 on Jul 19, 2021
  49. PastaPastaPasta referenced this in commit 5b0f4b4265 on Jul 19, 2021
  50. PastaPastaPasta referenced this in commit a1a1a0766b on Jul 19, 2021
  51. DrahtBot 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-17 12:12 UTC

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