Read/write bitcoin_rw.conf for exposing shared Daemon/GUI options in the GUI #7510

pull luke-jr wants to merge 9 commits into bitcoin:master from luke-jr:rwconf changing 15 files +543 −5
  1. luke-jr commented at 6:58 am on February 11, 2016: member

    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.

  2. Add new bitcoin_rw.conf file that is used for settings modified by this software itself 9a71dd7962
  3. net: Expose recommended upload target as CNode::GetMaxOutboundTargetRecommendedMinimum 5191d2ceb1
  4. laanwj commented at 7:40 am on February 11, 2016: member

    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.

  5. luke-jr force-pushed on Feb 11, 2016
  6. luke-jr commented at 8:01 am on February 11, 2016: member

    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.

  7. laanwj commented at 8:29 am on February 11, 2016: member

    QSettings is not really a good solution since bitcoind won’t use it

    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.

  8. laanwj added the label GUI on Feb 11, 2016
  9. Qt/Options: Expose maxuploadtarget in GUI using rwconf e1c50f2016
  10. Qt/Options: Expose peerbloomfilters in GUI using rwconf 3cba198b82
  11. luke-jr force-pushed on Feb 11, 2016
  12. luke-jr commented at 4:30 pm on February 11, 2016: member
    Conversation with @laanwj on IRC re settings enum: Goal should be to move this into util, not to introduce strings to GUI. Makes more sense to do it as part of RPC setconfig (#7289), rather than rwconf.
  13. Bugfix: rwconf: Test and correct for some unusual cases c9d73c5d93
  14. Use network-specific directory for bitcoin_rw.conf
    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).
    15f5fa37a0
  15. luke-jr force-pushed on Feb 14, 2016
  16. laanwj added the label Feature on Feb 16, 2016
  17. in doc/files.md: in 15f5fa37a0 outdated
    0@@ -1,6 +1,7 @@
    1 
    2 * banlist.dat: stores the IPs/Subnets of banned nodes
    3 * bitcoin.conf: contains configuration settings for bitcoind or bitcoin-qt
    4+* bitcoin_rw.conf: contains configuration settings modified by bitcoind or bitcoin-qt: since Knots 0.12.0
    


    jonasschnelli commented at 3:41 pm on February 19, 2016:
    What is “Knots 0.12.0”?

    rebroad commented at 1:28 am on September 25, 2016:
    @jonasschnelli Google seems to be quite good at answering this question :)
  18. jonasschnelli commented at 3:47 pm on February 19, 2016: contributor

    Agree with @laanwj that we should not couple additional GUI settings with the different persistent store file.

    QSettings works nice and is platform independent, but – I agree – users might have problems to locate the file (to delete or inspect/change) and I agree that keeping all bitcoin related config file in the bitcoin-datadir would be good.

    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.

  19. Bugfix: Avoid throwing errors because we cannot delete bitcoin_rw.conf when it already does not exist 535edcb582
  20. jonasschnelli commented at 7:29 am on April 5, 2016: contributor
    @luke-jr: Are you interested to open a PR with just the maxuploadtarget GUI option? I think that one would be uncontroversial.
  21. luke-jr referenced this in commit fb664ca451 on Jun 28, 2016
  22. luke-jr referenced this in commit 220f81122a on Jun 28, 2016
  23. Qt/Options: Fix warning about comparing signed/unsigned 227135011a
  24. Merge tag 'branch-0.13' into rwconf 45471ab5c9
  25. jonasschnelli commented at 9:09 am on August 24, 2016: contributor
    Needs to be closed or rebased. I think closing would make more sense since this seems to be controversial.
  26. rebroad commented at 1:27 am on September 25, 2016: contributor
    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.
  27. rebroad commented at 1:33 am on September 25, 2016: contributor
    @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)?
  28. luke-jr commented at 3:55 am on September 25, 2016: member
    @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.
  29. rebroad commented at 4:31 am on September 25, 2016: contributor
    @rebroad Given that #7289 allows config changes during run-time - we might want to permit some of those changes to persist between runs - something like this pull (are there other options on offer) do seem to be needed - therefore ACK from me (unless a better alternative is coming along soon).
  30. jonasschnelli commented at 7:35 pm on October 18, 2016: contributor
    Closing for now because it seems to be controversial.
  31. jonasschnelli closed this on Oct 18, 2016

  32. Sjors referenced this in commit 1dbfbd1d21 on Mar 29, 2018
  33. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me