WIP: Move wallet overview, activity, address and receive work off the GUI thread #990

Closed
johnny9 wants to merge 8 commits from pr/qt6-async-05-wallet-state into qt6 AGit
johnny9 commented 2026-10-10 19:12:03 +00:00 (Migrated from github.com)

Wallet balance queries, address scans and receive actions can block the GUI. Run backend reads and writes on workers and let GUI getters read cached results. Combine refresh requests and ignore stale replies.

Move label changes, message signing, payment reconciliation, CSV exports and QR file saves into background work. Show pending and failure states and preserve wallet lock state.

Regression tests cover cached reads, stale replies, failed writes, wallet closure and coin-lock changes without notifications.

Depends on #985. This draft targets qt6, so its diff includes the earlier PRs. The wallet feature and review fixes follow #985 in the stack.

The payment-status badge now follows the current received amount, including a payment replaced away to zero; historical sharing/edit restrictions remain in force. Regression coverage exercises payment, cancellation and renewed payment.

Validation at 14ef21e14a5c: full build, seven relevant non-QML CTest groups and startup/shutdown/onboarding functional checks pass. Matching LLVM 22/Bitcoin-plugin checks pass on all four inherited changed C++ files. QML sources and fixtures match 3b574e1b, where all eight CTest groups, 704 QML cases and six wallet/address/Receive functional suites passed. The wallet feature and review-fix patches are unchanged.

Unchanged RequestPayment sources have 61 ASan/LSan/UBSan/integer and 61 TSan passes from the preceding 8af78885 validation. The new inherited options/preparation tests pass 32 strict ASan/LSan/UBSan/integer and 32 TSan cases at #981. Full sanitizer validation of this combined application is not established; #981 records an intermittent supplemental ASAN SIGINT deadline failure.

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. Current CI.

Fixes #968
Fixes #969
Fixes #971
Fixes #972
Fixes #1042

Latest review fixes and validation

Rebased onto current qt6 and updated to Core's wallet transaction API. Unchanged unconfirmed request payments now poll only their status, avoiding full wallet scans and model resets; eviction still refreshes the request without a wallet notification. Andrea's dialog-opening lifetime fix is included with authorship preserved, so delayed deletion cannot close a subsequently opened request.

Validation at 389e2f1dac: full Release build; 134 wallet-model and 75 related address/coins/request-history/activity tests pass. RequestPayment QML has 60 passes, including both new delayed-deletion cases, and four amount-validation failures also reproduced on rebased pre-fix sources (58 passes, four failures) under Qt 6.11.2. These baseline failures remain; no sanitizer result is claimed for this revision.

Wallet balance queries, address scans and receive actions can block the GUI. Run backend reads and writes on workers and let GUI getters read cached results. Combine refresh requests and ignore stale replies. Move label changes, message signing, payment reconciliation, CSV exports and QR file saves into background work. Show pending and failure states and preserve wallet lock state. Regression tests cover cached reads, stale replies, failed writes, wallet closure and coin-lock changes without notifications. Depends on #985. This draft targets `qt6`, so its diff includes the earlier PRs. The wallet feature and review fixes follow #985 in the stack. The payment-status badge now follows the current received amount, including a payment replaced away to zero; historical sharing/edit restrictions remain in force. Regression coverage exercises payment, cancellation and renewed payment. Validation at `14ef21e14a5c`: full build, seven relevant non-QML CTest groups and startup/shutdown/onboarding functional checks pass. Matching LLVM 22/Bitcoin-plugin checks pass on all four inherited changed C++ files. QML sources and fixtures match 3b574e1b, where all eight CTest groups, 704 QML cases and six wallet/address/Receive functional suites passed. The wallet feature and review-fix patches are unchanged. Unchanged RequestPayment sources have 61 ASan/LSan/UBSan/integer and 61 TSan passes from the preceding 8af78885 validation. The new inherited options/preparation tests pass 32 strict ASan/LSan/UBSan/integer and 32 TSan cases at #981. Full sanitizer validation of this combined application is not established; #981 records an intermittent supplemental ASAN SIGINT deadline failure. 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. [Current CI](https://github.com/bitcoin-core/gui-qml/pull/990/checks). Fixes #968 Fixes #969 Fixes #971 Fixes #972 Fixes #1042 ## Latest review fixes and validation Rebased onto current `qt6` and updated to Core's wallet transaction API. Unchanged unconfirmed request payments now poll only their status, avoiding full wallet scans and model resets; eviction still refreshes the request without a wallet notification. Andrea's dialog-opening lifetime fix is included with authorship preserved, so delayed deletion cannot close a subsequently opened request. Validation at `389e2f1dac`: full Release build; 134 wallet-model and 75 related address/coins/request-history/activity tests pass. RequestPayment QML has 60 passes, including both new delayed-deletion cases, and four amount-validation failures also reproduced on rebased pre-fix sources (58 passes, four failures) under Qt 6.11.2. These baseline failures remain; no sanitizer result is claimed for this revision.
jarolrod (Migrated from github.com) reviewed 2026-10-10 19:51:21 +00:00
jarolrod (Migrated from github.com) commented 2026-10-10 19:51:21 +00:00

