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: release an unconfirmed token pool spend once its token anchor is proven pruned #6155
A token pool spend is either a shielded token transfer (type 26) or a token unshield (type 27). Each one keeps its saved recovery record, and its fee notes and token notes reserved, until one of these happens:
the credit pool scan sees it land;
the credit pool prunes its fee bundle's anchor.
Drive's prune_pool_anchors_v0 always keeps the newest anchor of a pool. So while nobody writes to the credit pool, the fee anchor is never pruned. Meanwhile the token pool can keep moving, for example through identity-funded token shields, and prune the spend's token anchor. Once that happens the spend can never execute, but the wallet still holds both sets of notes and shows the spend as pending.
The first credit pool write by anyone releases the hold: a credit shield, transfer or unshield, or another shielded-fee token transition. After that, the next prune drops the fee anchor and the existing release path runs. So the notes are held, not lost.
Every unconfirmed credit-only spend already waits the same way in an idle credit pool. This only shows up on a network whose only shielded activity is identity-funded token shields, such as a quiet devnet or testnet.
What a fix needs
Release such a spend once its token anchor is proven pruned, at any protocol version:
Keep the token id, the token anchor and the height of the anchor set it was read from in the saved record (PendingRedrive) or on the token note reservation.
Each sync, for pools with live token pool spends, read the token pool's recorded anchor set with a proof.
Treat the anchor as pruned only under the rule the credit pool release uses (PrunedAnchorEvidence::proves_pruned): it is absent from a set proven at a height at or above the one it was read at, and the token scan covers that height.
Then mark the row failed and release both reservations.
Activity