Skip to content
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

Add extra configuration file to persist RPC-set features #3328

Draft
wants to merge 3 commits into
base: 1.15.0-dev
Choose a base branch
from

Conversation

chromatic
Copy link
Member

This begins to address a feature request in #3206. I'm creating it as a draft for now, because we should have make some design decisions before going further.

Current flaws:

  • (missing implementation) there's no lockunspent configuration option anywhere
  • (code style) the implementation is a mix of C and Boost, so it could be polished further
  • (design) this may be the wrong approach
  • (potential design question) there's no user notification that we're writing this file apart from its existence
  • (potential design question, depends on approach) nothing uses this file

However, in the spirit of debating working code (and in the interest of not replicating uninspectable binary .dat files for important options like these), it's worth at least a draft.

This gives us a place to add a textual representation of several
runtime-set configuration options, such as dust fees and locked
unspent transactions.
This code needs access to the wallet (even if it's not running or
enabled) and has to write wallet data before the wallet goes away. It's
also better if it uses C++ strings everywhere, so get rid of the C-style
printing in favor of functions that already exist.

One nit: adding more header information to `src/util.h` increases
coupling between these files, so perhaps this code is better off
somewhere other than `src/util.cpp`?
@chromatic
Copy link
Member Author

Sorry, pushed the first version of this one commit too early. This at least compiles locally.

@chromatic chromatic added enhancement RPC RPC related changes and questions labels Aug 31, 2023
@chromatic
Copy link
Member Author

I can reproduce this compilation error now locally, so I'll continue working on the code, but I think the design questions remain.

@patricklodder
Copy link
Member

(missing implementation) there's no lockunspent configuration option anywhere

To not mix wallet and node parameters, would it make sense to create a new data type for the wallet and store this simply inside wallet.dat? That way you only have to backup 1 file still when it comes to your funds, and this will be much easier to port to 1.21 where we'll have both bdb and sqlite wallets.

If you'd agree that to be a better solution for that particular problem, and afaik the other RPC calls aren't wallet related, I have no problem with writing an additional file.

(design) this may be the wrong approach

Since we're overriding values that can also be set in dogecoin.conf, I would make this a binary file rather than a text file (just reuse leveldb?), much like how the .plist (and I think some registry keys in Windows?) can persist some of the settings in Qt and have higher precedence over the conf.

@patricklodder patricklodder changed the base branch from 1.14.7-dev to 1.15.0-dev February 28, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement RPC RPC related changes and questions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants