You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
platform-wallet: an affected-state result can confirm a shielded spend the scan proved failed #6160
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:
mark every note the spend selected as spent (finalize_pending), including notes the other transition did not spend.
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.
Activity