-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[wip] util: Improve evaluation of includeconf lines in network sections of the config file #14866
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
This can break existing configurations correct? |
@promag Thanks for your comment. |
src/util/system.cpp
Outdated
if (key == "includeconf") { | ||
if (depth < 0) { | ||
continue; | ||
} else if (depth < MAX_INCLUDECONF_DEPTH) { |
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: The else
here is redundant due to the continue
above.
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.
@practicalswift Thanks. Indeed!
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.
Done.
You should not break existing configurations, especially if there is no strong reason to do it. |
@promag My motivation of this PR is that I think it is very difficult to effectively use sections explicitly specified using prefix or use "includeconf". For example, If using following 4 config file, bitcoind (build from master 86ff041) never read port.conf and user.conf. Furthermore, it warns these files as nested.
So I think evaluate |
@promag The |
I think that's a good point, does this only affect use of |
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. |
@kallewoof @laanwj I'm so sorry for my late reply.
I think so too. |
f63984b
to
5c55f9a
Compare
Rebased but travis failed. Hmm,,, I will check what's going on. |
The direct cause of failing travis was potential deadlock detection. potential_deadlock_detected() reports following message:
|
Addressed to the potential deadlock by narrowing the range of LOCK(cs_args). |
utACK cca8a9196f491aa8e99d18846578307cd7004c45 |
cca8a91
to
c858ddc
Compare
squashed and rebased. |
Concept ACK, except I think the following example (from the description) should just fail: [main]
includeconf=inc1.conf
test.includeconf=inc2.conf Once a network is specified with square brackets like I'm also tempted to suggest a rule that square brackets may not exist in both bitcoin.conf and and It's important to simplify this behavior sufficiently so we stand a chance of one day merging #11082 :-) |
@Sjors Thank you for your surggestions.
Good idea. I agree.
I like this. And I think square brackets may not exist in the files that are included by using "section.includeconf" style, too. |
Ok, looking forward to the new version. I think it would be very useful to add a lot more tests to feature_config_args.py, given that you were able to make these changes without breaking any existing test. |
c858ddc
to
613c62b
Compare
rebased. (no functional change yet) |
6430f92
to
042eb42
Compare
Rebased. |
Hi @AkioNak - friendly monthly ping. |
@adamjonas Thanks. I will do again. |
042eb42
to
12bacf3
Compare
12bacf3
to
3b6b025
Compare
3b6b025
to
8b20f4a
Compare
Improve property evaluation way in bitcoin.conf This PR intends to make it easy to understand how the configuration files are interpreted. 1. Evaluate "includeconf" at the position described in the config file (like #include directive in C/C++), rather than at the end. 2. If once a section is specified with square brackets like [main], the only way to configure another network is to use square brackets again, e.g. [test]. 3. In the "included" config file, the section is taken over from the "including" file. If no sections are specified yet, using square brackets or section prefix is still possible in the "included" file. 4. Changing the section in the "included" config file does not affects the including file. The section of the including file is kept. 5. If the "included" config file is included after the section has been specified by using square brackets or if they are included by using section prefix, any square brackets can not be used in that file. ex) With Following 3 files, the properties are read as: port=8444, main.port=8445, test.port=8442, regtest.port: undefined bitcoin.conf --- test.includeconf=inc1.conf includeconf=inc2.conf port=8441 # ignored (2nd appearance of w/o section) inc1.conf --- port=8442 # test [regtest] port=8443 # ignored inc2.conf --- port=8444 # w/o section [main] port=8445 # main [regtest]
8b20f4a
to
de41f72
Compare
🐙 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". |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
I will solve the conflicts. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Going to close with "Up for Grabs". |
This PR intends to make it easy to understand how the configuration files are interpreted.
Evaluate "includeconf" at the position described in the config file (like #include directive in C/C++), rather than at the end.
If once a section is specified with square brackets like [main], the only way to configure another network is to use square brackets again, e.g. [test].
In the "included" config file, the section is taken over from the "including" file. If no sections are specified yet, using square brackets or section prefix is still possible in the "included" file.
Changing the section in the "included" config file does not affects the including file. The section of the including file is kept.
If the "included" config file is included after the section has been specified by using square brackets or if they are included by using section prefix, any square brackets can not be used in that file.
ex) With Following 3 files, the properties are read as:
bitcoin.conf
inc1.conf
inc2.conf