-
Notifications
You must be signed in to change notification settings - Fork 992
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 migration to config_file_version = 2
#3634
Conversation
Awesome work, I have a couple of questions around the changes and what they mean
|
Functionally, it doesn't really matter. Leaving the version 1 defaults provides some implicit testing of the migration mechanism, which should probably get an explicit test if the default is changed. I see your point though, I'll think on it.
I don't think it'd be a good idea to ever remove the migration — users could have arbitrarily old configs, so the code should always be able to migrate from a day-1 config file all the way up to whatever the current version is.
I took a quick look, and didn't see anything that would currently benefit from a new config version. If I missed something, happy to add that. I'm also happy to spend the time on a more generalized approach (dreams of a generic |
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.
This looks like a good approach here. 👍
Planning to do some local testing of this over the next day or so.
We still include the offending comment via Lines 322 to 329 in 1b8acee
|
So I guess we should also update the generated file (if we generate one) to include the latest version number. |
Tested locally and looks good to me. 👍 |
…mble#3634) For MWC, no migration is made, keep that code in order need to migrate in the future.
This adds an automatic migration of
grin-server.toml
toconfig_file_version = 2
, performed as such:config_file_version = 2
line after header commentsserver.pool_config.accept_fee_base
is 1000000, change it to 500000#a setting to 1000000 will be overridden to 500000 to respect the fixfees RFC
, since it no longer will onceconfig_file_version
>= 2grin-server.toml
file to diskThis migration is only applied when the
config_file_version
key is not present in the existinggrin-server.toml
file.For a fresh install, the migration is performed automatically when reading the initial default config.
Error handling can be improved upon request if this general approach is OK.
Closes #3540.