Switching wallets away and back during a save clears the draft, so this skips clearing the address even though the request was saved. The next request can reuse it.

I reproduced this in a model test with a delayed backend: one 5,000-sat payment showed as received on both requests.

Switching wallets away and back during a save clears the draft, so this skips clearing the address even though the request was saved. The next request can reuse it. I reproduced this in a model test with a delayed backend: one 5,000-sat payment showed as received on both requests.
johnny9 commented 2026-10-11 13:22:54 +00:00 (Migrated from github.com)

rebased

rebased
johnny9 commented 2026-10-11 17:31:42 +00:00 (Migrated from github.com)

rebased

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

Returning the cached lock state here makes a quick Unlock → Lock silently skip the second command. CoinsListModel::setCoinsLocked() still sees the old locked row and decides there's nothing to do, leaving the coin unlocked in Core.

Reproduced through the enabled GUI buttons with a larger regtest wallet; the same sequence passed on qt6. We should send the requested lock operation to Core even when the cached row already matches it.

Returning the cached lock state here makes a quick Unlock → Lock silently skip the second command. CoinsListModel::setCoinsLocked() still sees the old locked row and decides there's nothing to do, leaving the coin unlocked in Core. Reproduced through the enabled GUI buttons with a larger regtest wallet; the same sequence passed on qt6. We should send the requested lock operation to Core even when the cached row already matches it.
jarolrod (Migrated from github.com) reviewed 2026-10-11 23:36:29 +00:00
jarolrod (Migrated from github.com) commented 2026-10-11 23:36:29 +00:00

SendRecipient uses this value to validate amounts, but the snapshot isn't refreshed when a coinbase matures without another wallet notification.

On regtest, Core reported 50 BTC trusted while entering a fresh 1 BTC amount left Review disabled. Setting an address label triggered a refresh and made it work. qt6 branch accepts that fresh amount despite the stale display.

We need to refresh after the wallet processes a new block before relying on this cache for amount validation.

SendRecipient uses this value to validate amounts, but the snapshot isn't refreshed when a coinbase matures without another wallet notification. On regtest, Core reported 50 BTC trusted while entering a fresh 1 BTC amount left Review disabled. Setting an address label triggered a refresh and made it work. qt6 branch accepts that fresh amount despite the stale display. We need to refresh after the wallet processes a new block before relying on this cache for amount validation.
jarolrod (Migrated from github.com) reviewed 2026-10-11 23:49:25 +00:00
jarolrod (Migrated from github.com) commented 2026-10-11 23:49:25 +00:00

The controller can publish this model before the queued unload handler is connected. An unload in that interval loses the notification, leaving the GUI holding the wallet and unloadwallet waiting until it's manually closed.

Reproduced by delaying subscription setup. Ordinary repetitions didn't hit it. There's an earlier load/handoff race too, but this adds a window after publication.

We should connect the unload handler before publishing the model; connecting that signal doesn't require a wallet read.

The controller can publish this model before the queued unload handler is connected. An unload in that interval loses the notification, leaving the GUI holding the wallet and unloadwallet waiting until it's manually closed. Reproduced by delaying subscription setup. Ordinary repetitions didn't hit it. There's an earlier load/handoff race too, but this adds a window after publication. We should connect the unload handler before publishing the model; connecting that signal doesn't require a wallet read.
jarolrod (Migrated from github.com) reviewed 2026-10-11 23:54:01 +00:00
jarolrod (Migrated from github.com) commented 2026-10-11 23:54:01 +00:00

If this refresh throws after saving, we tell the user the operation failed even though the request is already in Activity. Clicking Save again can create a duplicate because the draft never received its saved ID.

Reproduced with an injected refresh failure. We should keep the saved ID and report the refresh error separately so retrying doesn’t create another request.

If this refresh throws after saving, we tell the user the operation failed even though the request is already in Activity. Clicking Save again can create a duplicate because the draft never received its saved ID. Reproduced with an injected refresh failure. We should keep the saved ID and report the refresh error separately so retrying doesn’t create another request.
jarolrod commented 2026-10-12 00:22:06 +00:00 (Migrated from github.com)

Opened #996 with reproductions for the existing Send validation problems. This PR fixes the ordinary incoming-payment case: an existing draft becomes valid when the payment confirms.

The maturity case still needs a refresh. Core has 50 BTC spendable, but the GUI shows zero and rejects a 1 BTC amount, including one first entered after maturity. Changing an address label refreshes the balance and enables Review. We also need to refresh when funds mature without another transaction involving the wallet.

Tested 7e432cefdc77; the relevant wallet/recipient code is unchanged in the current 2f8b6d43f1ce rebase.

Opened #996 with reproductions for the existing Send validation problems. This PR fixes the ordinary incoming-payment case: an existing draft becomes valid when the payment confirms. The maturity case still needs a refresh. Core has 50 BTC spendable, but the GUI shows zero and rejects a 1 BTC amount, including one first entered after maturity. Changing an address label refreshes the balance and enables Review. We also need to refresh when funds mature without another transaction involving the wallet. Tested `7e432cefdc77`; the relevant wallet/recipient code is unchanged in the current `2f8b6d43f1ce` rebase.
jarolrod commented 2026-10-12 00:35:39 +00:00 (Migrated from github.com)

