Skip to content

platform-wallet: keep a pending shielded spend's state when a rebind drops its account #6159

Open

Description

@QuantumExplorer

Problem

A same-coordinator bind that leaves out an account runs purge_subwallet. That deletes the account's note-spend recovery records, its token notes along with their holds, and its token pool watermark. Registration only refuses this for identity-funded debits (register_locked skips note spends).

If a shielded spend from that account is still pending when this happens, the wallet loses the spend's hold and its redrive, and its activity row may stay Pending. No funds are at risk, because the notes are on chain:

  • If the spend landed, a rebind of the account rescans its notes and marks them spent.
  • If it did not land, the notes come back selectable, and only one of two spends of them can execute.

This applies to every shielded spend: credit transfers, unshields and withdrawals, as well as token pool spends (types 26 and 27). The token pool spends hold the shielded config lock until they return, so a bind cannot run while one is in progress. Nothing protects a spend after it returns as submitted.

Options

  • Refuse a bind that drops an account with a saved note-spend recovery record, as registration already does for identity-funded debits.
  • Or keep the dropped account's recovery records and holds until they settle.

Either way, this should be done for all shielded spends together.

Follow-up from the review of #6132.

Activity

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