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: a swept and reinstated asset lock loses its recorded shielded recipient #5778
#5762 (closes #5603) records the Orchard recipient of a Core → Shielded funding on the tracked asset lock, so a resume after an app kill pays the recorded recipient and refuses another one. That binding does not survive a sweep followed by a reinstatement of the same funding transaction.
A shielded funding to recipient A is tracked with shielded_recipient = Some(A).
The funding transaction is swept, for example after a conflict. remove_tracked_asset_locks_for_swept (packages/rs-platform-wallet/src/wallet/asset_lock/sync/reconstruction.rs) removes the whole live entry and emits a persistence removal.
The same transaction returns. Reconstruction in the same file rebuilds the entry with operation_id: None and shielded_recipient: None, and apply_record inserts it into the live map.
A generic resume reaches resume_recipient(None, requested) and accepts any recipient B.
preserve_recovery_metadata cannot help, because it only protects an entry that still exists. When the sweep and the reinstatement are folded into one persistence round, storage may keep A through its keep-on-nil rule while the live map holds None, so the protection differs before and after a reload.
The operation UUID has the same shape of gap for locks outside the retention added for drains (see #5528). A lock without a UUID, such as a typed-amount shielded funding, is not covered by that work.
Impact
Rare, since it needs a sweep and a return of the same transaction, but when it happens the destination check from #5762 is bypassed: the lock is treated as a legacy row and the caller's recipient is accepted.
Suggested direction
Retain non-actionable recovery metadata (recipient and operation UUID) across a removal and a restart, and reattach it when the same outpoint is recovered. If it cannot be reattached, fail closed and refuse the resume. One design should cover both fields.
Acceptance
A recipient-bearing lock without a UUID keeps its recipient through sweep and reinstatement, both in memory and after a reload, including when both events share a persistence round.
A resume to a different recipient is refused with AssetLockRecipientMismatch after reinstatement.
The existing sweep and reinstatement regression test is extended with a recipient-bearing lock.
Activity