Skip to content

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Dec 2, 2020

By tolerating unknown extra rpcauth parameters (and ignoring the rpcauth), we can ensure a limited forward compatibility by not forcing users to downgrade their config file to switch back to older versions (perhaps temporarily).

Same as #20548, but without the additional effort to explain the situation at runtime.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review ACK 017b6f8, but the release notes might need to be adjusted?

@promag
Copy link
Contributor

promag commented Dec 2, 2020

Concept ACK, you have to update test/functional/rpc_users.py.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 2, 2020

Release notes updated, debug msg changed, and tests updated.

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.

Tested ACK 044df97.

@maflcko maflcko removed the Docs label Dec 3, 2020
@maflcko
Copy link
Member

maflcko commented Dec 3, 2020

review ACK 044df97

@laanwj
Copy link
Member

laanwj commented Dec 3, 2020

I prefer failing here to be honest. But I guess my dislike for ignoring invalid options is well known.

@promag
Copy link
Contributor

promag commented Dec 3, 2020

I prefer failing here to be honest. But I guess my dislike for ignoring invalid options is well known.

In #20461 (comment) I've suggested a -strict (or similar) option.

@laanwj
Copy link
Member

laanwj commented Dec 3, 2020

I mean, if the entire problem here is that users running older bitcoin core might run into this error when upgrading and be confused, I think the error needs to be clearer. All in all it will result in removing cruft from their configuration. Even more, they will likely also be alerted to mistakes they made. Possibly critical security mistakes.
(…why would one add entries on purpose just to be ignored?)

I've suggested a -strict (or similar) option.

Not sure this kind of meta-configuration makes sense. It just adds more code paths where it's better to make a principled decision. And I think bitcoin core should be strict and unambigious about input handling.

@jnewbery
Copy link
Contributor

jnewbery commented Dec 3, 2020

I totally agree with @laanwj here. We should fail on invalid configuration.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 3, 2020

This still fails, just at runtime when it makes more sense to do so (and without disrupting other usage).

@harding
Copy link
Contributor

harding commented Dec 3, 2020

By tolerating unknown extra rpcauth parameters (and ignoring the rpcauth), we can ensure a limited forward compatibility by not forcing users to downgrade their config file to switch back to older versions (perhaps temporarily).

For the past couple releases, hasn't Bitcoin Core refused to start on unknown configuration settings?

$ bitcoind -not-a-real-setting
Error: Error parsing command line arguments: Invalid parameter -not-a-real-setting

Future releases, or spinoffs, are likely to support new configuration settings that old releases will not, so any users including those settings in their configuration files will need to edit those files anyway to use an old or baseline release. Rejecting unknown parameters seems like a simple and logically consistent extension of this previous policy.

The policy of failing on unknown settings is quite beneficial at eliminating the annoyance of figuring out that your configuration is broken and then restarting the node---which is something that can take a long time (e.g. if you have a high db cache or are using an underpowered computer) and which inexperienced users might not know how to do (or might do wrong, e.g. sending SIGKILL rather than SIGTERM, which could result in a need to reindex).

Based on my own misadventures, wrongly configuring a node is a much more common problem than wanting to use a future/spinoff configuration file with an old/baseline node, so I think we should optimize for helping users fix misconfigurations as fast and painlessly as possible.

@maflcko
Copy link
Member

maflcko commented Dec 3, 2020

Closing for now due to controversy

@maflcko maflcko closed this Dec 3, 2020
@luke-jr
Copy link
Member Author

luke-jr commented Dec 3, 2020

For the past couple releases, hasn't Bitcoin Core refused to start on unknown configuration settings?

On the command line only, not in config files where they would reasonably be expected.

@maflcko maflcko reopened this Dec 3, 2020
@harding
Copy link
Contributor

harding commented Dec 3, 2020

On the command line only, not in config files

Confirmed. That seems to me like an unnecessary half measure. If it's planned to keep it that way, there may indeed be merit in a -strict option that also validates options in the configuration file.

@sipa
Copy link
Member

sipa commented Dec 3, 2020

For the configuration files we've been going in the same direction, e.g. rpcport causes failure outside of network sections. That's not quite the same as it's blacklisting known-meaningless settings rather than whitelisting just known-meaningful ones, but in general becoming more strict in configuration files too makes sense.

@maflcko
Copy link
Member

maflcko commented Dec 3, 2020

Indeed, this is a bug that simply hasn't been fixed yet. See #15021

@sipa
Copy link
Member

sipa commented Dec 3, 2020

Right, I now remember. The reason rejecting unknown config options isn't done yet is because it would require all binaries to be aware of each other's options so they can be ignored.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 3, 2020

That would just be gratuitously breaking things for no reason...

@bitcoin bitcoin deleted a comment from DrahtBot Dec 4, 2020
@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 11, 2020

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

Conflicts

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.

@DrahtBot DrahtBot mentioned this pull request Dec 11, 2020
@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@luke-jr luke-jr closed this Dec 19, 2021
@bitcoin bitcoin locked and limited conversation to collaborators Dec 19, 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.

8 participants