This was a good addition to the docs, but the PR was closed. So I've cherry-picked the commit and fixed up Russ's comments as well as the linter issue.
doc: add note on precedence of options in bitcoin.conf #16448
pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:options_bitocin_conf changing 1 files +15 −0-
fanquake commented at 6:33 AM on July 24, 2019: member
- fanquake added the label Docs on Jul 24, 2019
- fanquake requested review from ryanofsky on Jul 24, 2019
-
in doc/bitcoin-conf.md:37 in 91cb242433 outdated
29 | @@ -30,6 +30,21 @@ Network specific options can be: 30 | - placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`) or `[regtest]`; 31 | - prefixed with a chain name; e.g., `regtest.maxmempool=100`. 32 | 33 | +Network specific options take precedence over non-network specific options. 34 | +If multiple values for the same option is found with the same precedence, the 35 | +first one is generally chosen. 36 | + 37 | +This means that given the following configuration, `rpcport` is set to `3000`:
hebasto commented at 6:47 AM on July 24, 2019:This means that given the following configuration, `regtest.rpcport` is set to `3000`:hebasto changes_requestedhebasto commented at 6:48 AM on July 24, 2019: memberConcept ACK
in doc/bitcoin-conf.md:34 in 91cb242433 outdated
29 | @@ -30,6 +30,21 @@ Network specific options can be: 30 | - placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`) or `[regtest]`; 31 | - prefixed with a chain name; e.g., `regtest.maxmempool=100`. 32 | 33 | +Network specific options take precedence over non-network specific options. 34 | +If multiple values for the same option is found with the same precedence, the
jonatack commented at 8:19 AM on July 24, 2019:s/is/are/
in doc/bitcoin-conf.md:35 in 91cb242433 outdated
29 | @@ -30,6 +30,21 @@ Network specific options can be: 30 | - placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`) or `[regtest]`; 31 | - prefixed with a chain name; e.g., `regtest.maxmempool=100`. 32 | 33 | +Network specific options take precedence over non-network specific options. 34 | +If multiple values for the same option is found with the same precedence, the 35 | +first one is generally chosen.
jonatack commented at 8:24 AM on July 24, 2019:with respect to "generally", do exceptions exist?
ryanofsky commented at 5:28 PM on July 24, 2019:re: #16448 (review)
with respect to "generally", do exceptions exist?
The main exception is settings like
-walletwhere multiple values are used. But in general the way settings are merged is insane and has lots of corner cases that should be cleaned up. #15934 has more information (look for for "strange merging behaviors" in the description).I do think the new text in this PR is basically at the right level of detail to be understandable and set users on the right path. Getting into a lot of exceptions and special cases here would probably not be helpful.
fanquake commented at 1:58 AM on July 25, 2019:Thanks, I'll leave this as is for now.
in doc/bitcoin-conf.md:33 in 91cb242433 outdated
29 | @@ -30,6 +30,21 @@ Network specific options can be: 30 | - placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`) or `[regtest]`; 31 | - prefixed with a chain name; e.g., `regtest.maxmempool=100`. 32 | 33 | +Network specific options take precedence over non-network specific options.
jonatack commented at 8:30 AM on July 24, 2019:Perhaps an example of network-specific vs non network-specific would be helpful. For example, IIUC the first instance of
rpcportin the example below is not network-specific and the two instances after are network-specific, and so the first instance of the second two prevails. The example could take the form of inline code comments in the example below.
ryanofsky commented at 5:24 PM on July 24, 2019:re: #16448 (review)
Perhaps an example of network-specific vs non network-specific would be helpful.
Best to review the document as a whole and suggest specific changes in the appropriate sections:
https://github.com/fanquake/bitcoin/blob/options_bitocin_conf/doc/bitcoin-conf.md
I agree inline code comments below could be a good idea if you want to suggest them inside the example. But the paragraph immediately before this diff explains what network specific options are, so if that section is not clear we should fix it instead of trying to explain network options a second time at the same time as describing precedence.
jonatack commented at 6:36 PM on July 24, 2019:Thank you @ryanofsky, agreed, I overlooked the preceding paragraph.
jonatack commented at 8:31 AM on July 24, 2019: memberConcept ACK
ryanofsky approvedryanofsky commented at 5:50 PM on July 24, 2019: memberConditional ACK 91cb24243322b2a579061eb9f3d9336fa84bb835, if fixes suggested by jonatack and hebasto are incorporated (good catches!)
doc: add note on precedence of options in bitcoin.conf fa2f991fa2in doc/bitcoin-conf.md:46 in 91cb242433 outdated
41 | +rpcport=2000 42 | +regtest.rpcport=3000 43 | + 44 | +[regtest] 45 | +rpcport=4000 46 | +```
jonatack commented at 6:46 PM on July 24, 2019:Should you decide that comments in the example configuration are a good idea, here is one (entirely optional) version for your consideration:
regtest=1 rpcport=2000 # Non-network specific `rpcport` option regtest.rpcport=3000 # 1st network specific `rpcport` option -> value chosen by the parser [regtest] rpcport=4000 # 2nd network specific `rpcport` option
fanquake commented at 2:00 AM on July 25, 2019:I feel like adding comments would make this pretty noisy, however will leave this up to if anyone else thinks they should be added.
michaelfolkson commented at 11:55 AM on August 14, 2019:I know this PR has been merged now but I would have liked more comments here as @jonatack suggested. I didn't understand what was going on. I understand there is a trade-off between informing less experienced users and minimizing noise for more experienced users. Perhaps when the minimizing noise option is chosen a Bitcoin StackExchange page can be set up to include those comments. Resources like Jameson Lopp's Bitcoin Core config generator tool are useful too. Though whether you'd want to provide a link to these resources from within a config file or in a comment within the codebase I don't know...
laanwj commented at 12:17 PM on August 14, 2019:I guess it's better to make a new PR at this point; replying on a deeply nested comment on a merged PR isn't going to make much of a difference
Though whether you'd want to provide a link to these resources from within a config file or in a comment within the codebase I don't know...
Would personally prefer to keep it more or less self-contained, external links might change and tend to go stale.
michaelfolkson commented at 12:27 PM on August 14, 2019:Ok, understood. Thanks
fanquake force-pushed on Jul 25, 2019fanquake commented at 2:01 AM on July 25, 2019: memberHave fixed up all the nits mentioned above.
laanwj commented at 11:00 AM on July 31, 2019: memberThanks a lot for documenting this behavior. ACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae
ryanofsky approvedryanofsky commented at 4:31 PM on July 31, 2019: memberACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae. Only suggested changes since previous review.
hebasto commented at 4:44 PM on July 31, 2019: memberACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae, I have reviewed the code and it looks OK, I agree it can be merged.
jamesob commented at 4:48 PM on July 31, 2019: memberjonatack commented at 4:53 PM on July 31, 2019: memberACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae
pull[bot] referenced this in commit 25f0edd59f on Jul 31, 2019fanquake merged this on Jul 31, 2019fanquake closed this on Jul 31, 2019fanquake deleted the branch on Jul 31, 2019sidhujag referenced this in commit 235891ae26 on Aug 1, 2019jasonbcox referenced this in commit e9fa62b38a on Oct 12, 2020PastaPastaPasta referenced this in commit 3f79cdc1a1 on Jun 27, 2021PastaPastaPasta referenced this in commit 5ccffa2090 on Jun 28, 2021PastaPastaPasta referenced this in commit 4dcd51e70e on Jun 29, 2021PastaPastaPasta referenced this in commit 90c1e3f6ce on Jul 1, 2021PastaPastaPasta referenced this in commit 95d05859ef on Jul 1, 2021PastaPastaPasta referenced this in commit 48075b81f6 on Jul 12, 2021DrahtBot locked this on Dec 16, 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-18 18:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me