Skip to content

platform-wallet: an affected-state result can confirm a shielded spend the scan proved failed #6160

Done

Description

@QuantumExplorer

Problem

Two shielded spend kinds wait for their result as an affected-state snapshot rather than as a proof that the transition executed: the identity top-up from the shielded pool (type 22) and the private document create from the shielded pool (type 29). The snapshot shows the spend's nullifiers spent (and, for a top-up, the identity's balance). It does not show which transition spent them.

When every nullifier of the spend was consumed by another transition (a second device restored from the same seed, a bundle with no padding action), a reply from a node can pass that check although the spend never executed. Both success handlers in rs-platform-wallet/src/wallet/shielded/operations.rs then:

This predates #6151: before it the row went from Pending to the same Confirmed. #6151 makes the contradiction visible, because the scan can now have proved the failure first. In the other order (the snapshot arrives first), the scan leaves the heightless Confirmed row alone.

What a fix needs

  • An affected-state success must not overwrite a failure that rests on proof: the scan reading another transition's action for one of the spend's inputs, or the spend's anchor proven pruned.
  • When the scan proves the failure after a snapshot confirmed the row without a height, the proof should win there too.
  • The notes of a spend proven failed must not be marked spent by the late result.
  • Keep the user experience decision behind the affected-state wait (a top-up is reported done without waiting for a sync) for the ordinary case where nothing contradicts it.

Follow-up from the review of #6151.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions