Skip to content

platform-wallet: name the resumable lock for every local failure before a funded flow's first dispatch #6286

Backlog

Description

@romchornyi

Rule

In every asset-lock-funded flow, a local failure that happens after the Core lock exists but before the first Platform transition is signed or sent, and that a resume of the same lock could get past, should be classed as refused before dispatch. Then AssetLockManager::with_funded_lock / hold_resumable_lock names the still-resumable lock as held (PaymentDelivery::LockHeld) instead of answering MaybeSent with no lock. Failures after a possible dispatch stay MaybeSent.

#5928 (e08ff1d) applies this to the first Orchard proof of shield funding (join_initial_proof). The sites below still answer MaybeSent with no lock (paths under packages/rs-platform-wallet/src/, at that commit).

Sites

  1. Shield funding, first attempt inside the submit closure (wallet/shielded/fund_from_asset_lock.rs, the submit_with_chain_lock_fallback closure): the fee recompute, is_bound_to, the re-proof after a protocol-version change, and a second VersionMoved all map to dash_sdk::Error::Generic. A blanket before_dispatch there would be wrong, because the closure also runs after attempts that may have been dispatched. It needs an SDK error the wallet classes NotSent. maybe_dispatched already turns that into StateTransitionResultUnconfirmed after a possible dispatch.
  2. Proof wait after a fresh build: a persister lookup failure becomes AssetLockProofWait (wallet/asset_lock/build.rs, wait_for_funded_asset_lock_proof; sync/proof.rs, wait_for_proof / validate_or_upgrade_proof). It affects every fresh funded flow.
  3. IS→CL fallback after an InstantSend timeout: the same lookup failure in upgrade_to_chain_lock_proof, reached from resolve_chain_proof_after_is_timeout (wallet/asset_lock/orchestration.rs). No transition exists yet at this point.
  4. Invitation after its row is saved (wallet/identity/network/invitation.rs): proof-wait errors, export_invitation_private_key, encode_invitation_uri. This flow never submits a transition, and the way on is the reclaim of the lock.

Out of scope here

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