WIP: qt: refactor QML frontend onto owned models

bitcoin-core/gui-qml: PR #1142

9 minor findings · 3 suggestions

Earlier concerns neither republished nor resolved: 6 minor findings · 8 suggestions. See the Run archive for their assessments.

Findings

Link

[minor] · Wallet sends and Speed Up ignore raised fee limits

Wallet-built transactions with fees above 0.1 BTC are now refused even when the configured -maxtxfee and -maxfeerate allow them; users retaining the default limits are unaffected.

Location: qml/walletsend.cpp:196 (head).

Details and suggested fix

WalletSendHandle supplies the reviewed fee and the wallet's PSBT policy to walletsend::Execute, which refuses a Blocked decision before calling commitTransaction. That policy's ReadNode compares the absolute fee with the fixed MaxFee() of 0.1 BTC and also supplies a fixed fee-rate cap to testmempoolaccept. Speed Up receives the same policy. A transaction built within raised wallet limits can therefore reach review but fail on submission with a misleading node-maximum error. Base committed directly, and pinned Core broadcasts wallet transactions with m_max_tx_fee and m_max_tx_fee_rate. Use the wallet's configured limits for both checks on wallet-built sends and bumps, while preserving the existing raw-transaction limits for imported PSBT broadcasts.


Link

[minor] · PSBT file import no longer matches the export size limit

GUI file import now rejects PSBTs above 4 MiB, although the previous importer accepted larger files and export still permits 100 MiB; how often users encounter such files is unconfirmed.

Location: qml/paymentimport.cpp:29 (head).

Details and suggested fix

PaymentImportOperation::requestFile constructs a file input, and ReadSource reads at most MAX_FILE + 1 bytes with MAX_FILE fixed at 4 MiB. Larger files fail before PSBT decoding. Base used MAX_FILE_SIZE_PSBT, and FileExportOperation still allows 100 MiB, so a large exported PSBT cannot complete the GUI save-and-reopen round trip. PSBTs carrying full previous transactions are a plausible trigger, but no test producing such a file was identified. Restore the PSBT-specific MAX_FILE_SIZE_PSBT allowance and retain a smaller limit for payment-request text.


Link

[minor] · A refused receive type stays hidden after its capability changes

An address type refused once remains unavailable in Receive until wallet reload, even if a later active descriptor import makes Core able to generate it.

Location: qml/walletopening.cpp:539 (head).

Details and suggested fix

Session::markReceiveTypeUnavailable permanently inserts the type into the opening's refusal set. Metadata copies that set into WalletModel, whose address-type list excludes it. handleCanGetAddressesChanged only schedules another observation, so it republishes the same refusal. Pinned Core's LoadActiveScriptPubKeyMan can activate a type at runtime and emits this notification. Invalidate or re-check cached refusals when address-generation capabilities change, and cover importing an active descriptor after Receive has already encountered a refusal.


Link

[minor] · Close leaves the inline Receive editor unable to save

Closing a clean inline Receive editor leaves the page displaying a closed editor whose Create or Update action is disabled; New request is needed to recover.

Location: qml/components/ReceiveRequestEditorCard.qml:96 (head).

Details and suggested fix

savedRequestCloseButton always calls editor.requestClose(), and the card forwards the editor's closed signal as closeRequested. Unlike the modal consumer, ReceivePage has no handler for that signal. The clean editor enters Phase::Closed, but WalletReceiveModel only unparents it unless a replacement is pending, leaving the page bound to an editor that cannot save. ensureAddress() does not replace it. Hide Close in the inline workspace, and add a test that closing a clean inline editor cannot strand the page.


Link

[minor] · The request editor no longer offers bare-address copying

An unpaid saved request shows its address as non-selectable Text and offers only URI or QR copying, so users must leave the request to copy its bare address.

Location: qml/components/ReceiveEditorFields.qml:20 (head).

Details and suggested fix

ReceiveEditorFields renders editor.address in CoreText, which derives from plain Text. SavedRequestSharing offers Copy request, Copy QR image and Save QR image, but no address action. Base used an interactive AddressLabel with clipboard access for unsaved or sharable requests. Restore that address control, or provide an explicit Copy address action bound to editor.address, preserving the previous sharing restriction.


Link

[minor] · The cluster check can override successful replacement admission

A replacement sharing an unconfirmed-parent cluster at its limit can be blocked despite testmempoolaccept allowing it; no test or production report producing this case was identified.

Location: qml/psbtpolicy.cpp:125 (head).

Details and suggested fix

ReadNode calls chain->checkChainLimits(transaction). In pinned Core, that check stages the new transaction without removing its conflicting original, while real admission stages conflict removals before enforcing cluster limits. Evaluate returns Blocked for this addition-only failure before considering Admission::Allowed, and submission refuses that decision. Imported replacements can therefore be rejected even though replacing the original keeps the cluster within its limit. Speed Up passes no chain and is unaffected. Let successful admission of the exact transaction supersede the addition-only cluster check.


