Storage settings change pruning values after toggling and misrepresent manual pruning #1075

Open
opened 2026-11-05 15:16:43 +00:00 by jarolrod · 1 comment
jarolrod commented 2026-11-05 15:16:43 +00:00 (Migrated from github.com)

The Storage page can change the effective pruning configuration even when the user returns the switch to its original position. It also displays manual pruning as disabled. In both cases, the restart notice disappears despite a saved configuration change.

These are QML settings representation and persistence problems. Core’s requirement to rebuild when returning to unpruned mode after deleting historical blocks is expected behavior.

1. Toggling off and on changes the pruning target

  1. Start with prune=550 in bitcoin.conf, without a GUI pruning override.
  2. Open Settings → Storage. “Store recent blocks only” is enabled and the target displays as 1 GB.
  3. Switch it off, then back on without editing the target.
  4. Restart the application.

The GUI saves prune=953 in settings.json, overriding the original 550 MiB target. The restart notice disappears after the second click, although the effective setting has changed. After restarting, getblockchaininfo.prune_target_size confirms 953 MiB instead of 550 MiB.

The displayed whole-GB value is converted back into a different MiB value. Returning the switch to its original state should preserve the original target.

2. Manual pruning appears disabled and can be overwritten

  1. Start with prune=1 in bitcoin.conf, without a GUI pruning override.
  2. Open Settings → Storage.
  3. Switch “Store recent blocks only” on, then off.

The switch initially appears off, although Core reports pruned: true and automatic_pruning: false. After the two clicks, the GUI saves prune=0 and removes the restart notice.

This changes manual pruning to unpruned mode while making the page appear unchanged.

3. Disabling pruning lacks an advance warning and a recovery option

On a node that has actually removed historical block files:

  1. Turn “Store recent blocks only” off.
  2. Observe that the page shows only the generic restart notice.
  3. Restart, choose Abort at the rebuild prompt, then launch again.

Startup correctly warns that rebuilding will redownload the blockchain and asks for confirmation. However, Abort leaves the saved change intact, so the next launch repeats the prompt. There is no “Keep pruning” option. Restoring the previous pruning setting allows the existing chain to load normally.

Expected behavior

  • Preserve the exact pruning target when toggling off and back on.
  • Represent manual pruning explicitly.
  • Show a restart notice whenever the effective saved configuration differs from the running configuration.
  • Warn about rebuilding and redownloading before saving a change to unpruned mode.
  • Provide a way to retain or restore pruning without manually editing configuration files.

Reproduced on qt6 at 6e54a48ab571, using macOS arm64, Qt 6.9.0, and offscreen regtest automation. The third case used a node with confirmed block-file removal.

The Storage page can change the effective pruning configuration even when the user returns the switch to its original position. It also displays manual pruning as disabled. In both cases, the restart notice disappears despite a saved configuration change. These are QML settings representation and persistence problems. Core’s requirement to rebuild when returning to unpruned mode after deleting historical blocks is expected behavior. **1. Toggling off and on changes the pruning target** 1. Start with `prune=550` in `bitcoin.conf`, without a GUI pruning override. 2. Open Settings → Storage. “Store recent blocks only” is enabled and the target displays as 1 GB. 3. Switch it off, then back on without editing the target. 4. Restart the application. The GUI saves `prune=953` in `settings.json`, overriding the original 550 MiB target. The restart notice disappears after the second click, although the effective setting has changed. After restarting, `getblockchaininfo.prune_target_size` confirms 953 MiB instead of 550 MiB. The displayed whole-GB value is converted back into a different MiB value. Returning the switch to its original state should preserve the original target. **2. Manual pruning appears disabled and can be overwritten** 1. Start with `prune=1` in `bitcoin.conf`, without a GUI pruning override. 2. Open Settings → Storage. 3. Switch “Store recent blocks only” on, then off. The switch initially appears off, although Core reports `pruned: true` and `automatic_pruning: false`. After the two clicks, the GUI saves `prune=0` and removes the restart notice. This changes manual pruning to unpruned mode while making the page appear unchanged. **3. Disabling pruning lacks an advance warning and a recovery option** On a node that has actually removed historical block files: 1. Turn “Store recent blocks only” off. 2. Observe that the page shows only the generic restart notice. 3. Restart, choose Abort at the rebuild prompt, then launch again. Startup correctly warns that rebuilding will redownload the blockchain and asks for confirmation. However, Abort leaves the saved change intact, so the next launch repeats the prompt. There is no “Keep pruning” option. Restoring the previous pruning setting allows the existing chain to load normally. **Expected behavior** - Preserve the exact pruning target when toggling off and back on. - Represent manual pruning explicitly. - Show a restart notice whenever the effective saved configuration differs from the running configuration. - Warn about rebuilding and redownloading before saving a change to unpruned mode. - Provide a way to retain or restore pruning without manually editing configuration files. Reproduced on `qt6` at `6e54a48ab571`, using macOS arm64, Qt 6.9.0, and offscreen regtest automation. The third case used a node with confirmed block-file removal.
jarolrod commented 2026-11-13 15:11:39 +00:00 (Migrated from github.com)

