qt: preserve consumed PQC usage when generated proof verification fails - #161
Merged
kiwidream merged 1 commit intoSep 16, 2026
Merged
Conversation
…#129) When wallet signing of a P2MR data-hash proof succeeds but the Sign/Verify Message dialog's own local verification of the generated proof then fails, the red status now appends the wallet-local PQC usage the attempt consumed, using the same sentence and per-key format as the ordinary wallet-error branch. The proof JSON is still never written or exported for a rejected proof, and an empty or missing usage report appends nothing. Both failure branches share one file-local helper so the wording cannot drift; the success branch, the portable proof JSON, the verifier and the signing backend are unchanged. Add two GUI tests that corrupt a valid synthetic result so the real verifier rejects it: one asserting the consumed-usage block for a single NORMAL key and for a multi-key exhausted report, and one asserting that an empty report yields exactly the verification error even after a prior attempt displayed usage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When wallet signing succeeds but the generated P2MR proof fails local verification, retain the red error status and show the signature capacity consumed by that attempt. Reuse the ordinary signing-error formatter so every affected key and warning appears, while an empty report adds no consumption claim.
The rejected proof stays out of the output and clipboard. Regression coverage exercises the real verifier, multiple keys, and a subsequent attempt with an empty report.
Fixes #129.
Testing
cmake --build build --target test_bitcoin-qt -j6.QT_QPA_PLATFORM=cocoa ctest --test-dir build -R '^test_qbit-qt$' --output-on-failure -V, including the wallet helpers. The publication rerun was interrupted while waiting in a native PSBT dialog in unchangedTestGUI, before the Preserve PQC usage when a generated Qt proof fails local verification #129 helpers; a process sample confirmed the wait.47abf782850a05b99c48a3ae38a6fa39a2fe3c75:Success: no issues found in 356 source files.cmake --build build --target test_bitcoin-qt -j4andxvfb-run -a env QT_QPA_PLATFORM=xcb ctest --test-dir build -R '^test_qbit-qt$' --output-on-failure -Vpassed at47abf782(25.89 seconds).xvfb-run -a env QT_QPA_PLATFORM=xcb, six regression mutations caught (plus a branch-specific missing-key variant), restored candidate rebuilt and rerun green.Target Branch
1.x.x.Risk / Review Notes
This changes error presentation. Signing, proof verification, counter reservation, and portable proof JSON retain their existing behavior. A wallet-unload timeout occurred once during the writer's mutation checks; its rerun and restored candidate passed. The separate Mac publication-run interruption is recorded above.
Docs / Process Impact
libbitcoinpqc Subtree Checklist
Not applicable; the subtree is unchanged.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.