Skip to content

qt: preserve consumed PQC usage when generated proof verification fails - #161

Merged
kiwidream merged 1 commit into
1.x.xfrom
kiwidream/preserve-usage-on-proof-verification-failure
Sep 16, 2026
Merged

kiwidream merged 1 commit into
1.x.xfrom
kiwidream/preserve-usage-on-proof-verification-failure

Conversation

@kiwidream

@kiwidream kiwidream commented Sep 15, 2026

Copy link
Copy Markdown
Member

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

  • Built locally: cmake --build build --target test_bitcoin-qt -j6.
  • Earlier full Mac Qt runs passed with 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 unchanged TestGUI, before the Preserve PQC usage when a generated Qt proof fails local verification #129 helpers; a process sample confirmed the wait.
  • Mutation checks detected missing usage, premature proof publication, wrong error styling, false empty-report consumption, stale usage, and a missing key. Clean rebuild and Qt run passed after restoration.
  • Docker lint on a full clone at 47abf782850a05b99c48a3ae38a6fa39a2fe3c75: Success: no issues found in 356 source files.
  • Fresh publication check: cmake --build build --target test_bitcoin-qt -j4 and xvfb-run -a env QT_QPA_PLATFORM=xcb ctest --test-dir build -R '^test_qbit-qt$' --output-on-failure -V passed at 47abf782 (25.89 seconds).
  • Independent Linux review: full Qt suite under 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

  • This PR targets the requested release branch 1.x.x.

Risk / Review Notes

  • Wallet behavior changed.

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

  • No public docs update needed. This restores consumed-capacity reporting in an existing error path using the same wording and fields as the ordinary signing-error path.

libbitcoinpqc Subtree Checklist

Not applicable; the subtree is unchanged.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…#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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T20:26:05.301362Z 47abf78 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kiwidream
kiwidream merged commit 141cd50 into 1.x.x Sep 16, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant