hebasto
commented at 8:27 pm on July 27, 2019:
member
This PR replaces permissive ArgsManager::ALLOW_ANY flag with more restrictive ArgsManager::ALLOW_STRING flag for string type configuration options in simple cases.
With this PR:
0$ src/bitcoind -nodatadir
1Error: Error parsing command line arguments: Negating of -datadir is meaningless and therefore forbidden
23$ src/bitcoind -noblocksdir
4Error: Error parsing command line arguments: Negating of -blocksdir is meaningless and therefore forbidden
Special cases, like -nowallet, are out of this PR’s scope.
NOTE for reviewers. This PR is based on top of #16508 and #16097, so only the last four commits are to be reviewed here.
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.
promag
commented at 5:27 pm on July 28, 2019:
member
Concept ACK.
fanquake removed the label
GUI
on Jul 29, 2019
fanquake removed the label
Validation
on Jul 29, 2019
fanquake removed the label
Wallet
on Jul 29, 2019
fanquake removed the label
Tests
on Jul 29, 2019
jonasschnelli
commented at 8:42 am on July 29, 2019:
contributor
Concept ACK. Haven’t looked at the code though.
practicalswift
commented at 9:50 am on July 30, 2019:
contributor
Concept ACK
ryanofsky
commented at 6:41 pm on July 30, 2019:
member
I’d NACK this PR in it’s current form, but I think it could be fixed up without too much effort. Currently, commit “Use ArgsManager::ALLOW_STRING flag explicitly” (181f462dd983c0218618c1f64b65eefecb32ca4e) is changing too much behavior at the same time, and the current PR description doesn’t begin to describe all the changes, and there are no release notes. Regarding commit 181f462dd983c0218618c1f64b65eefecb32ca4e:
I think it’s good to trigger errors if someone specifies -noblocksdir or -nodatadir since these directories are mandatory and bitcoin can’t function without them. It looks like the commit is doing the right thing by forbidding these options.
It’s probably ok to trigger unconditional errors on -norpcport and -nowalletdir like this commit is doing, but I think more ideally conservative configurations like -noserver -norpcport or -nowallet -nowalletdir would continue to work instead of being forbidden now.
I think options like -noalertnotify, -noassumevalid, -noconf, -nominimumchainwork, -noaddnode, and others should be continue to allowed since they could be useful for command line overrides and because they have straightforward meanings. It looks like the PR is forbidding these options without a justification. If these flags aren’t currently being interpreted correctly, it would seem better to make simple bugfixes here than forbid options which should work.
The -noincludeconf case might be an exception, or there may be other options like it, but it’s explicitly handled in config parsing code to disable inclusion, but now the option itself is now forbidden, so this is a bug.
Overall, I think commit 181f462dd983c0218618c1f64b65eefecb32ca4e changes too much and is too restrictive. I think some parts of it could be rolled back to limit scope of this PR and preserve more current behavior, while allowing more targeted improvements to be done in the future. Otherwise, I would just like to see it split up into smaller commits that:
Change individual options, or small groups of options that are similar to each other.
Document user-visible changes in release notes, so users can be forewarned about them. You can see instructions at https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#release-notes for adding a doc/release-notes-16476.md file, to document previously accepted options that are now errors and previously misinterpreted options that are now interpreted correctly.
Revamp option negating policyb70cc5d733
test: Make tests arg type specifice6f649cb2c
Use ArgsManager::ALLOW_BOOL flag explicitly1bb9e33f58
Allow double negation for pure boolean args only98ebe68704
test: Add tests for option negating policyad3938065b
Use ArgsManager::ALLOW_STRING flag in utilities95c452fc59
Use ArgsManager::ALLOW_STRING flag explicitlyb886a80e66
test: Add tests for negated string argsd8c154d134
doc: Add release notes for 1647638eadd7577
hebasto force-pushed
on Jul 31, 2019
hebasto
commented at 8:29 pm on July 31, 2019:
member
I think some parts of it could be rolled back to limit scope of this PR and preserve more current behavior, while allowing more targeted improvements to be done in the future.
Done. Only simple cases are in this PR. Other parts have been rolled back.
I would just like to see it split up into smaller commits…
Done. A big commit has been split in two smaller ones.
Document user-visible changes in release notes, so users can be forewarned about them.
Done.
Also some tests have been added.
hebasto renamed this:
Use ArgsManager::ALLOW_STRING flag explicitly
Use ArgsManager::ALLOW_STRING flag explicitly in simple cases
on Jul 31, 2019
hebasto
commented at 8:39 pm on July 31, 2019:
member
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-12-22 18:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me