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: platform-address funding persists an upgraded ChainLock proof before Platform accepts it, so a rejected proof is replayed on every resume #4763
A ChainLock asset-lock proof that Platform rejects with InvalidAssetLockProofTransactionHeightError must not survive as the tracked lock's proof. The next resume should start again from evidence Platform has not rejected (the InstantSend proof, or a fresh height lookup), as the shielded funding path does since #4738.
Current Behavior
platform_addresses/fund_from_asset_lock.rs upgrades an IS proof to a ChainLock proof after a 10513 rejection and immediately persists it — advance_asset_lock_status(&out_point, AssetLockStatus::ChainLocked, Some(chain_proof)) (lines 394-402 at 82d7450a0e) — then submits. If Platform rejects that proof because the transaction is not at or below the claimed height, the row keeps status ChainLocked with the rejected proof. On the next resume validate_or_upgrade_proof returns any non-Instant proof unchanged (sync/proof.rs:307-308) and resume_asset_lock re-persists it (sync/recovery.rs:1679), so the same rejected proof is submitted again on every attempt.
#4738 added revert_rejected_chain_proof (sync/tracking.rs) and wired it only into shielded/fund_from_asset_lock.rs. Identity registration / top-up (identity/network/registration.rs:186-200, 247-262) does not persist the upgraded proof before submitting and is not affected by the replay, though it would benefit from the same handling for consistency.
Possible Solution
In the platform-address funding 10513 arm, on is_asset_lock_proof_transaction_height_invalid(&e) call revert_rejected_chain_proof(&out_point, original_instant_proof) before returning the Platform error, mirroring the shielded path. Consider a shared helper on AssetLockManager (e.g. submit_upgraded_chain_proof(out_point, instant_proof, chain_proof, submit)) used by all callers, so the persist-then-revert pair cannot be forgotten again. Tests: mirror rejected_chain_proof_restores_the_instant_proof / revert_leaves_a_row_that_moved_off_chain_locked against the platform-address flow.
Steps to Reproduce
Track an asset lock with an InstantSend proof; make Platform reject the IS proof (10513) and make the ChainLock height source report a height above the transaction's real block.
Run platform-address funding from that lock: the row becomes ChainLocked with the wrong Chain proof; Platform rejects it with InvalidAssetLockProofTransactionHeightError.
Resume the lock: the same proof is submitted and rejected again; the row never leaves ChainLocked.
Context
Raised by review on #4738 (which fixes the shielded path). Related: #4238 (ChainLock wait without per-record promotion / cancellation).
Activity