fix: large-wallet sync starvation + shutdown/console-flash UX (Windows full node) #2
Reference in New Issue
Block a user
Delete Branch "fix/balance-poll-sync-contention"
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?
Summary
Fixes found while diagnosing a Windows full-node wallet that appeared stuck "downloading blocks" on a large (~5.3k-tx) fully-shielded wallet. Root cause was not the network — the wallet was starving the daemon's single block-connect thread. Five commits:
8707934sync starvation — the Overview balance poll (z_gettotalbalance, O(mapWallet) undercs_main, ~20s on this wallet) fired every ~2s and heldcs_main, soActivateBestChain/ConnectBlockonly ran in the gaps and the node fell further behind than it caught up. Fix: adaptive balance cadence (next poll waits >= scan-cost / 10%) + sync-settle hysteresis so it can't re-starve near tip; wallet mutations still force an immediate balance refresh.29274c2startup/shutdown UX — trim the verbose "taking longer than expected" notice; the shutdown screen now tailsdebug.log(windowless) for external daemons so the node flush/exit is visible.7e8b99ashutdown safety — confirm before stopping the daemon mid Sapling-witness-rebuild (stopping discards it -> multi-minute redo next launch): Keep-running / Stop-anyway / Cancel.a2f84beconsole-flash on launch — spawndragonxdwithCREATE_NO_WINDOWinstead ofCREATE_NEW_CONSOLE.0942691windowless shell-outs — route the remaining GPU/xmrig/wallet-rebuild_popencalls through aCreateProcess+CREATE_NO_WINDOWhelper (Platform::runHiddenCapture) so they never flashcmd.exe.Testing
test_phase4green on every commit; Windows cross-compile (--win-release) verified per commit.z_gettotalbalance/z_listunspent~20s each holdingcs_main; one core pegged onGetFilteredNotes; block-connect thread in Wait; download idle (~17 B/s) with all peers at max in-flight.Out of scope (separate, unvalidated)
A daemon-side fix to persist witness-rebuild progress across an interrupted rescan lives in the
external/dragonxrepo on branchfix/witness-rebuild-checkpoint. It is not compiled or tested (fund-adjacent) and must pass a node build + regtest/testnet/mainnet validation + adversarial review before shipping — intentionally excluded from this PR.🤖 Generated with Claude Code
Send and Receive are now consistent in layout, and the Send recipient row's buttons render correctly. Card envelope (Send ⇄ Receive consistency): - Add Layout::mainComposeCardBox(availW) — a single shared source for the compose card's width + centering (fill the available column up to content-max-width, then center). Both tabs derive their card from it, so they can't drift again. Previously Send capped at 760dp and Receive at 860dp, so the Send card rendered ~150px narrower on any window wider than ~860dp; now they fill available width identically. Receive: - Justify the footer buttons edge-to-edge (equal shares over the live count) instead of left-clustering with dead space, matching Send's full-width footer rhythm. - Build the address-dropdown preview to the combo's real pixel width so the trailing balance ("— 12.00000000 DRGX") no longer hard-clips at 150% (was char-count truncation). Send recipient row (input | Paste | contacts-icon): - Pin the contacts icon button to the frame height so the larger iconMed font doesn't auto-size it taller than Paste/the input. - Reserve the real ItemSpacing.x gaps (not the smaller spacingSm token) so the row no longer overshoots the card and clips the icon's right border. draw_helpers (root cause, app-wide): - TactileButton's icon path measured/drew the label INCLUDING the "##id" suffix (which CalcTextSizeA/AddText don't strip the way ImGui's text render does), shoving the glyph off-center-left. Strip at "##" before measuring/drawing. Corrects any icon button that passes an explicit size and a "##id" label; no-op for labels without "##". Verified via headless sweeps at 1.0x and 1.5x, plus a real 3800px-wide render (both cards byte-identical at L=1174/R=2773). ctest 1/1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.