-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Read/write bitcoin_rw.conf for exposing shared Daemon/GUI options in the GUI #7510
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
…is software itself
…ecommendedMinimum
We've discussed this on IRC. I'm not a big fan of adding yet another options source. The GUI already has command line, bitcoin.conf and QSettings - in that order of precedence. This has caused many complications and bugs in the past, especially during initialization, only now it seems to have cooled down a bit so I'm not really happy to stir the ants' nest again (we don't have a test suite for this part). Remember this all has to be backwards compatible. We can't just drop QSettings support. If you remember 0.5.x, the client used to store GUI settings in the wallet. It took long enough until we were able to finally drop that functionality. I'm happy that you're adding options to the GUI, but please don't couple it to this. |
This doesn't change initialisation at all, it uses the same code as bitcoin.conf for that. For now, everything currently in QSettings remains in QSettings (although upgrading them wouldn't be very difficult or risky, it's not really an immediate goal). QSettings is not really a good solution since bitcoind won't use it (I can't think of any use case where you'd want these kind of settings different depending on whether you use Daemon vs GUI). I think I'm going to need to make this aspect of the design be take-it-or-leave-it. It seems more than reasonable to let it sit a while and get any bugs ironed out in LJR/Knots before tackling it in Core. |
That's certainly a valid argument for using our own system instead of QSettings for core settings. If you add a test suite that tests interaction between various parameter sources, as well as backwards compatibility, I'd feel better about this. I just don't want to introduce a new source of stress. |
This necessarily loads bitcoin_rw.conf after bitcoin.conf, but takes care to allow the former to override options set only by the latter (eg, not ones set on the command line).
@@ -1,6 +1,7 @@ | |||
|
|||
* banlist.dat: stores the IPs/Subnets of banned nodes | |||
* bitcoin.conf: contains configuration settings for bitcoind or bitcoin-qt | |||
* bitcoin_rw.conf: contains configuration settings modified by bitcoind or bitcoin-qt: since Knots 0.12.0 |
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.
What is "Knots 0.12.0"?
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.
@jonasschnelli Google seems to be quite good at answering this question :)
Agree with @laanwj that we should not couple additional GUI settings with the different persistent store file.
I don't have a strong opinion on that, one one hand, I would like the fact to keep all files together (would also be possible with setting the QSettings path [http://doc.qt.io/qt-4.8/qsettings.html#setPath]?), on the other hand, adding more code of that type (that needs maintenance) should be avoided. |
…f when it already does not exist
@luke-jr: Are you interested to open a PR with just the maxuploadtarget GUI option? I think that one would be uncontroversial. |
Needs to be closed or rebased. I think closing would make more sense since this seems to be controversial. |
Not familiar with QConfig, but if it's Qt specific when it ought to influence bitcoind then I'd say the sooner it's removed the better. If this pull helps with that process then, utACK. |
@luke-jr Can this pull include an example bitcoin_rw.conf file or is it parsed in the same way as bitcoin.conf? If the latter then why the new code to parse it (can't it use the same code used to parse bitcoin.conf)? |
@rebroad bitcoin_rw.conf is parsed the same. The difference is that this file is modified by the code itself when the user changes options in the GUI, rather than needing to be modified manually by the user. |
Closing for now because it seems to be controversial. |
This gives GUI options for maxuploadtarget and peerbloomfilters, while retaining the user-set values in the Daemon as well (unlike current GUI options). This is done by modifying a bitcoin_rw.conf which is loaded in addition to bitcoin.conf (before, because that's how our precedence is setup). There's about 200 LOC for making these updates, but it is all well-tested, and the worst-case scenario doesn't affect the user-managed bitcoin.conf file.
The ugliest part having to special-case additions to the OptionsModel stuff. It would be nice to avoid that, but I don't see any way to do so as long as an enum is being used as the interface there.