The other direction has no warning either. On a node that runs unpruned, one click on Store recent blocks only saves pruning at the click, and nothing on the page says that block files will be deleted or what undoing it costs.

To reproduce, on a node that runs unpruned:

  1. Open Settings → Storage. The switch is off and has no supporting text.
  2. Click Store recent blocks only once, or focus it and press Space.

settings.json gains "prune": "1907" at the click. No confirmation opens, and the only new text is "Restart the application for these changes to take effect." The next start comes up in prune mode with no question: pruned is true, prune_target_size is 1999634432, and NETWORK is no longer advertised.

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/pages/settings/StorageSettingsPage.qml (L64-L75)

Bitcoin-Qt, by its source, shows this sentence in red when its prune box is clicked, repeats it in the box's tooltip, and saves nothing until OK (optionsdialog.ui#L94-L96):

Reverting this setting requires re-downloading the entire blockchain.

By Core's source, a node that holds more than the target removes its old block files during that first start, and returning to unpruned mode then means the rebuild in case 3 above. I did not observe the deletion: the test chain had 200 blocks, far below the target, and its block files were unchanged.

Until the restart, a second click undoes the change completely: prune is removed, prune-prev is left, and the next start is unpruned.

#1050 at f68f5bf24c50 does not add this, by its diff. Its "May require downloading the full blockchain again." is on the full-storage card only, for a profile that is already pruned. The first-run wizard has no such sentence for reduced storage either, so no surface of the app warns in this direction.

The switch does what its label says, so this is a missing sentence, not a malfunction. A line at the switch like Bitcoin-Qt's would cover it.

Reproduced on qt6 at 2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen and native, and offscreen at eed1f426fcb6. The click and the Space key went through the test bridge; I did not click the switch by hand. Bitcoin-Qt was read, not run.

The other direction has no warning either. On a node that runs unpruned, one click on **Store recent blocks only** saves pruning at the click, and nothing on the page says that block files will be deleted or what undoing it costs. To reproduce, on a node that runs unpruned: 1. Open **Settings → Storage**. The switch is off and has no supporting text. 2. Click **Store recent blocks only** once, or focus it and press Space. `settings.json` gains `"prune": "1907"` at the click. No confirmation opens, and the only new text is "Restart the application for these changes to take effect." The next start comes up in prune mode with no question: `pruned` is true, `prune_target_size` is 1999634432, and `NETWORK` is no longer advertised. https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/pages/settings/StorageSettingsPage.qml#L64-L75 Bitcoin-Qt, by its source, shows this sentence in red when its prune box is clicked, repeats it in the box's tooltip, and saves nothing until OK ([optionsdialog.ui#L94-L96](https://github.com/bitcoin/bitcoin/blob/44901d8f64cb617714707bd025ecd83f108353c2/src/qt/forms/optionsdialog.ui#L94-L96)): > Reverting this setting requires re-downloading the entire blockchain. By Core's source, a node that holds more than the target removes its old block files during that first start, and returning to unpruned mode then means the rebuild in case 3 above. I did not observe the deletion: the test chain had 200 blocks, far below the target, and its block files were unchanged. Until the restart, a second click undoes the change completely: `prune` is removed, `prune-prev` is left, and the next start is unpruned. #1050 at `f68f5bf24c50` does not add this, by its diff. Its "May require downloading the full blockchain again." is on the full-storage card only, for a profile that is already pruned. The first-run wizard has no such sentence for reduced storage either, so no surface of the app warns in this direction. The switch does what its label says, so this is a missing sentence, not a malfunction. A line at the switch like Bitcoin-Qt's would cover it. Reproduced on `qt6` at `2bd5a61e8304`, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen and native, and offscreen at `eed1f426fcb6`. The click and the Space key went through the test bridge; I did not click the switch by hand. Bitcoin-Qt was read, not run.
Sign in to join this conversation.
No description provided.