fix(qt): re-run parameter interactions after setting prune settings on first-run#6367
Closed
kwvg wants to merge 2 commits into
Closed
fix(qt): re-run parameter interactions after setting prune settings on first-run#6367kwvg wants to merge 2 commits into
kwvg wants to merge 2 commits into
Conversation
New prune settings aren't set until `InitPruneSetting()` is called at the tail end of init logic. The two opportunities we have to influence `-txindex` and `-disablegovernance`, `parameterSetup()` and `OptionsModel::Init()`, are executed well before `InitPruneSetting()` is run. So let's run `parameterSetup()` again to make sure parameter interactions affected by prune settings are processed appropriately.
The startup warning that alerts us that governance is disabled and that it's expected when we're pruning is sufficient.
5 tasks
Collaborator
Author
|
Superseded by #6368 |
PastaPastaPasta
added a commit
that referenced
this pull request
Oct 29, 2024
2d99b2c fix: force correct `-disablegovernance` and `-txindex` values when pruning is requested via init dialog (UdjinM6) 64b20f0 fix(qt): set prune dependent options correctly (Kittywhiskers Van Gogh) Pull request description: ## Issue being fixed or feature implemented A few things to note: 1. we shouldn't rely on `bPrune` cause it can be overridden via cmd-line 2. `addOverriddenOption` is used to highlight that there are GUI options that were overridden via cmd-line and neither `-disablegovernance` nor `-txindex` override anything, we simply set them to correct values here. 3. we should do all that in `SetPruneEnabled` case that's the central point for GUI prune option logic fixes #6366 #6367 alternative ## What was done? ## How Has This Been Tested? `./src/qt/dash-qt --regtest --resetguisettings` (could also add `--txindex=1` and/or `--disablegovernance=0`), check "Limit ..." box, click OK and confirm it continues with no errors (but with a warning about disabled governance, that's by design) close qt and check 2 more things: 1. `./src/qt/dash-qt --regtest` should have a warning about disabled governance 2. `./src/qt/dash-qt --regtest --prune=0` should have no warning about disabled governance (not true on `develop`) ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: kwvg: ACK 2d99b2c PastaPastaPasta: utACK 2d99b2c Tree-SHA512: 465bd2f1ca86358145c4671af554078b00b2472375d65b8de7e01ae0db8b24c9b01844a2b8e5a4c85a6d65a892a169ee61797591c0dfc0f51ec044a8e2bba58a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional Information
The bug reported in #6366 can be reproduced by deleting
~/.config/*/Dash-Qt*.confand runningdash-qt(the decision on whether to display the splash screen is based on Qt settings, which are read before datadir).This bug has been reproduced on
develop(f211bb9) and as early as v20.0.4 (the ability to enable pruning was introduced in #5255).The bug occurs we're given two opportunities to disable of
-txindexand enable of-disablegovernanceif-pruneis set,InitParameterInteraction()(source) (viaBitcoinApplication::parameterSetup(), source) andOptionsModel::Init()(source) but both opportunities are exhausted before we set the-pruneflag in response to enabling the option in the UI (source).We cannot simply just move
BitcoinApplication::InitPruneSetting()up as it assumesOptionsModelis initialized andOptionsModel::Init()is called from the constructor.This means when arguments are parsed for the last time, we get our "Prune mode is incompatible with -txindex" (source) because our parameter interactions took place before prune settings were set.
This PR resolves that by running
BitcoinApplication::parameterSetup()again afterBitcoinApplication::InitPruneSetting(). We do this instead of usingOptionsModel::Init()as all theSoftSet{Bool}Arg()failures will result in an unnaturally populated overridden arguments list.Breaking Changes
None expected
Checklist