qml: clarify onboarding storage options for existing datadir

bitcoin-core/gui-qml: PR #1050

1 major finding · 1 minor finding · 4 suggestions

Earlier concerns neither republished nor resolved: 1 minor finding. See the Run archive for their assessments.

Findings

Link

[major] · Reselecting Custom discards the configuration-selected datadir source

During onboarding, reselecting a directory supplied by datadir= in the default bitcoin.conf, without command-line -datadir or -conf, skips that configuration and persists the change, potentially removing configured proxy restrictions on this and later launches.

Location: qml/components/StorageLocations.qml:82 (head).

Details and suggested fix

Startup preserves the directory's Config source and stores its path in customDataDir. Clicking the already-selected Custom card now calls selectCustomDataDir(customDataDir), which changes the source to UserSelection and refreshes the preview even when the path is unchanged. Selecting Default and then Custom does the same. For this source, preview and ApplyToArgs soft-set -datadir before ReadConfigFiles, so Core looks for bitcoin.conf inside the redirected directory instead of reading the default-location file. Core accepts that file being absent. Settings supplied only by the original configuration, including proxy and network restrictions, therefore disappear. ApplyToArgs also persists the directory as the GUI selection, reproducing the changed configuration lookup on later launches. At base, clicking Custom only opened the folder picker.

Remember the original source alongside the custom path. Preserve it when reselecting the same directory or restoring it after Default, while still allowing revalidation. Add a regression using datadir= in the default-location bitcoin.conf without an explicit -conf.


Link

[minor] · Low-space exception permits a prune target above the saved target

On a low-space profile with prune=4096, editing the popup target from 5 GB to 4 and back to 5 permits 4768 MiB, exceeding the saved target rather than only keeping or lowering it.

Location: qml/models/onboardingoptionsmodel.cpp:221 (head).

Details and suggested fix

commitPruneSizeGB raises the free-space maximum to PruneMiBToGB(currentPruneTargetMiB()). That conversion rounds 4096 MiB up to 5 GB, but converting 5 GB back produces 4768 MiB. When available space minus chainstate would otherwise cap the input below 5, both edits still pass the exception. The final target differs from the exact saved target, so clearUnchangedStorageSelection leaves it touched and applying onboarding writes an increase of 672 MiB. Merely recommitting the unchanged displayed value is harmless because changePruneSizeGB ignores an equal value. Exempt an input from the free-space cap only when its PruneGBToMiB result is no greater than the exact saved MiB target.


Optional improvements

Link

[suggestion] · Changing directory silently drops earlier network privacy choices

Changing the storage directory intentionally reloads the new profile's network settings, but onboarding gives no notice when this discards a proxy or Tor choice made earlier in the session.

Location: qml/models/onboardingoptionsmodel.cpp:194 (head).

Details and suggested fix

setDataDir clears all touched settings when the directory changes, and the next preview replaces proxy, onion and listen choices with the destination profile's values. A user can enable a proxy in Network settings, navigate back to change the storage location, then return and press Start without reopening that popup. If the destination profile has no proxy configured, the earlier choice no longer applies. Retaining every edit, as base did, could instead weaken the destination profile's privacy, so keep the profile-isolation behavior. Show a notice on the Connection step when switching directories has discarded edited network settings.


Link

[suggestion] · Manual-pruning help replaces the disabled switch's lock explanation

With command-line -prune=1 on an existing profile, the disabled Store recent blocks only switch tells the user to turn it on instead of explaining its command-line lock.

Location: qml/pages/settings/StorageSettingsPage.qml:42 (head).

Details and suggested fix

The new supportingText condition checks onboarding, keepingCurrentStorage and a saved target of 1, but not pruneSetting.canEdit. Command-line -prune=1 satisfies that condition while making the switch non-editable, so the manual-pruning instructions replace its infoText. The popup remains accessible, and the block-storage-limit row below still shows the lock explanation. Add root.pruneSetting.canEdit to the manual-help condition so a locked switch retains the explanation of how to make it editable.


Link

[suggestion] · The sizing-test commit claims a production change and depends on an unrelated test hook

a5931d7 describes a layout-sizing change but only adds a test, whose optionButtonHeader lookup depends on a hook placed in the earlier highlight-animation commit.

Location: qml/controls/OptionButton.qml:81 at ec48c8a887d2 (commit) (commit).

Details and suggested fix

ec48c8a887d2b458176c92feffe081d21168b582 changes the color animation and adds objectName: "optionButtonHeader". The later a5931d7a606146196a95d9d8c6275162405e2eb1 changes only test/qml/tst_formcontrols.qml, adding the test that consumes that hook. The title and description say the latter commit sizes text directly in a layout, but that layout is already present at base. Move the hook into a5931d7a606146196a95d9d8c6275162405e2eb1 and describe the commit as a regression test for existing sizing. This keeps the hook and its test together and lets the highlight change stand independently.


Link

[suggestion] · Storage-card corrections are interleaved with unrelated changes

The storage-card workflow introduced in ab4dbbd is corrected across several later commits, requiring reviewers to reconstruct selection bindings and warning behavior through intermediate implementations.

Location: qml/components/StorageOptions.qml:91 at 7de892dc8022 (commit) (commit).

Details and suggested fix

