mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Keep node information, RPC and peer management responsive #985
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!985
Loading…
Reference in a new issue
No description provided.
Delete branch "pr/qt6-async-03-node-tools"
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?
Node information, peer polling, ban-file access and RPC completion metadata can wait for backend locks or storage. Build views from cached results and run their queries and commands on workers.
Keep peer actions tied to the selected peer ID, combine refresh requests while work is pending, and stop unnecessary polling when views are hidden. Route RPC
stopthrough the independent shutdown worker so it remains usable while another RPC command is blocked.Regression tests cover hidden views, repeated refresh requests, changing peer selections, command failures, refused commands during shutdown and shutdown during a blocked RPC command.
Validation at
b3fb95ba779(rebased onqt6db9aa8429ac): Release build and all six CTest groups pass with Qt 6.4.2. App lint (pinned Core checks) passes forqt6..HEAD. Core-pinned clang-tidy 23 with the Bitcoin plugin passes onqml/models/nodemodel.cpp,qml/bitcoin.cppandtest/test_nodemodel.cpp. Sanitizer, functional andinterface_gui.pyruns were not repeated for this revision.The
invalidateblockcase from #963 (header height and block clock after invalidating the tip) is not fixed here, so this PR is only part of #963.Part of #963
Fixes #964
Fixes #965
Concept ACK 752c794
Tested #980 (21b5111d8c) and #985 (752c7946d6, includes #981) with GUI-thread repros for #959-#965. Each repro injects a 400 ms delay into the mocked backend calls (20 ms per filesystem call for #960) and measures how long the GUI thread stalls.
Results (before -> after):
-shutdownnotifystartShutdownonnode-interrupt)bitcoin.conf/settings.json(FIFO)stop;listRpcCommandsTwo paths still block the GUI thread:
refreshExternalSignerStatus()runslistExternalSigners(HWIenumerate) synchronously.WalletQmlController::initialize()still reads wallet history on the GUI thread (0.8 s for 1 wallet, 1.6 s for 3).Are these planned for the wallet PRs?
Also please link your PRs with the issues to close them
rebased
🟠 Minor · The first empty language snapshot leaves the startup translator installed
With a saved GUI language and an explicit
-lang=, the asynchronous settings snapshot resolves an empty language without emittinglanguageChanged, leaving the saved translator installed.Location:
qml/bitcoin.cpp:864(head).🔵 Suggestion · Live node-information updates rebuild the whole row list
While Node information is visible, block, header and status deliveries rebuild and reassign all 15 rows on the GUI thread; the performance cost is unmeasured.
Location:
qml/components/NodeInformationPopup.qml:29(head).🔵 Suggestion · Focused coordination tests duplicate or bypass the production connections
The peer-action harness duplicates production wiring, BanListModel unit tests use separate executors, and the blocked-RPC stop test bypasses the coordinator, leaving their combined ordering without a deterministic regression test.
Location:
qml/bitcoin.cpp:768(head).🔵 Suggestion · Onboarding startup still resolves settings synchronously before the worker read
bitcoin.cpp:374 still resolves onboarding startup status synchronously before any window exists. The model's worker read at onboardingoptionsmodel.cpp:43 repeats it, and the FIFO test constructs the model directly, bypassing the blocking probe. This predates the PR.
Location:
qml/bitcoin.cpp:364(head).Review coverage was incomplete.
Reviewed:
27b72a172d37· Full review report · Previous reportspermalink
Wallet-history reads are handled in #990; external-signer discovery remains tracked in #977. Closing links for #963, #964 and #965 are included.
Restacked onto the latest #981 review fixes at
41205efbe2. Validation at41205efbe262: full build, seven relevant non-QML CTest groups, boot and all five shutdown scenarios pass. This includes 963 C++ passes with 12 existing skips and 20 integration cases. QML resources and fixtures match118db688, where the full QML suite and peer/console/node-dialog functional checks passed. The node-tool commits retain identical patches through the restack.The inherited language/preparation regressions pass 32 strict LLVM 22 ASan/LSan/UBSan/integer cases and 32 TSan cases at #981, with matching LLVM 22/Bitcoin-plugin checks. Earlier node-tool tidy/lint results remain applicable to unchanged own patches. Full sanitizer validation of the combined application remains unestablished; #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
7f4c8b6fad: 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. A fresh CI-matching Qt 6.2 build passes all 689 QML cases. Own node-tool 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
122aa0db1d: 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.goes with the comment on nodemodel.cpp:920
This only ever sets the ban list’s flag to true, so a refused peer action can’t clear it. Mirroring the state handles both cases:
On a normal finish, this sets the flag back to false just before peerActionFinished, and finishExternalAction() still does the refresh.
This seems like a regression.
This rebuilds every row whenever nodeInformationChanged fires. That signal fires on every block, header, peer, warning and network notification, and after every refreshStatus(). Assigning a new array to rows makes the Repeater destroy and recreate all ~17 rows. With the popup open during initial sync, that can happen dozens of times a second, which works against what this PR is for, and selected text is lost each time.
Suggest throttling. Use start() only when the timer isn’t already running; restart() would never fire while notifications keep arriving:
Rows show “Unknown” until startup finishes -
If submit() refuses the task, m_peer_action_pending stays true. peerActionPendingChanged has already fired, so BanListModel has also marked an external action as pending, and with no peerActionFinished coming, every ban-list refresh after that is deferred forever. unbanAt already clears its pending flag when submit returns false; suggest the same here and in banPeer (line 934)
The QML already falls back to nodeModel.peerActionError, so the user sees why. submitNetworkAction() (line 576) also ignores a refused submit and would leave networkActionPending stuck.
Concept ACK
I tested
3d03bebin regtest on Linux with Qt 6.12. All ctest tests pass, and so do the peers, console and runtime dialog functional tests.Typing
stopin the console while the node is still starting up crashes the app on qt6, and on this branch it closes cleanly, so that's fixed. It would be nice to have a test for it; one way is to mine a few thousand blocks, restart with-checkblocks=0 -checklevel=4, and sendstopwhile the node is still loading.jarolrod's
invalidateblockcase from #963 still happens on this head. Node information keeps showing header height 200 while the node is at 170, and with a peer connected the block clock stays stuck at 99.9% / Estimating even though the node is fully synced. Since the PR saysFixes #963, I'd either fix that case here or change it toPart of #963.The description also mentions receiving-address changes that aren't in the diff and says the PR includes #981, and it needs a rebase because of conflicts in
BannedPeersPopup.qmlandnodemodel.cpp.Fixed in
94682b21cb. The popup reads the rows at most every 500 ms while it is open, using a timer that is started, not restarted. The Repeater now uses the row count as its model, so a refresh updates the existing rows in place: they are not recreated, and a selection survives unless that row's value changes. A new QML test checks both.Fixed in
94682b21cb.disconnectPeerandbanPeercallrejectPeerAction()whensubmit()refuses the task. It clears the pending state and reports that the node is shutting down.submitNetworkAction()now also clearsnetworkActionPendingon a refused submit. A unit test covers all three.Fixed in
94682b21cb. The ban list now mirrorspeerActionPending()in both directions, as suggested.Closing: #1142 moves node information, RPC console and peer work off the GUI thread with its own design. #964 and #965 stay open to confirm against #1142.