Keep onboarding, settings and the block clock responsive #981

Manually merged
johnny9 merged 10 commits from pr/qt6-async-02-settings-blockclock into qt6 2026-11-03 17:04:50 +00:00 AGit
johnny9 commented 2026-10-02 21:44:44 +00:00 (Migrated from github.com)

Directory checks, configuration reads, settings writes and chain queries can block the GUI. Move this work, port mapping and network controls to workers. Display cached values, report pending work and errors, and ignore outdated results. Keep onboarding previews separate from live startup configuration.

Load block-clock history during initialization, then update it from block notifications. Combine repeated updates and preserve block identity through reorganizations. Update the clock hand each minute without requiring a new block.

Drain workers and release notification subscriptions during shutdown. Restore transaction-diagram cleanup when its component is destroyed.

Completed node-status reads now publish before any follow-up refresh, so overlapping connection and warning notifications cannot starve the visible state. Network notifications remain authoritative over older query results. Gated regression tests cover continuous overlap and a network change during a blocked read.

Keep signer error translations in their existing model context. Show neutral feedback while a new signer path is validated, and defer keyboard/focus-loss checks until validation and saving finish. Disable only settings-editing section stacks during options work, including retained Proxy and Language pages; wallet, console, debug-log and read-only node views remain usable.

Use the same legacy language fallback as startup, including explicit System default and command-line precedence. A first preparation request after shutdown reports failure asynchronously. Accepted preparation keeps its completion during shutdown, and shutdown notification follows all preparation observers so owner cleanup is safe.

Validation at 92fa3864a136: full build, all seven relevant non-QML CTest groups and four startup/shutdown/onboarding functional suites pass. QML sources, resources and fixtures are byte-identical to the previous full-suite pass at dd662d41. The updated AsyncOptions and OnboardingAsync classes pass 32 cases under strict LLVM 22 ASan/LSan/UBSan/integer and 32 under TSan, with only pinned Core suppressions. Matching LLVM 22/Bitcoin-plugin checks pass. Old production fails two language and seven shutdown rows; the simpler early-drain variant also fails the owner-deletion regression.

A supplemental current-head ASAN GUI SIGINT check timed out twice at the standard process-exit deadline. Core shutdown and tracked workers completed, and a separate quiescent diagnostic exited cleanly in 21.884 seconds. The intermittent cause remains unproven; this is not counted as a clean standard sanitizer lifecycle pass. No Core assertion or executable-wide suppression was added.

The standalone checkout lacks the requested top-level CI drivers. Configured rootless Docker is available; Core-only fallback attempts are partial and do not validate parent GUI-QML. The IPC-enabled standalone GUI uses a local node factory; actual Core multiprocess IPC lifecycle remains untested and interface_gui.py is absent.

Fixes #960
Fixes #961
Fixes #962

Directory checks, configuration reads, settings writes and chain queries can block the GUI. Move this work, port mapping and network controls to workers. Display cached values, report pending work and errors, and ignore outdated results. Keep onboarding previews separate from live startup configuration. Load block-clock history during initialization, then update it from block notifications. Combine repeated updates and preserve block identity through reorganizations. Update the clock hand each minute without requiring a new block. Drain workers and release notification subscriptions during shutdown. Restore transaction-diagram cleanup when its component is destroyed. Completed node-status reads now publish before any follow-up refresh, so overlapping connection and warning notifications cannot starve the visible state. Network notifications remain authoritative over older query results. Gated regression tests cover continuous overlap and a network change during a blocked read. Keep signer error translations in their existing model context. Show neutral feedback while a new signer path is validated, and defer keyboard/focus-loss checks until validation and saving finish. Disable only settings-editing section stacks during options work, including retained Proxy and Language pages; wallet, console, debug-log and read-only node views remain usable. Use the same legacy language fallback as startup, including explicit System default and command-line precedence. A first preparation request after shutdown reports failure asynchronously. Accepted preparation keeps its completion during shutdown, and shutdown notification follows all preparation observers so owner cleanup is safe. Validation at `92fa3864a136`: full build, all seven relevant non-QML CTest groups and four startup/shutdown/onboarding functional suites pass. QML sources, resources and fixtures are byte-identical to the previous full-suite pass at dd662d41. The updated AsyncOptions and OnboardingAsync classes pass 32 cases under strict LLVM 22 ASan/LSan/UBSan/integer and 32 under TSan, with only pinned Core suppressions. Matching LLVM 22/Bitcoin-plugin checks pass. Old production fails two language and seven shutdown rows; the simpler early-drain variant also fails the owner-deletion regression. A supplemental current-head ASAN GUI SIGINT check timed out twice at the standard process-exit deadline. Core shutdown and tracked workers completed, and a separate quiescent diagnostic exited cleanly in 21.884 seconds. The intermittent cause remains unproven; this is not counted as a clean standard sanitizer lifecycle pass. No Core assertion or executable-wide suppression was added. The standalone checkout lacks the requested top-level CI drivers. Configured rootless Docker is available; Core-only fallback attempts are partial and do not validate parent GUI-QML. The IPC-enabled standalone GUI uses a local node factory; actual Core multiprocess IPC lifecycle remains untested and interface_gui.py is absent. Fixes #960 Fixes #961 Fixes #962
jarolrod (Migrated from github.com) reviewed 2026-10-04 16:47:17 +00:00
jarolrod (Migrated from github.com) commented 2026-10-04 16:47:17 +00:00

