Ignore unknown config file options; warn instead of error#13799
Ignore unknown config file options; warn instead of error#13799maflcko merged 2 commits intobitcoin:masterfrom
Conversation
|
Related #13441 |
Note to reviewers: This pull request conflicts with the following ones:
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. |
src/interfaces/node.cpp
Outdated
There was a problem hiding this comment.
Please use named arguments for literal primitive types. (/* ignore_invalid_keys */ true)
|
Tested ACK, we've discussed this on IRC and I think this is a good work-around for now. Without: With: (where It corrrectly rejects unknown direct arguments, but not those in the specified config file.
I strongly dislike this solution, it destroys all semblance of decoupling, modularity.
This would be better, command-specific config sections would improve readability of configuration as well. |
|
utACK 5901ca411b420fe097e688425d624c7a8d9f1a30. Needs tests fixed/disabled. |
|
utACK 5901ca4. How about hardcode the exceptions for now and keep the error behavior? |
No, let's not do that. This solution is good. The implementation of errors for unknown arguments was primarily introduced for command-line arguments anyhow—see #1044—at least I never predicted the implications for configuration options, but it's a separate concern. |
|
Tested ACK 5901ca411b420fe097e688425d624c7a8d9f1a30. |
achow101
left a comment
There was a problem hiding this comment.
The test feature_includeconf.py has a test case for invalid options in the conf file. That will need to be removed or be updated.
src/util.cpp
Outdated
There was a problem hiding this comment.
This doesn't work because logging is not setup at this point in startup. The warning does not appear in the debug.log.
There was a problem hiding this comment.
Hmm, I thought we cached early log messages and printed them afterwards. Any suggestions for how to deal with that?
|
Right now, to get around this problem, we already have a bunch of hidden arguments for the arguments from other binaries. I think it would be reasonable, at least for 0.17, to just extend that list to include the bitcoin-cli arguments. Then later we can add more invasive changes to actually fix the problem. |
|
re-utACK 247d574 |
No, I don't think that's reasonable. This solution is much better (I feel like I'm repeating myself...). |
247d574 Ignore unknown config file options for now (Pieter Wuille) 04ce0d8 Report when unknown config file options are ignored (Pieter Wuille) Pull request description: As reported by @satwo on IRC a few days ago, the current mechanism of treating unknown config file options as errors is problematic for options like `-rpcclienttimeout` which aren't defined for `bitcoind`. A full solution would be to either make all binaries be aware of each other's options, or to permit config file options that only apply to specific binaries (`bitcoind`, `bitcoin-qt`, `bitcoin-cli`). Both of these seem too invasive to introduce for 0.17. As a compromise, this PR makes it ignores those options, but still warn about it in the log file. Tree-SHA512: dfddc771b91df3031a9c98d9f3292f8f4fcd1b97ebb7317b2f457e12d9f205dc63f42721302e7258dbb53f273d7cc041a65a0a9120972769555784e1f1cc9aef
Summary: ``` As reported by @satwo on IRC a few days ago, the current mechanism of treating unknown config file options as errors is problematic for options like -rpcclienttimeout which aren't defined for bitcoind. A full solution would be to either make all binaries be aware of each other's options, or to permit config file options that only apply to specific binaries (bitcoind, bitcoin-qt, bitcoin-cli). Both of these seem too invasive to introduce for 0.17. As a compromise, this PR makes it ignores those options, but still warn about it in the log file. ``` Backport of core [[bitcoin/bitcoin#13799 | PR13799]]. Depends on D5553 (it is buggy otherwise). Test Plan: ninja all check ./test/functional/test_runner.py feature_includeconf Reviewers: #bitcoin_abc, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D5554
… of error 247d574 Ignore unknown config file options for now (Pieter Wuille) 04ce0d8 Report when unknown config file options are ignored (Pieter Wuille) Pull request description: As reported by @satwo on IRC a few days ago, the current mechanism of treating unknown config file options as errors is problematic for options like `-rpcclienttimeout` which aren't defined for `bitcoind`. A full solution would be to either make all binaries be aware of each other's options, or to permit config file options that only apply to specific binaries (`bitcoind`, `bitcoin-qt`, `bitcoin-cli`). Both of these seem too invasive to introduce for 0.17. As a compromise, this PR makes it ignores those options, but still warn about it in the log file. Tree-SHA512: dfddc771b91df3031a9c98d9f3292f8f4fcd1b97ebb7317b2f457e12d9f205dc63f42721302e7258dbb53f273d7cc041a65a0a9120972769555784e1f1cc9aef
… of error 247d574 Ignore unknown config file options for now (Pieter Wuille) 04ce0d8 Report when unknown config file options are ignored (Pieter Wuille) Pull request description: As reported by @satwo on IRC a few days ago, the current mechanism of treating unknown config file options as errors is problematic for options like `-rpcclienttimeout` which aren't defined for `bitcoind`. A full solution would be to either make all binaries be aware of each other's options, or to permit config file options that only apply to specific binaries (`bitcoind`, `bitcoin-qt`, `bitcoin-cli`). Both of these seem too invasive to introduce for 0.17. As a compromise, this PR makes it ignores those options, but still warn about it in the log file. Tree-SHA512: dfddc771b91df3031a9c98d9f3292f8f4fcd1b97ebb7317b2f457e12d9f205dc63f42721302e7258dbb53f273d7cc041a65a0a9120972769555784e1f1cc9aef
As reported by @satwo on IRC a few days ago, the current mechanism of treating unknown config file options as errors is problematic for options like
-rpcclienttimeoutwhich aren't defined forbitcoind.A full solution would be to either make all binaries be aware of each other's options, or to permit config file options that only apply to specific binaries (
bitcoind,bitcoin-qt,bitcoin-cli). Both of these seem too invasive to introduce for 0.17.As a compromise, this PR makes it ignores those options, but still warn about it in the log file.