Added two reproductions to the issues this PR closes:

  • #968: descriptor imports — importing active descriptors into an open blank wallet leaves Receive’s address-type choices empty. Those choices should refresh without reopening the wallet.
  • #972: stale receiving-address preference — restoring an old preference after saving a request lets a second request reuse its address. I deliberately restored the preference; I haven’t reproduced a natural crash or settings-write failure.

Both reproduce on qt6, so these are existing gaps. We should include them in this PR’s acceptance checks: refresh capabilities after imports, and check saved requests before reoffering an address from a restored preference.

Added two reproductions to the issues this PR closes: - [#968: descriptor imports](https://github.com/bitcoin-core/gui-qml/issues/968#issuecomment-6115643382) — importing active descriptors into an open blank wallet leaves Receive’s address-type choices empty. Those choices should refresh without reopening the wallet. - [#972: stale receiving-address preference](https://github.com/bitcoin-core/gui-qml/issues/972#issuecomment-6115645840) — restoring an old preference after saving a request lets a second request reuse its address. I deliberately restored the preference; I haven’t reproduced a natural crash or settings-write failure. Both reproduce on `qt6`, so these are existing gaps. We should include them in this PR’s acceptance checks: refresh capabilities after imports, and check saved requests before reoffering an address from a restored preference.
jarolrod (Migrated from github.com) reviewed 2026-10-13 06:26:48 +00:00
jarolrod (Migrated from github.com) commented 2026-10-13 06:26:48 +00:00

This is an edge case but, this can silently discard a corrected note when the wallet is busy. The second save is rejected while the first is pending, then this completion restores the first note and clears the error.

Reproduced on macOS with a fresh regtest wallet: start keypoolrefill 20000 for the same wallet, then submit “First” followed by “Second” in Address details before the refill finishes. Used automated Qt keystrokes at 250 ms per character, with 500 ms between edits.

A possible solution is to make both note editors read-only while labelChangePending, show “Saving…”, and guard duplicate submissions.

This is an edge case but, this can silently discard a corrected note when the wallet is busy. The second save is rejected while the first is pending, then this completion restores the first note and clears the error. Reproduced on macOS with a fresh regtest wallet: start keypoolrefill 20000 for the same wallet, then submit “First” followed by “Second” in Address details before the refill finishes. Used automated Qt keystrokes at 250 ms per character, with 500 ms between edits. A possible solution is to make both note editors read-only while labelChangePending, show “Saving…”, and guard duplicate submissions.
jarolrod (Migrated from github.com) reviewed 2026-10-13 06:59:33 +00:00
jarolrod (Migrated from github.com) commented 2026-10-13 06:59:33 +00:00

This skips address preparation without retrying when the pending operation finishes. Reproduced with a fresh regtest wallet, before visiting Receive:

  1. Open an address under Settings → Wallet → Addresses.
  2. Run keypoolrefill 20000 and save a note while it's running.
  3. Close Address details and open Receive before the save finishes.

Receive stays at “Preparing address” after the save completes, with no address or QR. Switching away and back recovers. The parent works, and the note-editor fix still reproduces this. We should resume the skipped preparation once the pending operation finishes.

This skips address preparation without retrying when the pending operation finishes. Reproduced with a fresh regtest wallet, before visiting Receive: 1. Open an address under Settings → Wallet → Addresses. 2. Run `keypoolrefill 20000` and save a note while it's running. 3. Close Address details and open Receive before the save finishes. Receive stays at “Preparing address” after the save completes, with no address or QR. Switching away and back recovers. The parent works, and the note-editor fix still reproduces this. We should resume the skipped preparation once the pending operation finishes.
jarolrod (Migrated from github.com) commented 2026-10-13 06:59:33 +00:00

Reproduced a Legacy request turning into a Taproot request when using “Request again.” With the default Taproot preference:

  1. Create a Legacy address with getnewaddress "" legacy.
  2. Open it under Addresses → Create payment request, add an amount, and save.
  3. Choose More → Request again and save the repeat.

The repeat uses Taproot on this branch; the parent preserves Legacy. We're dropping pendingType here. We should preserve it through the retry so repeating a request keeps the address format the user chose.

Reproduced a Legacy request turning into a Taproot request when using “Request again.” With the default Taproot preference: 1. Create a Legacy address with `getnewaddress "" legacy`. 2. Open it under Addresses → Create payment request, add an amount, and save. 3. Choose More → Request again and save the repeat. The repeat uses Taproot on this branch; the parent preserves Legacy. We're dropping `pendingType` here. We should preserve it through the retry so repeating a request keeps the address format the user chose.
jarolrod commented 2026-10-16 04:39:39 +00:00 (Migrated from github.com)

Related: #1042 tracks the request still saying “Payment received” after its only payment is replaced away. This reproduces on qt6 independently of this PR; 0d9d14ce7061 also still uses the permanent observed-payment flag for the status label.

Related: #1042 tracks the request still saying “Payment received” after its only payment is replaced away. This reproduces on `qt6` independently of this PR; `0d9d14ce7061` also still uses the permanent observed-payment flag for the status label.
First-time contributor

🟠 Minor · Wallet snapshots re-run synchronous send-balance queries

Snapshot notifications repeat synchronous balance queries from the always-instantiated Send page, leaving GUI-thread wallet locking and coin enumeration despite the worker cache.

Location: qml/models/walletqmlmodel.cpp:663 (head).

🟠 Minor · Unchanged payment polls reset editable address rows

While a saved request has an unconfirmed mempool payment, unchanged snapshots repeatedly reset the address and coin models, recreating editable address delegates and potentially interrupting label editing.

Location: qml/models/addresslistmodel.cpp:65 (head).

🔵 Suggestion · Pending request payments trigger full-wallet polling

An unchanged unconfirmed payment causes each eligible one-second poll to enumerate the whole wallet on the shared serial worker, instead of checking only pending transaction IDs as base did.

Location: qml/models/walletstatesnapshot.cpp:215 (head).

Review coverage was incomplete.


Reviewed: 18e374fcb804 · Full review report · Previous reports

permalink

<!-- ralph:bitcoin-core/gui-qml --> <!-- ralph-engine:current:965af1044d9e41839565702e4d9bd0a751eda81f6e8b6402747fa296ef84ebea:f7677f01bbeeeda2e9dfb365f1407384e31618edbeddff6daa5ff425bb8651e2 --> <!-- ralph-base:6cdad5344018f35e8c33c77a23f6ba996d507549 --> <!-- ralph-head:18e374fcb8047a21707e736b21fb0e9d91d22d55 --> <!-- ralph-case:c8a330612de551259a40352651dc24d8183e310802de4c169862b8aa663ad1a2 --> **🟠 Minor · Wallet snapshots re-run synchronous send-balance queries** Snapshot notifications repeat synchronous balance queries from the always-instantiated Send page, leaving GUI-thread wallet locking and coin enumeration despite the worker cache. Location: [`qml/models/walletqmlmodel.cpp:663`](<https://git.fish.foo/bitcoin-core/gui-qml/src/commit/18e374fcb8047a21707e736b21fb0e9d91d22d55/qml/models/walletqmlmodel.cpp#L663>) (head). **🟠 Minor · Unchanged payment polls reset editable address rows** While a saved request has an unconfirmed mempool payment, unchanged snapshots repeatedly reset the address and coin models, recreating editable address delegates and potentially interrupting label editing. Location: [`qml/models/addresslistmodel.cpp:65`](<https://git.fish.foo/bitcoin-core/gui-qml/src/commit/18e374fcb8047a21707e736b21fb0e9d91d22d55/qml/models/addresslistmodel.cpp#L65>) (head). **🔵 Suggestion · Pending request payments trigger full-wallet polling** An unchanged unconfirmed payment causes each eligible one-second poll to enumerate the whole wallet on the shared serial worker, instead of checking only pending transaction IDs as base did. Location: [`qml/models/walletstatesnapshot.cpp:215`](<https://git.fish.foo/bitcoin-core/gui-qml/src/commit/18e374fcb8047a21707e736b21fb0e9d91d22d55/qml/models/walletstatesnapshot.cpp#L215>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`18e374fcb804`](<https://git.fish.foo/bitcoin-core/gui-qml/commit/18e374fcb8047a21707e736b21fb0e9d91d22d55>) · [Full review report](<https://review.fish.foo/traces/gui/990-18e374fcb8047a21707e736b21fb0e9d91d22d55-1958-1.html>) · [Previous reports](<https://review.fish.foo/traces/990/>) [permalink](<https://review.fish.foo/traces/gui/990-18e374fcb8047a21707e736b21fb0e9d91d22d55-1958-1.html>)
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:11:57 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:11:57 +00:00

Verified at 8af78885e. Saving retires the receiving address even if the draft or selected wallet changes before completion. receiveSaveRetiresAddressAfterDraftChanges covers delayed-save cases.

Verified at 8af78885e. Saving retires the receiving address even if the draft or selected wallet changes before completion. `receiveSaveRetiresAddressAfterDraftChanges` covers delayed-save cases.
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:12:06 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:12:06 +00:00

Verified at 8af78885e. The worker applies the requested lock/unlock operation, and the GUI keeps it pending until the resulting snapshot arrives. staleCachedStateDoesNotSuppressRequests covers stale cached lock and unlock states.

Verified at 8af78885e. The worker applies the requested lock/unlock operation, and the GUI keeps it pending until the resulting snapshot arrives. `staleCachedStateDoesNotSuppressRequests` covers stale cached lock and unlock states.
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:12:09 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:12:09 +00:00

Verified at 8af78885e. Wallet polling compares the processed block, retries a busy wallet, and refreshes cached balances after maturity. processedBlockRefreshesBalanceWithoutTransactionNotification covers existing and newly entered amounts; the wallet-state GUI test also passes.

Verified at 8af78885e. Wallet polling compares the processed block, retries a busy wallet, and refreshes cached balances after maturity. `processedBlockRefreshesBalanceWithoutTransactionNotification` covers existing and newly entered amounts; the wallet-state GUI test also passes.
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:12:12 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:12:12 +00:00

Verified at 8af78885e. The unload handler is connected before background subscriptions start. unloadIsConnectedBeforeBackgroundSubscriptions blocks setup and checks that unload reaches the model.

Verified at 8af78885e. The unload handler is connected before background subscriptions start. `unloadIsConnectedBeforeBackgroundSubscriptions` blocks setup and checks that unload reaches the model.
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:12:15 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:12:15 +00:00

Verified at 8af78885e. The save result retains its saved ID independently of the follow-up refresh. receiveSaveSurvivesRefreshFailure verifies that retrying does not create another request.

Verified at 8af78885e. The save result retains its saved ID independently of the follow-up refresh. `receiveSaveSurvivesRefreshFailure` verifies that retrying does not create another request.
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:12:19 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:12:19 +00:00

Verified at 8af78885e. Both note editors become read-only while saving, show Saving…, and reject duplicate submissions. test_addressList_blocks_edits_while_saving covers this behavior.

Verified at 8af78885e. Both note editors become read-only while saving, show Saving…, and reject duplicate submissions. `test_addressList_blocks_edits_while_saving` covers this behavior.
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:12:22 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:12:22 +00:00

Verified at 8af78885e. Request-again retains the selected address type through its pending retry. test_request_again_prefills_without_saving checks Legacy and Taproot against a different default.

Verified at 8af78885e. Request-again retains the selected address type through its pending retry. `test_request_again_prefills_without_saving` checks Legacy and Taproot against a different default.
johnny9 (Migrated from github.com) reviewed 2026-11-02 16:12:26 +00:00
johnny9 (Migrated from github.com) commented 2026-11-02 16:12:26 +00:00

Verified at 8af78885e. Receive retries address preparation when the pending operation finishes. test_address_preparation_resumes_after_pending_operation covers recovery without switching pages.

Verified at 8af78885e. Receive retries address preparation when the pending operation finishes. `test_address_preparation_resumes_after_pending_operation` covers recovery without switching pages.
johnny9 commented 2026-11-02 16:15:55 +00:00 (Migrated from github.com)

Restacked onto the latest #985/#981 fixes at 14ef21e14a. All eight original inline threads remain addressed and resolved, with regression tests named in their replies. Descriptor import and restored receiving preferences remain covered. The #1042 badge fix still follows current received amount through payment, cancellation and renewed payment while retaining historical restrictions.

Validation at 14ef21e14a5c: full build, seven relevant non-QML CTest groups and startup/shutdown/onboarding functional checks pass. Matching LLVM 22/Bitcoin-plugin checks pass on all four inherited changed C++ files. QML sources and fixtures match 3b574e1b, where all eight CTest groups, 704 QML cases and six wallet/address/Receive functional suites passed. The wallet feature and review-fix patches are unchanged.

Unchanged RequestPayment sources have 61 ASan/LSan/UBSan/integer and 61 TSan passes from the preceding 8af78885 validation. The new inherited options/preparation tests pass 32 strict ASan/LSan/UBSan/integer and 32 TSan cases at #981. Full sanitizer validation of this combined application is not established; #981 records an intermittent supplemental ASAN SIGINT deadline failure.

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. Current CI.

CI follow-up in e410bffc11: 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. Restacked onto the test-only fix. Fresh Qt 6.2 and Qt 6.8 builds each pass all 704 QML cases. Own wallet patches and production sources remain unchanged. 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 5280e52567: 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.

Restacked onto the latest #985/#981 fixes at 14ef21e14a5c. All eight original inline threads remain addressed and resolved, with regression tests named in their replies. Descriptor import and restored receiving preferences remain covered. The #1042 badge fix still follows current received amount through payment, cancellation and renewed payment while retaining historical restrictions. Validation at `14ef21e14a5c`: full build, seven relevant non-QML CTest groups and startup/shutdown/onboarding functional checks pass. Matching LLVM 22/Bitcoin-plugin checks pass on all four inherited changed C++ files. QML sources and fixtures match 3b574e1b, where all eight CTest groups, 704 QML cases and six wallet/address/Receive functional suites passed. The wallet feature and review-fix patches are unchanged. Unchanged RequestPayment sources have 61 ASan/LSan/UBSan/integer and 61 TSan passes from the preceding 8af78885 validation. The new inherited options/preparation tests pass 32 strict ASan/LSan/UBSan/integer and 32 TSan cases at #981. Full sanitizer validation of this combined application is not established; #981 records an intermittent supplemental ASAN SIGINT deadline failure. 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. [Current CI](https://github.com/bitcoin-core/gui-qml/pull/990/checks). CI follow-up in e410bffc114b: 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. Restacked onto the test-only fix. Fresh Qt 6.2 and Qt 6.8 builds each pass all 704 QML cases. Own wallet patches and production sources remain unchanged. Both fork-push and upstream-PR workflows are tracked. [Fork CI](https://github.com/johnny9/gui-qml/actions/runs/41507979279). 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 5280e52567b5: 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.
jarolrod commented 2026-11-06 17:42:17 +00:00 (Migrated from github.com)

The delayed-deletion case requested in #972 still reproduces with this PR's current QML at 1cc00c240d94.

  1. Open saved request A and start deleting it, keeping the backend completion pending.
  2. Close the request dialog and open request B in the same wallet.
  3. Complete A's deletion. B's dialog closes without another action.

I rechecked this using the current payment-request card and modal in a focused QML test with controlled backend completion. The modal closes while displaying B; reopening B preserves its amount and message. The earlier native reproduction used a busy disposable wallet to create the overlap. This is a dialog-lifetime bug, not deletion of the wrong request.

pendingOperation and pendingRequestId survive closing the modal. Both openings reuse the same detail object, so changing its request ID does not trigger onRequestChanged. A's completion then emits deleted, and the modal closes whichever request it is showing.

Please tie the UI completion to the opening that started the operation, while allowing A's deletion to finish in its original wallet. Closing and reopening the same request should also count as a new opening. The regression case should keep B open after A finishes, as #972 already requires.

The delayed-deletion case requested in #972 still reproduces with this PR's current QML at `1cc00c240d94`. 1. Open saved request A and start deleting it, keeping the backend completion pending. 2. Close the request dialog and open request B in the same wallet. 3. Complete A's deletion. B's dialog closes without another action. I rechecked this using the current payment-request card and modal in a focused QML test with controlled backend completion. The modal closes while displaying B; reopening B preserves its amount and message. The earlier native reproduction used a busy disposable wallet to create the overlap. This is a dialog-lifetime bug, not deletion of the wrong request. `pendingOperation` and `pendingRequestId` survive closing the modal. Both openings reuse the same detail object, so changing its request ID does not trigger `onRequestChanged`. A's completion then emits `deleted`, and the modal closes whichever request it is showing. Please tie the UI completion to the opening that started the operation, while allowing A's deletion to finish in its original wallet. Closing and reopening the same request should also count as a new opening. The regression case should keep B open after A finishes, as #972 already requires.
AndreaDiazCorreia commented 2026-11-08 01:46:34 +00:00 (Migrated from github.com)

I sent a fix for the delayed-deletion case to the branch: johnny9/gui-qml#5. Each opening of the request modal is numbered, so a delete only closes the opening that started it; closing and reopening the same request counts as a new opening. A regression test covers both a different request and the same one reopened.

I sent a fix for the delayed-deletion case to the branch: johnny9/gui-qml#5. Each opening of the request modal is numbered, so a delete only closes the opening that started it; closing and reopening the same request counts as a new opening. A regression test covers both a different request and the same one reopened.
jarolrod commented 2026-11-11 00:57:28 +00:00 (Migrated from github.com)

I re-tested 1cc00c240d94 on an optimised build against its base 6e54a48ab571. One problem remains, and three things are better.

Remaining: the wallet state is re-read and re-applied every second while a payment to a saved request is unconfirmed

To reproduce:

  1. Open a wallet that has a saved payment request.
  2. Pay the request's address from another wallet and do not mine a block.
  3. Open Addresses and start typing an inline label.

Until the payment confirms, the Addresses list resets once a second:

Unconfirmed payment to a saved request This PR Base
Addresses list resets in 40 s 41 to 42 1
5,000-transaction wallet: window stall per reset about 0.17 to 0.18 s none after arrival
5,000-transaction wallet: CPU, offscreen 27% (idle 4.4%) 4.4%
30-transaction wallet: CPU, offscreen 5.6% (idle 3.3%) 4.1%
Keys lost while typing a 100-key label 20 to 40 0

The label editor is destroyed 0.3 to 0.8 s after typing starts. The partial text is saved as the label, and the next Space opens Address details. The reset count is the same on a 30-transaction wallet, so this does not depend on wallet size.

On this PR the other states are quiet: no resets when idle, two at the arrival of an ordinary unconfirmed payment and none after, and none once the request payment confirms. Label typing loses no keys in those states.

WalletStateBackend::poll skips its processed-block comparison while m_unconfirmed_payments is set (walletstatesnapshot.cpp#L209-L220), so the 1 s timer (walletqmlmodel.cpp#L605-L607) runs a full read() every cycle. applyWalletState then applies every snapshot and emits walletStateChanged without comparing it with the previous one (walletqmlmodel.cpp#L658-L690). Applying a snapshot only when it differs, or polling only the status of the unconfirmed payments, would keep the lists stable.

Better than base

  • Ordinary incoming payment, 5,000-transaction wallet: one stall of about 0.44 s at arrival. Base stalls for about 4.6 s.
  • Display-unit change with a hidden 3,000-coin wallet open: 0.09 to 0.10 s. Base takes 0.52 to 0.59 s.
  • Receive address after a lost preference write (#972): after restart the app offers a fresh address and one payment marks only the first request. Base re-offers the old address and marks both. This held when the preference file was unwritable and when the app was killed between the wallet write and the preference removal (13 of 13). The removal's result is still not checked (walletstatesnapshot.cpp#L349), so the write is still lost silently; the restore no longer depends on it.

A smoke run of nine flows passed on this PR, offscreen and native: start with two wallets, send, receive, a new block, request create, edit and delete, an inline label, wallet switching during traffic, closing a wallet with Activity open, and quit. Quitting with a refresh in flight on the large wallet exited cleanly 9 of 9 times.

Tested on macOS / Qt 6.9, isolated regtest, RelWithDebInfo builds of both commits, offscreen and native. Each configuration ran once. Stalls were measured as the round trip of a bridge read sent every 50 ms, so stalls under about 0.1 s are not resolved. Typing and clicks went through the test bridge. The preference fault was applied to the INI store selected by the test switch, not the macOS preference store, and the kill route ran offscreen only.

I re-tested `1cc00c240d94` on an optimised build against its base `6e54a48ab571`. One problem remains, and three things are better. **Remaining: the wallet state is re-read and re-applied every second while a payment to a saved request is unconfirmed** To reproduce: 1. Open a wallet that has a saved payment request. 2. Pay the request's address from another wallet and do not mine a block. 3. Open **Addresses** and start typing an inline label. Until the payment confirms, the Addresses list resets once a second: | Unconfirmed payment to a saved request | This PR | Base | |---|---|---| | Addresses list resets in 40 s | 41 to 42 | 1 | | 5,000-transaction wallet: window stall per reset | about 0.17 to 0.18 s | none after arrival | | 5,000-transaction wallet: CPU, offscreen | 27% (idle 4.4%) | 4.4% | | 30-transaction wallet: CPU, offscreen | 5.6% (idle 3.3%) | 4.1% | | Keys lost while typing a 100-key label | 20 to 40 | 0 | The label editor is destroyed 0.3 to 0.8 s after typing starts. The partial text is saved as the label, and the next Space opens Address details. The reset count is the same on a 30-transaction wallet, so this does not depend on wallet size. On this PR the other states are quiet: no resets when idle, two at the arrival of an ordinary unconfirmed payment and none after, and none once the request payment confirms. Label typing loses no keys in those states. `WalletStateBackend::poll` skips its processed-block comparison while `m_unconfirmed_payments` is set ([walletstatesnapshot.cpp#L209-L220](https://github.com/bitcoin-core/gui-qml/blob/1cc00c240d94beb12d6e073683ab581f686ded2e/qml/models/walletstatesnapshot.cpp#L209-L220)), so the 1 s timer ([walletqmlmodel.cpp#L605-L607](https://github.com/bitcoin-core/gui-qml/blob/1cc00c240d94beb12d6e073683ab581f686ded2e/qml/models/walletqmlmodel.cpp#L605-L607)) runs a full `read()` every cycle. `applyWalletState` then applies every snapshot and emits `walletStateChanged` without comparing it with the previous one ([walletqmlmodel.cpp#L658-L690](https://github.com/bitcoin-core/gui-qml/blob/1cc00c240d94beb12d6e073683ab581f686ded2e/qml/models/walletqmlmodel.cpp#L658-L690)). Applying a snapshot only when it differs, or polling only the status of the unconfirmed payments, would keep the lists stable. **Better than base** - **Ordinary incoming payment, 5,000-transaction wallet:** one stall of about 0.44 s at arrival. Base stalls for about 4.6 s. - **Display-unit change with a hidden 3,000-coin wallet open:** 0.09 to 0.10 s. Base takes 0.52 to 0.59 s. - **Receive address after a lost preference write (#972):** after restart the app offers a fresh address and one payment marks only the first request. Base re-offers the old address and marks both. This held when the preference file was unwritable and when the app was killed between the wallet write and the preference removal (13 of 13). The removal's result is still not checked ([walletstatesnapshot.cpp#L349](https://github.com/bitcoin-core/gui-qml/blob/1cc00c240d94beb12d6e073683ab581f686ded2e/qml/models/walletstatesnapshot.cpp#L349)), so the write is still lost silently; the restore no longer depends on it. A smoke run of nine flows passed on this PR, offscreen and native: start with two wallets, send, receive, a new block, request create, edit and delete, an inline label, wallet switching during traffic, closing a wallet with Activity open, and quit. Quitting with a refresh in flight on the large wallet exited cleanly 9 of 9 times. Tested on macOS / Qt 6.9, isolated regtest, RelWithDebInfo builds of both commits, offscreen and native. Each configuration ran once. Stalls were measured as the round trip of a bridge read sent every 50 ms, so stalls under about 0.1 s are not resolved. Typing and clicks went through the test bridge. The preference fault was applied to the INI store selected by the test switch, not the macOS preference store, and the kill route ran offscreen only.
rreview commented 2026-11-12 02:35:08 +00:00 (Migrated from github.com)

🟠 Minor · Applied snapshots still trigger GUI-thread Send balance scans

Applied snapshots now re-evaluate the pre-existing synchronous Send balance getters, including while Send is hidden; the available-balance query and valid-draft exhaustion check still scan wallet data and can wait on cs_wallet.

Location: qml/models/walletqmlmodel.cpp:666 (head).

🟠 Minor · Temporary worker unlocks race with GUI transaction signing

Overlapping worker signing or passphrase receive work with GUI transaction signing can let one operation relock the wallet after another skips its password prompt; this narrow race has not been reproduced deterministically.

Location: qml/models/signverifymessagemodel.cpp:89 (head).

🟠 Minor · A rejected Addresses action still replaces the Receive draft

Creating a payment request from Addresses while a label save is pending reports the address unavailable, but first clears and replaces the Receive draft, leaving state changed despite the rejected action.

Location: qml/models/walletqmlmodel.cpp:1252 (head).

🔵 Suggestion · Receive commands repeat full scans and retain a broad wallet lock

Successful Save/EnsureAddress commands perform three full wallet reads; EnsureAddress also holds cs_wallet through settings I/O, extending contention with GUI wallet calls, although stall durations have not been measured.

Location: qml/models/walletstatesnapshot.cpp:286 (head).

Review coverage was incomplete.


Reviewed: 389e2f1dac5c · Review report

<!-- ralph-major:bitcoin-core/gui-qml --> **🟠 Minor · Applied snapshots still trigger GUI-thread Send balance scans** Applied snapshots now re-evaluate the pre-existing synchronous Send balance getters, including while Send is hidden; the available-balance query and valid-draft exhaustion check still scan wallet data and can wait on `cs_wallet`. Location: [qml/models/walletqmlmodel.cpp:666](<https://github.com/bitcoin-core/gui-qml/blob/389e2f1dac5cae39ed1ff257a57a9344bcb6bc3d/qml/models/walletqmlmodel.cpp#L666>) (head). **🟠 Minor · Temporary worker unlocks race with GUI transaction signing** Overlapping worker signing or passphrase receive work with GUI transaction signing can let one operation relock the wallet after another skips its password prompt; this narrow race has not been reproduced deterministically. Location: [qml/models/signverifymessagemodel.cpp:89](<https://github.com/bitcoin-core/gui-qml/blob/389e2f1dac5cae39ed1ff257a57a9344bcb6bc3d/qml/models/signverifymessagemodel.cpp#L89>) (head). **🟠 Minor · A rejected Addresses action still replaces the Receive draft** Creating a payment request from Addresses while a label save is pending reports the address unavailable, but first clears and replaces the Receive draft, leaving state changed despite the rejected action. Location: [qml/models/walletqmlmodel.cpp:1252](<https://github.com/bitcoin-core/gui-qml/blob/389e2f1dac5cae39ed1ff257a57a9344bcb6bc3d/qml/models/walletqmlmodel.cpp#L1252>) (head). **🔵 Suggestion · Receive commands repeat full scans and retain a broad wallet lock** Successful Save/EnsureAddress commands perform three full wallet reads; EnsureAddress also holds `cs_wallet` through settings I/O, extending contention with GUI wallet calls, although stall durations have not been measured. Location: [qml/models/walletstatesnapshot.cpp:286](<https://github.com/bitcoin-core/gui-qml/blob/389e2f1dac5cae39ed1ff257a57a9344bcb6bc3d/qml/models/walletstatesnapshot.cpp#L286>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`389e2f1dac5c`](<https://github.com/bitcoin-core/gui-qml/commit/389e2f1dac5cae39ed1ff257a57a9344bcb6bc3d>) · [Review report](<https://review.fish.foo/report/gui/990-389e2f1dac5cae39ed1ff257a57a9344bcb6bc3d-2553-9.html>)
jarolrod commented 2026-11-13 20:34:22 +00:00 (Migrated from github.com)

For information, since this touches the same models: I ran 389e2f1dac5c against its base for the two macOS crashes, #1116 and #1119. I don't expect this PR to fix either, and it doesn't claim to.

#1119 still occurs on both pages. Both lists now refresh on one coalesced signal, but a notification arriving during a read starts a second read and every read ends in a full reset, so two resets one read apart remain. In alternating launches it crashed at least as often as the base (Addresses 36 of 40 against 8 of 28, View coins 8 of 20 against 3 of 20; the base ran below its usual rate, so I can't say it is worse).

#1116 is unaffected, as expected: the teardown code isn't touched. One side benefit: the freeze after a payment on a 5,000-transaction wallet drops from about 4.4 s to about 0.5 s, which removes the large-wallet variant of that crash (0 of 5 against 3 of 3, offscreen).

Details are on the two issues.

For information, since this touches the same models: I ran `389e2f1dac5c` against its base for the two macOS crashes, #1116 and #1119. I don't expect this PR to fix either, and it doesn't claim to. #1119 still occurs on both pages. Both lists now refresh on one coalesced signal, but a notification arriving during a read starts a second read and every read ends in a full reset, so two resets one read apart remain. In alternating launches it crashed at least as often as the base (Addresses 36 of 40 against 8 of 28, View coins 8 of 20 against 3 of 20; the base ran below its usual rate, so I can't say it is worse). #1116 is unaffected, as expected: the teardown code isn't touched. One side benefit: the freeze after a payment on a 5,000-transaction wallet drops from about 4.4 s to about 0.5 s, which removes the large-wallet variant of that crash (0 of 5 against 3 of 3, offscreen). Details are on the two issues.
Sign in to join this conversation.
No description provided.