This introduces a regression when selecting the same directory again after fixing its permissions.

I tested this on macOS with Qt 6.9 by picking a directory that wasn't writable, making it writable, then picking it again without restarting the GUI. On the #980 parent (52a80426831e) that works. Here, the old error sticks around and clicking Start on the last screen does nothing. Picking a different directory first gets around it.

Looks like we now update m_data_dir before validation finishes, so selecting it again hits the unchanged-path return in setDataDir() and never checks it again.

Could we refresh the preview when someone explicitly picks the same directory? I tried dropping the source_changed check for that case and it works. Would be good to add a test for this too.

This introduces a regression when selecting the same directory again after fixing its permissions. I tested this on macOS with Qt 6.9 by picking a directory that wasn't writable, making it writable, then picking it again without restarting the GUI. On the #980 parent (`52a80426831e`) that works. Here, the old error sticks around and clicking Start on the last screen does nothing. Picking a different directory first gets around it. Looks like we now update `m_data_dir` before validation finishes, so selecting it again hits the unchanged-path return in `setDataDir()` and never checks it again. Could we refresh the preview when someone explicitly picks the same directory? I tried dropping the `source_changed` check for that case and it works. Would be good to add a test for this too.
jarolrod (Migrated from github.com) reviewed 2026-10-05 00:01:54 +00:00
jarolrod (Migrated from github.com) left a comment

One small follow-up from testing blocked settings writes: opening Node information still waits on the settings lock when reading the datadir and blocks-dir paths.

I forced the write to stall with a FIFO, so this is a stress case. The synchronous reader is also already in the parent; I wouldn’t hold this PR over it.

Those paths don’t change while the node is running, so caching them once would avoid that wait.

One small follow-up from testing blocked settings writes: opening Node information still waits on the settings lock when reading the datadir and blocks-dir paths. I forced the write to stall with a FIFO, so this is a stress case. The synchronous reader is also already in the parent; I wouldn’t hold this PR over it. Those paths don’t change while the node is running, so caching them once would avoid that wait.
jarolrod (Migrated from github.com) reviewed 2026-10-05 00:02:12 +00:00
jarolrod (Migrated from github.com) commented 2026-10-05 00:02:12 +00:00

This is fixed now

This is fixed now
johnny9 commented 2026-10-05 00:13:26 +00:00 (Migrated from github.com)

One small follow-up from testing blocked settings writes: opening Node information still waits on the settings lock when reading the datadir and blocks-dir paths.

Node information fixes are in pr3 of my series to remove work off of the Gui thread. I'll go ahead and rebase it and open that draft

> One small follow-up from testing blocked settings writes: opening Node information still waits on the settings lock when reading the datadir and blocks-dir paths. Node information fixes are in pr3 of my series to remove work off of the Gui thread. I'll go ahead and rebase it and open that draft
johnny9 commented 2026-10-11 13:22:57 +00:00 (Migrated from github.com)

rebased

rebased
jarolrod commented 2026-10-11 23:19:36 +00:00 (Migrated from github.com)

ACK 2eb12ceef2062f336fefab15f66764c3b2826930

ACK 2eb12ceef2062f336fefab15f66764c3b2826930
uqlidi (Migrated from github.com) approved these changes 2026-10-14 20:02:10 +00:00
uqlidi (Migrated from github.com) left a comment

Tested ACK 2eb12ceef2062f336fefab15f66764c3b2826930

works perfect with me and the perf issuses were gone

Tested ACK 2eb12ceef2062f336fefab15f66764c3b2826930 works perfect with me and the perf issuses were gone
hebasto commented 2026-10-14 23:57:47 +00:00 (Migrated from github.com)

Please rebase.

Please rebase.
pseudoramdom (Migrated from github.com) reviewed 2026-10-28 19:41:54 +00:00
pseudoramdom (Migrated from github.com) left a comment

