Skip to content

Conversation

ryanofsky
Copy link
Contributor

@ryanofsky ryanofsky commented Nov 14, 2019

Previously these were allowed but ignored.

This change implements one of the settings simplifications listed in #17508. Change includes release notes.

Comment on lines -890 to +1020
BOOST_CHECK_EQUAL(out_sha_hex, "b835eef5977d69114eb039a976201f8c7121f34fe2b7ea2b73cafb516e5c9dc8");
BOOST_CHECK_EQUAL(out_sha_hex, "8fd4877bb8bf337badca950ede6c917441901962f160e52514e06a60dea46cde");
Copy link
Contributor Author

@ryanofsky ryanofsky Nov 14, 2019

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

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 14, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16545 (refactor: Implement missing error checking for ArgsManager flags 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.

@fanquake fanquake removed the Docs label Nov 14, 2019
Copy link
Contributor

@promag promag left a 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));
Copy link
Contributor

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.

Copy link
Contributor Author

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);
}
Copy link
Contributor

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.

@laanwj
Copy link
Member

laanwj commented Nov 15, 2019

Being explicit on invalid arguments is always better. And I don't see any reason to implement them, so Concept ACK.

Copy link

@ariard ariard left a 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.

Copy link
Contributor Author

@ryanofsky ryanofsky left a 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));
Copy link
Contributor Author

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.
@ajtowns
Copy link
Contributor

ajtowns commented Jan 9, 2020

Concept ACK

@laanwj
Copy link
Member

laanwj commented Feb 5, 2020

ACK 900d8f6

laanwj added a commit that referenced this pull request Feb 5, 2020
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
@laanwj laanwj merged commit 900d8f6 into bitcoin:master Feb 5, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 9, 2020
…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
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
…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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 22, 2020
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants