Settings: Grouped numbers save a smaller storage or mempool limit #1002

Open
opened 2026-10-12 05:03:59 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-10-12 05:03:59 +00:00 (Migrated from github.com)

I reproduced the storage limit accepting 1,000 GB and saving 1 GB. The mempool limit also accepts 10,000 MB and saves 10 MB. Neither field reports a validation error.

To reproduce with an en_US locale and a disposable regtest profile:

  1. Open Settings → Storage and enable “Store recent blocks only.”
  2. Replace the block storage limit with 1,000, then press Enter.
  3. Observe that the field changes to 1.
  4. Open Mempool information, enter 10,000 as the size limit and press Enter.
  5. Observe that it changes to 10.
  6. Inspect the saved settings.json.

The recorded settings were "prune":"953" and "maxmempool":10. Entering ungrouped 1000 in the storage field correctly saved "prune":"953674".

Qt's validator accepts the grouping separator, while the save handlers use parseInt, which stops at the comma. We should accept the same number syntax in validation and conversion. Grouped and ungrouped input should save the same value, or unsupported formatting should be rejected before saving.

Tested on qt6 at 09c6de77d7f36bf7fa07c354ebeea51105c447a3, macOS arm64, Qt 6.9.0. The offscreen reproduction used actual key events, with test-driver support added for comma and Enter. The production validators, setting handlers and backend were unchanged. I checked the saved values; I didn't run a pruning or mempool-eviction experiment.

I reproduced the storage limit accepting `1,000` GB and saving 1 GB. The mempool limit also accepts `10,000` MB and saves 10 MB. Neither field reports a validation error. To reproduce with an `en_US` locale and a disposable regtest profile: 1. Open Settings → Storage and enable “Store recent blocks only.” 2. Replace the block storage limit with `1,000`, then press Enter. 3. Observe that the field changes to `1`. 4. Open Mempool information, enter `10,000` as the size limit and press Enter. 5. Observe that it changes to `10`. 6. Inspect the saved `settings.json`. The recorded settings were `"prune":"953"` and `"maxmempool":10`. Entering ungrouped `1000` in the storage field correctly saved `"prune":"953674"`. Qt's validator accepts the grouping separator, while the save handlers use `parseInt`, which stops at the comma. We should accept the same number syntax in validation and conversion. Grouped and ungrouped input should save the same value, or unsupported formatting should be rejected before saving. Tested on `qt6` at `09c6de77d7f36bf7fa07c354ebeea51105c447a3`, macOS arm64, Qt 6.9.0. The offscreen reproduction used actual key events, with test-driver support added for comma and Enter. The production validators, setting handlers and backend were unchanged. I checked the saved values; I didn't run a pruning or mempool-eviction experiment.
Sign in to join this conversation.
No description provided.