The threading model looks sound to me: state is confined to the GUI thread, workers return owned results, and moving preview off SelectParams() removes a real data race. A few sharp edges in the code that tracks request state, none blocking:

  1. Each model hand-rolls "latest request wins". There are five variants (refreshStatus, runCommand, startPreview, signer validation, network action), each handling failure, rejection and shutdown on its own. The inline defects are all in those paths.
  2. The result of submit() is ignored, and shutdown() drops completions. Today only per-model stopping flags prevent stuck pending state; this breaks once an executor is shared (#990's m_commands).
  3. refreshStatus discards stale results and retries, so it can starve under rapid peer-count changes. Applying the result and refetching once would always converge.
  4. BlockClockHistory calls its callback while holding its mutex. The rule is documented but not enforced; re-entering it would deadlock.
  5. ~OptionsQmlModel spins a nested event loop until the executor drains. That allows re-entrancy and can hang exit if a settings write stalls.

Most of these come from what BackendExecutor leaves to its callers. I opened #1054 to address them in a follow-up, so none of them block this PR.

The threading model looks sound to me: state is confined to the GUI thread, workers return owned results, and moving preview off `SelectParams()` removes a real data race. A few sharp edges in the code that tracks request state, none blocking: 1. **Each model hand-rolls "latest request wins".** There are five variants (`refreshStatus`, `runCommand`, `startPreview`, signer validation, network action), each handling failure, rejection and shutdown on its own. The inline defects are all in those paths. 2. **The result of `submit()` is ignored, and `shutdown()` drops completions.** Today only per-model stopping flags prevent stuck `pending` state; this breaks once an executor is shared (#990's `m_commands`). 3. **`refreshStatus` discards stale results and retries,** so it can starve under rapid peer-count changes. Applying the result and refetching once would always converge. 4. **`BlockClockHistory` calls its callback while holding its mutex.** The rule is documented but not enforced; re-entering it would deadlock. 5. **`~OptionsQmlModel` spins a nested event loop until the executor drains.** That allows re-entrancy and can hang exit if a settings write stalls. Most of these come from what `BackendExecutor` leaves to its callers. I opened #1054 to address them in a follow-up, so none of them block this PR.
pseudoramdom (Migrated from github.com) commented 2026-10-28 19:05:20 +00:00

This now returns bool and reports an error, and OptionsQmlModel::useDefaultDataDir() handles it. The onboarding caller at onboarding_settings.cpp:587 still ignores it.

Marking both Persist*DataDirSelection declarations in datadir.h [[nodiscard]] would stop this from happening again.

This now returns `bool` and reports an error, and `OptionsQmlModel::useDefaultDataDir()` handles it. The onboarding caller at `onboarding_settings.cpp:587` still ignores it. Marking both `Persist*DataDirSelection` declarations in `datadir.h` `[[nodiscard]]` would stop this from happening again.
pseudoramdom (Migrated from github.com) commented 2026-10-28 19:09:05 +00:00

prepareNode() sets m_stopping = true (line 94) to drop in-flight preview results. That makes beginShutdown() return here without connecting drained to shutdownFinished, so a caller waiting on shutdownFinished after node preparation waits forever. Only tests call it today, but registering this model with the shutdown coordinator (as OptionsQmlModel is) would hang shutdown after onboarding.

Suggest separating "ignore results" from "shutdown requested", and handling an executor that has already drained:

void OnboardingOptionsModel::beginShutdown()
{
    if (m_shutdown_requested) return;
    m_shutdown_requested = true;
    m_stopping = true;
    ++m_preview_request_id;
    ++m_storage_request_id;
    if (m_executor->isDrained()) {
        QMetaObject::invokeMethod(this, &OnboardingOptionsModel::shutdownFinished, Qt::QueuedConnection);
    } else {
        connect(m_executor.get(), &BackendExecutor::drained, this, &OnboardingOptionsModel::shutdownFinished);
        m_executor->shutdown();
    }
    Q_EMIT canFinishChanged();
}

A test that calls prepareNode(), waits for nodePrepared, then calls beginShutdown() and expects shutdownFinished would cover it.

`prepareNode()` sets `m_stopping = true` (line 94) to drop in-flight preview results. That makes `beginShutdown()` return here without connecting `drained` to `shutdownFinished`, so a caller waiting on `shutdownFinished` after node preparation waits forever. Only tests call it today, but registering this model with the shutdown coordinator (as `OptionsQmlModel` is) would hang shutdown after onboarding. Suggest separating "ignore results" from "shutdown requested", and handling an executor that has already drained: ```cpp void OnboardingOptionsModel::beginShutdown() { if (m_shutdown_requested) return; m_shutdown_requested = true; m_stopping = true; ++m_preview_request_id; ++m_storage_request_id; if (m_executor->isDrained()) { QMetaObject::invokeMethod(this, &OnboardingOptionsModel::shutdownFinished, Qt::QueuedConnection); } else { connect(m_executor.get(), &BackendExecutor::drained, this, &OnboardingOptionsModel::shutdownFinished); m_executor->shutdown(); } Q_EMIT canFinishChanged(); } ``` A test that calls `prepareNode()`, waits for `nodePrepared`, then calls `beginShutdown()` and expects `shutdownFinished` would cover it.
pseudoramdom (Migrated from github.com) commented 2026-10-28 19:00:55 +00:00

Should we check if these values actually changed and emit only for those that changed?

Should we check if these values actually changed and emit only for those that changed?
pseudoramdom (Migrated from github.com) commented 2026-10-28 19:01:11 +00:00
const bool language_changed = m_language != snapshot.language;
m_language = std::move(snapshot.language);
// ...same pattern for dbcache, mempool, threads, signer, data dir, display unit, urls, money font
if (language_changed) Q_EMIT languageChanged();
```cpp const bool language_changed = m_language != snapshot.language; m_language = std::move(snapshot.language); // ...same pattern for dbcache, mempool, threads, signer, data dir, display unit, urls, money font if (language_changed) Q_EMIT languageChanged(); ```
johnny9 (Migrated from github.com) reviewed 2026-10-29 19:43:30 +00:00
johnny9 (Migrated from github.com) commented 2026-10-29 19:43:30 +00:00

Fixed in fc3b286738. Snapshot properties now notify only when their cached values change. Added signal-count coverage for successful saves and failed-write rollback.

Fixed in fc3b286738e2733abb4279f1525e76ed8b4a9a98. Snapshot properties now notify only when their cached values change. Added signal-count coverage for successful saves and failed-write rollback.
johnny9 (Migrated from github.com) reviewed 2026-10-29 19:43:46 +00:00
johnny9 (Migrated from github.com) commented 2026-10-29 19:43:46 +00:00

Fixed in 768fa973ee. Onboarding now returns the default-directory save error. Both persistence helpers are [[nodiscard]], all existing callers check the result, and a QSettings write-failure test covers this without relying on filesystem permissions.

Fixed in 768fa973eef69921992bd960e1b5a3180b3555d6. Onboarding now returns the default-directory save error. Both persistence helpers are `[[nodiscard]]`, all existing callers check the result, and a QSettings write-failure test covers this without relying on filesystem permissions.
johnny9 (Migrated from github.com) reviewed 2026-10-29 19:43:56 +00:00
johnny9 (Migrated from github.com) commented 2026-10-29 19:43:56 +00:00

Fixed in 8d9fbbd9fe. Shutdown requests now have a separate flag, and an already drained executor queues shutdownFinished. The preparation test checks that shutdown finishes exactly once after success, failure, settings errors and exceptions.

Fixed in 8d9fbbd9fe52ab72feda7080a8239a30497e32fe. Shutdown requests now have a separate flag, and an already drained executor queues `shutdownFinished`. The preparation test checks that shutdown finishes exactly once after success, failure, settings errors and exceptions.
johnny9 commented 2026-10-29 19:44:06 +00:00 (Migrated from github.com)

@pseudoramdom Addressed the three inline findings in the commits above. The executor-wide follow-ups remain in #1054.

Validation for 8d9fbbd9fe: the final tree is identical to the previously validated version. Native and ASan/LSan/UBSan/integer GUI suites, targeted TSan with instrumented Qt, and IPC startup/shutdown/onboarding tests passed. Lint, Clang 22 with the Bitcoin tidy plugin, and both Core sanitizer CI scripts passed; each Core functional run had 461 passes and 12 skips. interface_gui.py is absent, so I ran the QML GUI's lifecycle tests.

@pseudoramdom Addressed the three inline findings in the commits above. The executor-wide follow-ups remain in #1054. Validation for 8d9fbbd9fe52ab72feda7080a8239a30497e32fe: the final tree is identical to the previously validated version. Native and ASan/LSan/UBSan/integer GUI suites, targeted TSan with instrumented Qt, and IPC startup/shutdown/onboarding tests passed. Lint, Clang 22 with the Bitcoin tidy plugin, and both Core sanitizer CI scripts passed; each Core functional run had 461 passes and 12 skips. `interface_gui.py` is absent, so I ran the QML GUI's lifecycle tests.
First-time contributor

🟠 Minor · An empty -lang leaves the saved startup translation installed

With a saved GUI language and explicitly empty -lang, the async snapshot reports System default without removing the saved startup translation, leaving the session in the wrong language.

Location: qml/bitcoin.cpp:852 (head).

🟠 Minor · Blocksonly startup temporarily exposes the Mempool settings section

With -blocksonly, the initially true availability cache exposes Mempool settings until a post-initialization status snapshot arrives; initialization failure leaves the value uncorrected for the application's remaining lifetime.

Location: qml/models/nodemodel.cpp:299 (head).

🔵 Suggestion · The onboarding shutdown contract has no production caller

The new beginShutdown() and shutdownFinished contract adds lifecycle branches and tests, but the production owner still destroys the onboarding model directly.

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

Review coverage was incomplete.


Reviewed: 19472d4944f1 · Full review report · Previous reports

permalink

<!-- ralph:bitcoin-core/gui-qml --> <!-- ralph-engine:current:965af1044d9e41839565702e4d9bd0a751eda81f6e8b6402747fa296ef84ebea:f7677f01bbeeeda2e9dfb365f1407384e31618edbeddff6daa5ff425bb8651e2 --> <!-- ralph-base:6cdad5344018f35e8c33c77a23f6ba996d507549 --> <!-- ralph-head:19472d4944f19cc34aa8481b53e4391ef1cdc55a --> <!-- ralph-case:704b86bb162726c7195ee0d6621741f848be446c55050da6c8efad8f9a4f2f7f --> **🟠 Minor · An empty -lang leaves the saved startup translation installed** With a saved GUI language and explicitly empty `-lang`, the async snapshot reports System default without removing the saved startup translation, leaving the session in the wrong language. Location: [`qml/bitcoin.cpp:852`](<https://git.fish.foo/bitcoin-core/gui-qml/src/commit/19472d4944f19cc34aa8481b53e4391ef1cdc55a/qml/bitcoin.cpp#L852>) (head). **🟠 Minor · Blocksonly startup temporarily exposes the Mempool settings section** With `-blocksonly`, the initially true availability cache exposes Mempool settings until a post-initialization status snapshot arrives; initialization failure leaves the value uncorrected for the application's remaining lifetime. Location: [`qml/models/nodemodel.cpp:299`](<https://git.fish.foo/bitcoin-core/gui-qml/src/commit/19472d4944f19cc34aa8481b53e4391ef1cdc55a/qml/models/nodemodel.cpp#L299>) (head). **🔵 Suggestion · The onboarding shutdown contract has no production caller** The new `beginShutdown()` and `shutdownFinished` contract adds lifecycle branches and tests, but the production owner still destroys the onboarding model directly. Location: [`qml/models/onboardingoptionsmodel.cpp:69`](<https://git.fish.foo/bitcoin-core/gui-qml/src/commit/19472d4944f19cc34aa8481b53e4391ef1cdc55a/qml/models/onboardingoptionsmodel.cpp#L69>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`19472d4944f1`](<https://git.fish.foo/bitcoin-core/gui-qml/commit/19472d4944f19cc34aa8481b53e4391ef1cdc55a>) · [Full review report](<https://review.fish.foo/traces/gui/981-19472d4944f19cc34aa8481b53e4391ef1cdc55a-2000-5.html>) · [Previous reports](<https://review.fish.foo/traces/981/>) [permalink](<https://review.fish.foo/traces/gui/981-19472d4944f19cc34aa8481b53e4391ef1cdc55a-2000-5.html>)
rreview commented 2026-11-01 21:44:24 +00:00 (Migrated from github.com)

🟠 Minor · A new onboarding directory temporarily shows the previous directory's error

After a failed preview, selecting another custom directory displays the previous error against the new path and hides the storage-checking message until the new preview completes.

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

🟠 Minor · An empty -lang leaves the saved startup translation installed

With an empty -lang=, bitcoin.cpp:572 falls back to the saved QSettings language, but readSnapshot treats the present option as System default. m_language also starts empty, so no languageChanged fires and the saved translation stays installed.

Location: qml/bitcoin.cpp:572 (head).

🟠 Minor · Blocksonly startup temporarily exposes the Mempool settings section

nodemodel.h:244 defaults mempoolInformationAvailable to true, and only refreshStatus corrects it. refreshStatus is suppressed until initialization succeeds, so with -blocksonly the Mempool section shows during startup and stays after a failed initialization.

Location: qml/models/nodemodel.h:244 (head).

🔵 Suggestion · The onboarding shutdown contract has no production caller

The new explicit onboarding shutdown state machine is exercised only by tests, while the production owner resets the model directly.

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

🔵 Suggestion · The initial language snapshot repeats QML translation work

When the initial snapshot matches a nonempty startup language, it still reinstalls translators and retranslates the engine.

Location: qml/bitcoin.cpp:851 (head).

Review coverage was incomplete.


Reviewed: a1bbbfde6536 · Full review report

<!-- ralph-major:bitcoin-core/gui-qml --> **🟠 Minor · A new onboarding directory temporarily shows the previous directory's error** After a failed preview, selecting another custom directory displays the previous error against the new path and hides the storage-checking message until the new preview completes. Location: [qml/models/onboardingoptionsmodel.cpp:161](<https://github.com/bitcoin-core/gui-qml/blob/a1bbbfde6536fbbf406377e3bb3184e01dbc0669/qml/models/onboardingoptionsmodel.cpp#L161>) (head). **🟠 Minor · An empty -lang leaves the saved startup translation installed** With an empty `-lang=`, bitcoin.cpp:572 falls back to the saved QSettings language, but readSnapshot treats the present option as System default. m_language also starts empty, so no languageChanged fires and the saved translation stays installed. Location: [qml/bitcoin.cpp:572](<https://github.com/bitcoin-core/gui-qml/blob/a1bbbfde6536fbbf406377e3bb3184e01dbc0669/qml/bitcoin.cpp#L572>) (head). **🟠 Minor · Blocksonly startup temporarily exposes the Mempool settings section** nodemodel.h:244 defaults mempoolInformationAvailable to true, and only refreshStatus corrects it. refreshStatus is suppressed until initialization succeeds, so with -blocksonly the Mempool section shows during startup and stays after a failed initialization. Location: [qml/models/nodemodel.h:244](<https://github.com/bitcoin-core/gui-qml/blob/a1bbbfde6536fbbf406377e3bb3184e01dbc0669/qml/models/nodemodel.h#L244>) (head). **🔵 Suggestion · The onboarding shutdown contract has no production caller** The new explicit onboarding shutdown state machine is exercised only by tests, while the production owner resets the model directly. Location: [qml/models/onboardingoptionsmodel.cpp:69](<https://github.com/bitcoin-core/gui-qml/blob/a1bbbfde6536fbbf406377e3bb3184e01dbc0669/qml/models/onboardingoptionsmodel.cpp#L69>) (head). **🔵 Suggestion · The initial language snapshot repeats QML translation work** When the initial snapshot matches a nonempty startup language, it still reinstalls translators and retranslates the engine. Location: [qml/bitcoin.cpp:851](<https://github.com/bitcoin-core/gui-qml/blob/a1bbbfde6536fbbf406377e3bb3184e01dbc0669/qml/bitcoin.cpp#L851>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`a1bbbfde6536`](<https://github.com/bitcoin-core/gui-qml/commit/a1bbbfde6536fbbf406377e3bb3184e01dbc0669>) · [Full review report](<https://review.fish.foo/traces/gui/981-a1bbbfde6536fbbf406377e3bb3184e01dbc0669-2014-6.html>)
johnny9 commented 2026-11-02 15:57:29 +00:00 (Migrated from github.com)

The latest human-review findings are fixed in 92fa3864a1 and all three threads have replies and are resolved. Legacy language fallback now matches startup, a late preparation request returns a queued failure, and accepted preparation completes before shutdown observers may clean up its owner.

The earlier status-publication, signer-translation/pending-state and retained-section fixes remain intact. Their regressions and the prior resolved threads are unchanged; broader executor work remains tracked in #1054.

Validation at 92fa3864a136: full build, all seven relevant non-QML CTest groups and four startup/shutdown/onboarding functional suites pass. QML sources, resources and fixtures are byte-identical to the previous full-suite pass at dd662d41. The updated AsyncOptions and OnboardingAsync classes pass 32 cases under strict LLVM 22 ASan/LSan/UBSan/integer and 32 under TSan, with only pinned Core suppressions. Matching LLVM 22/Bitcoin-plugin checks pass. Old production fails two language and seven shutdown rows; the simpler early-drain variant also fails the owner-deletion regression.

Remaining sanitizer qualification: A supplemental current-head ASAN GUI SIGINT check timed out twice at the standard process-exit deadline. Core shutdown and tracked workers completed, and a separate quiescent diagnostic exited cleanly in 21.884 seconds. The intermittent cause remains unproven; this is not counted as a clean standard sanitizer lifecycle pass. No Core assertion or executable-wide suppression was added.

The standalone checkout lacks the requested top-level CI drivers. Configured rootless Docker is available; Core-only fallback attempts are partial and do not validate parent GUI-QML. The IPC-enabled standalone GUI uses a local node factory; actual Core multiprocess IPC lifecycle remains untested and interface_gui.py is absent.

CI follow-up in 19472d4944: the proxy-draft test called an external wallet shortcut that clears cached settings pages, then used stale page/button references. It now uses the normal Settings navigation, real key/mouse input, and retained-page identity/depth checks before Save. All draft and persisted-address assertions remain. The full QML suite passes all 682 cases on CI-matching Qt 6.2. The 26 SettingsNavigation cases also pass on Qt 6.4, Qt 6.10 and audited Qt 6.8 ASan/LSan/UBSan/integer instrumentation with the independently reproduced Qt hash exception. Negative controls still reject missing pending-state gates and discarded drafts. Both fork-push and upstream-PR workflows are tracked. Fork CI.

Hosted CI confirmation (2026-11-02 19:49 UTC): the current fork head passes Qt 6.2, Qt 6.4, Qt 6.10 and GUI functional tests. All twelve Linux matrix/GUI jobs across #981, #985 and #990 are green. Upstream PR-triggered runs remain queued. macOS runner-capacity failures were retried; macOS validation remains pending. The earlier validation qualifications above are unchanged.

Additional CI follow-up in a1bbbfde65: the inherited custom-fee test required exact equality with the final signed transaction size. Pinned Core reproduced a 141-sat fee with a 140-vB transaction after a shorter ECDSA signature, so this was a test defect. The test now uses Core's bounded fee assertion and retains the wallet-minimum override and relay-minimum rejection checks. Shared-path validation passes eleven fee-boundary controls and both instrumented GUI fee scenarios. Only the Python test changed in this follow-up; earlier sanitizer/driver/IPC qualifications remain unchanged. New hosted checks are queued or running on this revision; no result is claimed yet.

The latest human-review findings are fixed in 92fa3864a136 and all three threads have replies and are resolved. Legacy language fallback now matches startup, a late preparation request returns a queued failure, and accepted preparation completes before shutdown observers may clean up its owner. The earlier status-publication, signer-translation/pending-state and retained-section fixes remain intact. Their regressions and the prior resolved threads are unchanged; broader executor work remains tracked in #1054. Validation at `92fa3864a136`: full build, all seven relevant non-QML CTest groups and four startup/shutdown/onboarding functional suites pass. QML sources, resources and fixtures are byte-identical to the previous full-suite pass at dd662d41. The updated AsyncOptions and OnboardingAsync classes pass 32 cases under strict LLVM 22 ASan/LSan/UBSan/integer and 32 under TSan, with only pinned Core suppressions. Matching LLVM 22/Bitcoin-plugin checks pass. Old production fails two language and seven shutdown rows; the simpler early-drain variant also fails the owner-deletion regression. Remaining sanitizer qualification: A supplemental current-head ASAN GUI SIGINT check timed out twice at the standard process-exit deadline. Core shutdown and tracked workers completed, and a separate quiescent diagnostic exited cleanly in 21.884 seconds. The intermittent cause remains unproven; this is not counted as a clean standard sanitizer lifecycle pass. No Core assertion or executable-wide suppression was added. The standalone checkout lacks the requested top-level CI drivers. Configured rootless Docker is available; Core-only fallback attempts are partial and do not validate parent GUI-QML. The IPC-enabled standalone GUI uses a local node factory; actual Core multiprocess IPC lifecycle remains untested and interface_gui.py is absent. CI follow-up in 19472d4944f1: the proxy-draft test called an external wallet shortcut that clears cached settings pages, then used stale page/button references. It now uses the normal Settings navigation, real key/mouse input, and retained-page identity/depth checks before Save. All draft and persisted-address assertions remain. The full QML suite passes all 682 cases on CI-matching Qt 6.2. The 26 SettingsNavigation cases also pass on Qt 6.4, Qt 6.10 and audited Qt 6.8 ASan/LSan/UBSan/integer instrumentation with the independently reproduced Qt hash exception. Negative controls still reject missing pending-state gates and discarded drafts. Both fork-push and upstream-PR workflows are tracked. [Fork CI](https://github.com/johnny9/gui-qml/actions/runs/41506415425). Hosted CI confirmation (2026-11-02 19:49 UTC): the current fork head passes Qt 6.2, Qt 6.4, Qt 6.10 and GUI functional tests. All twelve Linux matrix/GUI jobs across #981, #985 and #990 are green. Upstream PR-triggered runs remain queued. macOS runner-capacity failures were retried; macOS validation remains pending. The earlier validation qualifications above are unchanged. Additional CI follow-up in a1bbbfde6536: the inherited custom-fee test required exact equality with the final signed transaction size. Pinned Core reproduced a 141-sat fee with a 140-vB transaction after a shorter ECDSA signature, so this was a test defect. The test now uses Core's bounded fee assertion and retains the wallet-minimum override and relay-minimum rejection checks. Shared-path validation passes eleven fee-boundary controls and both instrumented GUI fee scenarios. Only the Python test changed in this follow-up; earlier sanitizer/driver/IPC qualifications remain unchanged. New hosted checks are queued or running on this revision; no result is claimed yet.
pseudoramdom (Migrated from github.com) reviewed 2026-11-02 17:37:31 +00:00
pseudoramdom (Migrated from github.com) commented 2026-11-02 17:28:26 +00:00

If this runs while prepareNode()'s job is still running, shutdown() drops that job's completion, so finishNodePreparation() never runs and nodePrepared is never emitted. bitcoin.cpp waits for that signal in preparation_loop, so startup would hang. Before 8d9fbbd9fe this was a no-op while preparing.

Since finishNodePreparation() already shuts the executor down, suggest leaving the executor alone while preparing:

} else {
    connect(m_executor.get(), &BackendExecutor::drained, this, &OnboardingOptionsModel::shutdownFinished);
    if (!m_preparing) m_executor->shutdown();
}

A test that calls beginShutdown() while preparation is held on the gated worker, and expects both nodePrepared and shutdownFinished exactly once, would cover it.

If this runs while `prepareNode()`'s job is still running, `shutdown()` drops that job's completion, so `finishNodePreparation()` never runs and `nodePrepared` is never emitted. `bitcoin.cpp` waits for that signal in `preparation_loop`, so startup would hang. Before 8d9fbbd9fe this was a no-op while preparing. Since `finishNodePreparation()` already shuts the executor down, suggest leaving the executor alone while preparing: ```cpp } else { connect(m_executor.get(), &BackendExecutor::drained, this, &OnboardingOptionsModel::shutdownFinished); if (!m_preparing) m_executor->shutdown(); } ``` A test that calls `beginShutdown()` while preparation is held on the gated worker, and expects both `nodePrepared` and `shutdownFinished` exactly once, would cover it.
pseudoramdom (Migrated from github.com) commented 2026-11-02 17:27:25 +00:00

Minor: after shutdown this returns silently, so a caller waiting for nodePrepared waits forever. Could it report a failure instead?

if (m_preparing) return;
if (m_stopping) {
    QMetaObject::invokeMethod(this, [this] { Q_EMIT nodePrepared(false, tr("The application is shutting down.")); }, Qt::QueuedConnection);
    return;
}
Minor: after shutdown this returns silently, so a caller waiting for `nodePrepared` waits forever. Could it report a failure instead? ```cpp if (m_preparing) return; if (m_stopping) { QMetaObject::invokeMethod(this, [this] { Q_EMIT nodePrepared(false, tr("The application is shutting down.")); }, Qt::QueuedConnection); return; } ```
pseudoramdom (Migrated from github.com) commented 2026-11-02 17:26:32 +00:00

Users who only have a language in the legacy Qt settings see a mismatch. Startup installs that language through the ReadLegacyGuiLanguage fallback in bitcoin.cpp, but this read has no such fallback and returns "". Because "" == m_language, the first snapshot no longer emits languageChanged. The UI stays in the legacy language while Settings shows "System default", and picking "System default" does nothing, because setLanguage("") returns early.

Suggest using the same fallback as startup here, as display unit already does with ReadLegacyGuiDisplayUnit a few lines below:

result.language = settings.value(SettingsKeys::LANGUAGE,
    QmlLegacySettings::ReadLegacyGuiLanguage(QString::fromStdString(args.GetChainTypeString()))).toString();
Users who only have a language in the legacy Qt settings see a mismatch. Startup installs that language through the `ReadLegacyGuiLanguage` fallback in `bitcoin.cpp`, but this read has no such fallback and returns `""`. Because `"" == m_language`, the first snapshot no longer emits `languageChanged`. The UI stays in the legacy language while Settings shows "System default", and picking "System default" does nothing, because `setLanguage("")` returns early. Suggest using the same fallback as startup here, as display unit already does with `ReadLegacyGuiDisplayUnit` a few lines below: ```cpp result.language = settings.value(SettingsKeys::LANGUAGE, QmlLegacySettings::ReadLegacyGuiLanguage(QString::fromStdString(args.GetChainTypeString()))).toString(); ```
johnny9 (Migrated from github.com) reviewed 2026-11-02 17:57:30 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 17:57:30 +00:00

Fixed in 92fa3864a1. The snapshot now uses the same legacy language fallback as startup, while an explicit current System default stays empty. legacyLanguageMatchesStartupFallback covers chain/default legacy stores, current and command-line overrides, clearing the language and restarting.

Fixed in 92fa3864a136. The snapshot now uses the same legacy language fallback as startup, while an explicit current System default stays empty. legacyLanguageMatchesStartupFallback covers chain/default legacy stores, current and command-line overrides, clearing the language and restarting.
johnny9 (Migrated from github.com) reviewed 2026-11-02 17:57:34 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 17:57:34 +00:00

Fixed in 92fa3864a1. A request after shutdown now queues nodePrepared(false, error) without starting work. prepareAfterShutdownReportsFailure covers pending and completed previews and repeated shutdown calls; accepted preparation keeps its existing one-shot behavior.

Fixed in 92fa3864a136. A request after shutdown now queues nodePrepared(false, error) without starting work. prepareAfterShutdownReportsFailure covers pending and completed previews and repeated shutdown calls; accepted preparation keeps its existing one-shot behavior.
johnny9 (Migrated from github.com) reviewed 2026-11-02 17:57:36 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 17:57:36 +00:00

Fixed in 92fa3864a1. Accepted preparation keeps its completion, and shutdownFinished is queued from nodePrepared so all preparation observers run before owner cleanup. Gated tests cover success, failure, both exception paths, repeated shutdown and owner deletion. The old code fails all seven shutdown rows; the simpler early-drain connection also fails the owner-deletion case. All 32 focused cases pass under ASan/LSan/UBSan/integer and TSan.

Fixed in 92fa3864a136. Accepted preparation keeps its completion, and shutdownFinished is queued from nodePrepared so all preparation observers run before owner cleanup. Gated tests cover success, failure, both exception paths, repeated shutdown and owner deletion. The old code fails all seven shutdown rows; the simpler early-drain connection also fails the owner-deletion case. All 32 focused cases pass under ASan/LSan/UBSan/integer and TSan.
pseudoramdom commented 2026-11-03 16:49:38 +00:00 (Migrated from github.com)
ACK a1bbbfde6536fbbf406377e3bb3184e01dbc0669
Sign in to join this conversation.
No description provided.