Skip to content

Preserve local PQC usage reporting when Qt data signing fails #121

Closed

Description

@kiwidream

Summary

PR #95 removes signer-local PQC usage data from portable Qt proofs while retaining local reporting after successful signing. On a failed signing attempt, however, the wallet interface returns only the signing error and discards the recorder/report, so qbit-qt cannot show counters consumed before failure.

This leaves an explicit acceptance criterion from issue #94 unmet: usage must remain visible locally even when no portable proof is produced.

Current behavior

At the reviewed head, src/wallet/interfaces.cpp records PQC counter advances around SignDataPQCHash, but the !proof branch returns only util::ErrorString(proof). PQCUsageReport is built and logged only after success. The Qt error path consequently receives no report to display.

A failure after reservation can therefore consume a stateful signing counter without showing the updated count, remaining budget, state, or warning to the user.

Expected behavior

Failed signing should preserve the minimal local usage state needed for safe operator decisions without adding that state to a portable proof.

Acceptance criteria

  • Return a structured failed-signing result that can carry both the error and any recorded PQC usage changes.
  • Build/log the usage report whenever a counter was reserved or consumed, including failure paths.
  • Display the updated local count, remaining budget, state, and warnings in qbit-qt after failure.
  • Keep portable proof output absent on failure and free of local PQC usage metadata on success by default.
  • Add a deterministic regression that fails after reservation and proves local usage remains visible.
  • Cover multi-leaf retry behavior without exposing non-selected keys in portable output.

Consensus impact

Consensus-adjacent. This does not change signature validity, but it affects stateful PQC wallet-signing safety and the operator's ability to manage limited-use keys.

References

Activity

  1. added
    bug
    on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions