-
Notifications
You must be signed in to change notification settings - Fork 37.7k
util: Disallow network-qualified command line options #17482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
BOOST_CHECK_EQUAL(out_sha_hex, "b835eef5977d69114eb039a976201f8c7121f34fe2b7ea2b73cafb516e5c9dc8"); | ||
BOOST_CHECK_EQUAL(out_sha_hex, "8fd4877bb8bf337badca950ede6c917441901962f160e52514e06a60dea46cde"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "util: Disallow network-qualified command line options" (baf24fc)
Effect of this change is to remove a lot of lines that contain network-qualified command line options from test output:
-net=test -main.server=a1 -main.server=a2 noserver=1 main.server=c1 main.server=c2 server=c3 server=c4 soft || c3 | c3 c4
Lines without network-qualified command line options are unaffected:
net=test -server=a1 -server=a2 main.server=c1 main.server=c2 noserver=1 server=c3 server=c4 soft || a2 | a1 a2 c3 c4
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK, seems fine to do this.
|
||
const char* argv[] = {"ignored", "-registered"}; | ||
std::string error; | ||
BOOST_CHECK(test.ParseParameters(2, (char**)argv, error)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, success case seems unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #17482 (comment)
nit, success case seems unnecessary.
It helps ensure the test passes for right reason. That ParseParameters calls below aren't returning false for some other reason. Generally it's nice when test cases vary one input at a time, so you can be sure about what causes the observed output.
// error below. | ||
if (section.empty()) { | ||
m_settings.command_line_options[key].push_back(value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously a warning could make sense.
Being explicit on invalid arguments is always better. And I don't see any reason to implement them, so Concept ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review and tested ACK 124841f
Tested network-qualified command line args with/without this patchset and errors are now thrown as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 124841f -> 5e4ef31 (pr/wdqual.2
-> pr/wdqual.3
, compare) just adding suggested comment
|
||
const char* argv[] = {"ignored", "-registered"}; | ||
std::string error; | ||
BOOST_CHECK(test.ParseParameters(2, (char**)argv, error)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #17482 (comment)
nit, success case seems unnecessary.
It helps ensure the test passes for right reason. That ParseParameters calls below aren't returning false for some other reason. Generally it's nice when test cases vary one input at a time, so you can be sure about what causes the observed output.
Previously these were allowed but ignored.
Concept ACK |
ACK 900d8f6 |
900d8f6 util: Disallow network-qualified command line options (Russell Yanofsky) Pull request description: Previously these were allowed but ignored. This change implements one of the settings simplifications listed in #17508. Change includes release notes. ACKs for top commit: laanwj: ACK 900d8f6 Tree-SHA512: ab020a16a86c1e8ec709fbf798d533879d32c565eceeb7eb785c33042c49c6b4d1108c5453d8166e4a2abffc2c8802fbb6d3b895e0ddeefa8f274fd647e3c8ad
…tions 900d8f6 util: Disallow network-qualified command line options (Russell Yanofsky) Pull request description: Previously these were allowed but ignored. This change implements one of the settings simplifications listed in bitcoin#17508. Change includes release notes. ACKs for top commit: laanwj: ACK 900d8f6 Tree-SHA512: ab020a16a86c1e8ec709fbf798d533879d32c565eceeb7eb785c33042c49c6b4d1108c5453d8166e4a2abffc2c8802fbb6d3b895e0ddeefa8f274fd647e3c8ad
…tions 900d8f6 util: Disallow network-qualified command line options (Russell Yanofsky) Pull request description: Previously these were allowed but ignored. This change implements one of the settings simplifications listed in bitcoin#17508. Change includes release notes. ACKs for top commit: laanwj: ACK 900d8f6 Tree-SHA512: ab020a16a86c1e8ec709fbf798d533879d32c565eceeb7eb785c33042c49c6b4d1108c5453d8166e4a2abffc2c8802fbb6d3b895e0ddeefa8f274fd647e3c8ad
Summary: > Command line options prefixed with main/test/regtest network names like -main.port=8333 -test.server=1 previously were allowed but ignored. Now they trigger "Invalid parameter" errors on startup. This is a backport of Core [[bitcoin/bitcoin#17482 | PR17482]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8739
Previously these were allowed but ignored.
This change implements one of the settings simplifications listed in #17508. Change includes release notes.