Repository navigation
Description
TL;DR: If a wallet shields funds from an asset lock and Platform accepts it, but the wallet never records the lock as used (the app stops at the wrong moment, or the local write fails), the lock stays "resumable" forever. Resuming it is always refused, and nothing ever closes it.
User story
As a user of a wallet built on platform-wallet (for example Dash Evo Tool shielding Core funds), I want an asset lock that Platform already used to show as finished, so that I am not offered a "resume" that can never succeed.
Scenario
Base flow
The wallet builds and broadcasts an asset lock, waits for its proof, submits a shield-from-asset-lock transition (Type 18), and then records the lock as consumed locally.
Actual behavior
- Platform accepts the Type 18, but the local
Consumedrecord is not written. This happens when the process stops or the request is dropped after submit and before the write, when the response is lost, or when the store write fails. Inshielded/fund_from_asset_lock.rsa failedconsume_asset_lockafter an accepted Type 18 is only logged ("the lock row stays non-Consumed and surfaces in the Resumable Funding list"). - After a restart the row reloads as nonterminal and is listed as resumable.
- A resume submits again and gets Platform's "asset lock already consumed" report. That report is unauthenticated (one node,
CheckTx), soreconcile_asset_lock_submit_result(asset_lock/orchestration.rs) correctly does not trust it: it records consumption-unknown at most, and the row never becomesConsumed. - The value itself is not lost: shielded note sync finds the note. Only the asset-lock lifecycle is left stuck.
Expected behavior
- When the wallet sees an already-consumed report for a tracked lock, or during recovery of a nonterminal lock, it asks Platform for the outpoint's state with a proof. If the verified state is fully consumed, it writes the
Consumedtombstone, and the lock stops appearing as resumable. - A partially consumed lock and a not-spent lock keep today's behaviour, with the verified state available to the caller.
- Without a proof, behaviour stays exactly as today: nothing terminal is written on an unauthenticated report.
Detailed discussion
#5580 covers the wallet-drain path (operation-tagged Type 18) and proposes the proof-backed outpoint query. #5581 adds that query (getAssetLockOutpointInfo) and removes the drain shortcut, but notes that the query alone does not resolve the unknown outcome on retry or resume. This issue is the missing wallet-side step for every tracked asset lock, not only drains:
- Use the verified outpoint state from feat(platform): add proof-backed asset lock outpoint query #5581 in
reconcile_asset_lock_submit_resultand in asset-lock recovery (sync/recovery.rs,resume_asset_lock) to writeConsumedfor a fully consumed lock. - Cover Type 18 from wallet balance, Type 18 from an existing lock, and identity create/top-up, which share the generic reconciliation.
- Tests: accepted-but-not-recorded lock + verified fully consumed → tombstone, no further resume; partially consumed → no tombstone; proof unavailable or invalid → unchanged nonterminal state and the existing typed error.
Open questions:
- Whether reconciliation runs only on an already-consumed report, or also on load for every nonterminal lock that has a proof (one query per lock).
- Whether the tombstone should record that it was reconciled rather than written after a direct submit.
Prior work
- Wallet drain completes on an unauthenticated "already consumed" report; add a proof-backed asset-lock outpoint query #5580: drain completes on an unauthenticated already-consumed report; proposes the proof-backed query.
- feat(platform): add proof-backed asset lock outpoint query #5581 (open): adds the proof-backed asset-lock outpoint query.
- fix(platform-wallet): settle already-consumed asset locks and survive an ambiguous resume broadcast #4337 (closed, not merged): settled already-consumed asset locks without a proof.
- Asset-lock ChainLock finality wait has no per-record promotion and no cancellation — stuck locks unrecoverable, app shutdown hangs #4238: cancellable asset-lock finality waits. Cancelling the finality wait itself leaves the lock tracked and resumable, which is safe. A stop after submit leads to this issue.
Attribution
🤖 Co-authored by Claudius the Magnificent AI Agent
Activity