mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Connection settings can save overrides that prevent the next startup #1074
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1074
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Connection settings pages allow changes that conflict with existing startup options. The change is saved with a restart notice, but the resulting configuration prevents the node from starting on subsequent launches.
Core correctly rejects these combinations. QML should detect the conflict before persisting the override and provide a way to recover if startup fails.
Disabling listening while another option requires it
bind=127.0.0.1in itsbitcoin.confnetwork section.QML writes
"listen": falsetosettings.json. The next startup fails with:Cannot set -bind or -whitebind together with -listen=0The page recognizes that listening was adjusted by related startup options, but still permits the incompatible override.
The same problem occurs with
whitebind. With explicitlistenonion=1, disabling listening instead produces:Cannot set -listen=0 together with -listenonion=1Disabling the Tor proxy in a Tor-only configuration
[regtest]:onion=127.0.0.1:9050onlynet=onionQML writes
"onion": false, which Core interprets as-onion=0. Startup then fails because outbound connections are restricted to Tor while reaching Tor has been explicitly disabled.There is also a default-proxy variant: with
proxy=127.0.0.1:9050,onlynet=onion, andlistenonion=0, disabling the default proxy leaves no configured Tor route and prevents startup. This condition matters: the control with listening andlistenonionenabled started successfully.The same controls are available during onboarding, where they can persist an incompatible override before the first node startup.
Expected behavior and responsibility
Before saving, QML should check the resulting effective configuration, including related options from
bitcoin.conf. It should explain the conflict and prevent saving a combination Core cannot start with.The proxy controls should also distinguish disabling a dedicated Tor proxy from disabling Tor connectivity, particularly when Tor is the only permitted network.
If a saved GUI override prevents startup, the error flow should offer a way to undo that override and retry. In the reproductions, manually removing the offending key from
settings.jsonrestored startup.The defect is in QML’s settings checks and recovery flow. Core’s rejection of the incompatible configuration is expected behavior.
Reproduced on
qt6atd567e3eb2497, macOS arm64, Qt 6.9.0, offscreen and in the native GUI, using disposable regtest profiles.The startup-recovery work here should also cover a saved proxy hostname that cannot resolve. This case can occur without a conflicting option combination.
On
qt6at6e54a48ab571, using a disposable regtest profile:nosuchhost.invalid:9050, and save.The saved value produces:
The error dialog offers only OK. Acknowledging it shuts the application down, leaving the saved value in place and no GUI route back to edit it. Removing that test profile's
proxysetting manually restores startup. The control usinglocalhost:9050starts normally and resolves the proxy to127.0.0.1:9050.Hostname support is intentional, and Core's refusal to use an unresolved proxy is expected. The missing piece is a GUI recovery path: let the user correct the saved address or retry after resolution becomes available, while preserving the configured routing until they explicitly change it. Checking DNS when saving cannot guarantee it will resolve at a later startup.
#883 handles earlier configuration and settings-file failures; its current changes do not add recovery for this later proxy-resolution failure. This fits the recovery work already requested here rather than needing a separate issue.
The effective-configuration checks here should also cover the Mempool size limit. With the nondefault debug option
limitclustersize=250, the GUI accepts and saves 9 MB, but the next startup requires at least 10 MB.To reproduce:
limitclustersize=250in its network configuration and nomaxmempooloverride. The node starts with the usual 300 MB limit.regtest/settings.jsoncontains"maxmempool": 9.Startup fails with:
With the same cluster policy, 10 MB saves and restarts successfully. With the default policy, 9 MB saves and restarts successfully, while the editor correctly refuses 4 MB. The failure depends on the nondefault cluster-size setting.
Core correctly checks the minimum against the effective cluster size. QML derives its lower bound from the compiled default, so its validator and commit handler accept a value that the configured node cannot use.
The editor should use the effective minimum before saving. This also belongs in the startup-recovery work requested here, so an invalid GUI override can be corrected without manually editing the settings file.
Reproduced on
qt6at6e54a48ab571, macOS / Qt 6.9, using the full offscreen app and isolated regtest profiles. Current mergedeed1f426fcb6still has the same mismatch between QML's static bound and Core's effective-policy check; that later revision was checked in source, not rerun for this case.The recovery work here should also cover a start that fails at the end of onboarding. The wizard cannot be resumed, and the choices made in it are lost.
To reproduce on a regtest profile:
chmod 0555 <datadir>/regtest).An alert in the wizard says "There was an issue starting up." with "Unable to open settings file …/regtest/settings.json.tmp for writing" and a single Close, which exits with status 1. (At
2bd5a61e8304, before #1052, there was no message: the wizard stayed a black screen with a spinner, and the process was still alive 10 s later.) Nothing is written: there is nosettings.json, and the chosen folder is not remembered. After quitting, restoring the permission and starting again, the wizard begins at its cover with Default and Store all data selected, and has to be walked again. 3 of 3, and the same ateed1f426fcb6.A failed start shows the error in the wizard and then exits, with no way back to the wizard:
github.com/bitcoin-core/gui-qml@efc4a2c754/qml/bitcoin.cpp (L537-L545)Reach is small. A chosen folder that is itself read-only is refused on the location page, so on mainnet this is caught before Start; only a network sub-folder slips through. When the folder is held by another node, the choices are written before the failure and the next start goes straight to the main window. #883 at
976e00e4826cand #1050 atf68f5bf24c50do not add a way back to the wizard, by their diffs.Reproduced on
qt6at2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen only. Atefc4a2c754ebI read the alert and clicked Close through the test bridge (one run); at2bd5a61e8304I read the error from stderr only. Clicks went through the test bridge, and the custom folder was passed with the call the folder dialog makes.