Link

[minor] · A definite fee-bump refusal is reported as uncertain

A late confirmation or descendant can produce a definite fee-bump refusal that the UI classifies as Uncertain; no production occurrence was identified.

Location: qml/walletbump.cpp:199 (head).

Details and suggested fix

When commitBumpTransaction returns false, walletbump::Execute records Error::Commit, and publishCommit maps it to Phase::Uncertain. In pinned Core, every non-OK return from the underlying fee-bump commit occurs before wallet.CommitTransaction; after committing, it returns OK. Thus an original that confirms or gains a descendant after the final application checks can produce a known refusal, not an unknown outcome. The current attempt refuses preparation and reset in this state, although presenting and releasing its result permits a later fresh attempt. Map a false return to Failed or NeedsRevalidation, reserving Uncertain for exceptions with genuinely unknown effects.


Link

[minor] · Recipient edits retain discarded clipboard-check objects

With Send active and non-empty clipboard text, repeated recipient edits retain cancelled clipboard-check objects until the page is destroyed.

Location: qml/models/sendimportmodel.cpp:235 (head).

Details and suggested fix

checkClipboard() disconnects and cancels the previous check, then creates another import operation parented to SendImportModel. PaymentImportOperation::cancel() releases its actor and snapshots but does not destroy the object. Each successful creation also leaves a projection-registry entry that is erased only on destroyed, so discarded checks accumulate with editing. Schedule discarded operations for deletion after cancelling them, and test that repeated edits leave a bounded number of operation children.


Link

[minor] · The new threads drop the documented macOS stack safeguard

The move to default std::thread construction removes the explicit 8 MiB macOS stack used for Core startup; no overflow was reproduced in this review.

Location: qml/executor.cpp:26 (head).

Details and suggested fix

Base BackendExecutor set an 8 MiB stack under Q_OS_MACOS, documenting that Core startup, particularly RandAddStaticEnv under sanitizers, can exceed the 512 KiB secondary-thread default. QmlInitExecutor used that executor. The new shared Worker and init executor both construct plain std::thread instances without equivalent sizing. Restore explicit stack sizing for the Core and initialization threads on macOS, or provide stack-use evidence justifying removal of the safeguard. The actual requirement depends on compiler and sanitizer configuration.


Optional improvements

Link

[suggestion] · Console redaction still retains importdescriptors private keys

The filter matches pinned Bitcoin-Qt and still retains importdescriptors arguments containing private keys in echoed requests and session history; this is an inherited hardening gap, not a new exposure.

Location: qml/models/rpccommandexecutor.cpp:28 (head).

Details and suggested fix

HISTORY_FILTER omits importdescriptors, and RpcConsoleModel publishes prepared->filtered() as both the request row and recall entry. A descriptor containing an xprv or WIF key therefore remains in those session records. Redact this command's arguments and add a descriptor-private-key console test. Also correct the adjacent comment: pinned Qt's filter already contains addhdkey, so the app does not add that protection beyond Core's policy.


Link

[suggestion] · The captured passphrase buffer is released without cleansing

The Native handoff retains an uncleansed QString passphrase buffer; improving this would cover additional C++-owned storage, not copies already held by QML or JavaScript.

Location: qml/secretinput.h:34 (head).

Details and suggested fix

secretinput::Input stores const QString m_text until the queued action materializes it and the retained input is released. materialize() cleanses its temporary UTF-8 QByteArray, but the retained UTF-16 buffer has no corresponding cleanup. Make the retained member non-const and cleanse it on release when isDetached() confirms exclusive ownership, without detaching merely to wipe a new copy. This preserves deferred Native conversion while reducing the lifetime of recoverable passphrase bytes in app-owned storage.


Link

[suggestion] · The new import-source diagnostics bypass translation

ReadSource constructs its file, size, unsupported-source and malformed-PSBT diagnostics with QStringLiteral, so these user-visible errors remain in English.

Location: qml/paymentimport.cpp:101 (head).

Details and suggested fix

Errors such as “The import source could not be opened” and “The PSBT is malformed” are returned as literal strings, and DesktopIntentModel::inspectionText() displays the inspection error without translating it. These messages therefore cannot be extracted and translated through the current path. Use QCoreApplication::translate with a fixed context for these diagnostics, then regenerate the catalogs.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

Keeping wallet work off the GUI thread addresses both lock contention and expensive data acquisition. Earlier Core GUI work avoided taking wallet/chain locks during GUI notifications; later wallet-loading work identified address and transaction prefetching as substantial startup costs.

This explains the refactor's cached display state and background readers: moving only an obvious load or create operation does not remove synchronous discovery, metadata, history, or completion-handler costs. The earlier application issue explicitly includes those surrounding operations and wallet removal.