ab4dbbd4adae9dd39accc7a6df8e3b7cbb279b6a introduces the cards; 66262b3e5f9d587f03f19f97337cb1835c8f19e3 repairs popup/Custom selection, and 7de892dc8022c09c30eae3b2cb31cfb974f9546e only changes its unconditional redownload wording from “Requires” to “May require”. Fold that warning-only fixup, and separable selection-fix hunks, into the introducing commit. Group the dependent exact-restoration and native-activation fixes, 2eb2a803abf473d12f541a9b3fadd20c68843b5a and 744d3a044a06ba02c985a3dcb884f3f8ab5cfbe9, immediately after 182c9b0ccda890bfa0aa332bdb16458564206526, which introduces integer-commit APIs and test files they use. Keep 63a406f17251975198a962445840ded020449c48 separate if the cross-profile reset should stand alone. This makes the storage workflow easier to validate without reviewing superseded warnings and bindings; it concerns series organization, not defects remaining at head.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

Pruning separates full validation from archival storage. Blocks can be deleted after validation has constructed the block index and UTXO state, reducing the disk cost of operating a validating node. The tradeoff is losing local historical data needed for activities such as wallet rescans, historical queries and serving old blocks. The pruning target covers block and undo files, not all databases, and retaining recent blocks can take precedence over that target.

This explains why reduced storage can be offered as a normal operating mode rather than reduced validation, why its description should disclose deletion of older data, and why Custom's total estimate includes chainstate in addition to its block-storage target. The original release notes describe historical wallet restrictions, not the current wallet-support contract.

Source 1

Pruning has an asymmetric reversal cost: changing a setting cannot recreate block files already deleted. The original pruning documentation explicitly warned that returning to unpruned operation after pruning requires downloading the blockchain again.

This is the historical basis for warning before selecting full storage for a pruned profile. At the unchanged pinned Core revision, startup requires rebuilding specifically when the database records that blocks were actually pruned and the requested mode is now unpruned. That distinction matters to the conditional wording: a configured positive prune value alone does not prove deletion has occurred.

Source 1

The historical onboarding pruning recommendation was a capacity-aware default, not an unconditional preference. Core's 2019 proposal selected pruning when space was insufficient or barely sufficient, including a growth margin, while leaving it unselected on large disks. Its 2 GB default matched the existing settings default, and configured startup pruning disabled the chooser.

This explains the inherited 2 GB reduced-storage choice and the tension between easier onboarding on constrained disks and retaining an archive when capacity permits. It also provides context for distinguishing a recommendation for a fresh profile from the configured setting of an existing profile.

Source 1

Onboarding recommendations historically had to yield to explicit choices, and displayed settings had to reach actual node startup. A 2022 Core change explicitly stopped automatic space checks from changing the prune checkbox after user interaction. The earlier onboarding proposal also documented that changing QSettings alone could make the dialog look correct without enabling pruning for the current startup, or could overwrite a saved choice on a later launch.

This supplies precedent for tracking explicit edits separately from defaults and checking the eventual backend setting rather than only card selection. The current model's keep-current and exact-restoration paths operate at that same boundary between displayed state, touched settings and startup arguments.

Source 1 · Source 2 · Source 3

The application's earlier onboarding design deliberately isolated preview from live startup configuration and bound changes to a resolved profile. Its stated motivations included avoiding a second configuration read selecting a different datadir, delaying resets until the active profile was known, leaving settings unchanged on cancellation, and rejecting apply when the target profile had changed.

This explains why datadir selection is more than a remembered folder preference: it selects the configuration and privacy settings that will govern startup. Resetting touched choices when changing directories follows this profile-isolation constraint; otherwise a choice made while viewing one profile could become an override in another.

Source 1

Core removed its historical dbcache ceiling because UTXO growth made the old 16 GB limit insufficient for users wanting initial synchronization with the UTXO set held in RAM. This was configurability, not a recommendation to consume arbitrary memory: the proposal assigned RAM sizing responsibility to users, while discussion raised OOM, long flushes and loss of unpersisted synchronization work as countervailing risks.

The pinned Core Qt dialog already permits database-cache values through the integer maximum. That history explains why a GUI-owned limit based on an internal database-cache allocation constant is not necessarily the intended user-facing dbcache limit. Minimum-only guidance is consistent with the absence of the old fixed ceiling, but does not establish that every accepted value is operationally suitable.

Source 1 · Source 2 · Source 3

Ralph's inferences

Preserving an existing pruning configuration requires retaining both its mode and its exact serialized target; a rounded GB display is not an equivalent representation.

Pinned Core defines 0 as unpruned, 1 as manual pruning, and larger valid targets as automatic pruning in MiB. Its legacy GUI boolean intentionally treats manual pruning as disabled for that control. The application's MiB-to-GB conversion rounds upward, so reconstructing a saved MiB target from the displayed GB value can change it. These contracts explain the separate manual label, raw current target and untouched-setting restoration.

A fresh-download estimate and the additional free space needed by an existing profile answer different questions.

Existing block files and databases may already account for much of the required storage, while lowering a pruning target need not allocate that target again. This explains the distinction between an advisory full-download estimate and permission to retain or lower existing storage settings. It does not establish that a particular existing profile has enough space for every future operation.

Locale-aware validation and complete integer parsing serve the same user-intent constraint: the value committed should be the complete quantity entered, rather than a JavaScript numeric prefix or a silently rewritten input.

The base DeveloperOptions path used QML IntValidator followed by parseInt. The head passes the validator's locale to QLocale::toInt, checks bounds before mutation, and overrides fixup to retain rejected text. This is a code-based explanation, not independently established Qt history. The build requires Qt 6.2 or newer; QML import version 2.15 does not identify the deployed Qt implementation.