Source 1 · Source 2 · Source 3 · Source 4

Explicit operation state has a historical purpose beyond merely running a function asynchronously. The wallet-loading discussion justified activity objects for progress, interruption, and follow-up questions. Earlier application work also tied a delayed deletion's UI completion to the particular dialog opening that initiated it, including when the same request was reopened.

These are direct antecedents of page-owned operations and fixed wallet/page scopes. They explain why a result's initiating context matters independently of whether the backend request itself completed successfully.

Source 1 · Source 2

PSBT history deliberately distinguishes compatibility with signing software from the amount of data needed for hardware-wallet verification. Core added full previous transactions for SegWit inputs while retaining witness_utxo for existing software, and did not require full previous transactions in its own SegWit signer. A user objected that the additional data made printed-QR offline signing much harder.

The imported-PSBT fee work sits within this verification-versus-portability tradeoff. The head code separately authenticates previous outputs, permits a missing-proof state, and retains the original imported document rather than treating inspection as permission to rewrite it.

Source 1 · Source 2 · Source 3

The upstream external-signer hardening proposal treats a signer response as a contribution to an existing transaction, not unrestricted replacement authority. Its stated motivation includes misbehaving signers that remove outputs, reduce values, or change scripts. It also explicitly excludes complete protection against a malicious signer process running as the same user.

This explains the application's comparison of transaction version, locktime, outputs, input outpoints, and sequences against reviewed terms. The historical threat model supports transaction-integrity checks without implying that such checks isolate the application from an already-compromised host process.

Source 1

Upstream's PSBT export decision balanced interoperability, UI complexity, and release constraints. A proposed version-selection checkbox was dropped to simplify backporting past translation string freeze. The captured discussion subsequently distinguishes v0 GUI exports from v2 external-signer exchanges, accepting a newer-signer requirement for the latter.

The application's ExportReview now creates new files as v0 while preserving an imported document's version. That behavior follows a historical distinction between portable files exchanged with other installations and the application's configured signer interface—not a general rule that every PSBT should use one version.

Source 1 · Source 2 · Source 3

Reuse avoidance was introduced against an active privacy adversary, not simply as a coin-selection preference. Its release notes describe an attacker sending near-dust outputs to a previously used address so that later spending inadvertently reveals links. The policy distinguishes used destinations and works together with avoiding partial spends.

This makes the affected Send, maximum-amount, balance, and coin-selection behavior a wallet privacy-policy boundary. Refactoring those calculations can affect which attacker-supplied outputs enter a payment, even when the recipient and nominal payment amount are unchanged. The pinned policy propagation was not inspected.

Source 1

Pruning historically trades retained historical data for storage savings, limiting what wallet rescans can reconstruct locally. The original key-import proposal distinguished useful forward-looking imports without rescan from complete rescans, and suggested bounded rescans compatible with retained block depth.

This supplies the reason behind the pruning-specific wallet-close warning and related storage behavior: reopening a wallet is not necessarily equivalent to resuming continuous observation when the required blocks are no longer retained. The exact pinned close/reload path was not inspected.

Source 1

Ralph's inferences

Moving wallet operations into asynchronous owners also makes ownership an authorization boundary: a delayed response should remain attached to the wallet, review, or dialog opening that supplied its original intent, rather than inherit whichever context is currently visible.

The base executor already guarded receiver lifetime, while the head architecture adds fixed wallet scopes, operation ownership, and cancellation before admission. The earlier dialog-opening fix supplies a concrete historical premise for distinguishing object lifetime from the lifetime of a user interaction. This is a design interpretation, not a finding that every new path enforces it.

Source 1

An available PSBT analysis fee is a different contract from an authenticated fee attached to a user's review. The unchanged pinned Core analyzer computes from PSBT-provided UTXO information; the new application proof checks full-transaction identity or separately verified outputs and binds the result to transaction terms.

The base summary and broadcast path consumed AnalyzePSBT's fee. The head separates document inspection, authenticated previous-output evidence, and matching against approved terms. This distinction explains why successful parsing, signing capability, fee calculation, and authorization are separate stages without requiring any change to Core consensus or P2P behavior.

Unresolved disagreements

The historical PSBT discussion exposes a validation-layer tradeoff: one participant proposed rejecting inconsistent witness and non-witness UTXO information through sanity checks, while the author questioned making application-logic checks prevent deserialization, because a correctly formatted but unusable PSBT may still be worth decoding. The author proposed follow-up checks; the inspected record does not settle the general boundary.

This matters to the refactor's separation of import, inspection, review eligibility, signing, and broadcast. Accepting a document for display and accepting its claims as transaction authority serve different purposes. The historical disagreement is not evidence of a present defect.

Source 1 · Source 2