Skip to content

Recover a state transition whose outcome is unknown the same way for every transition type #6308

Backlog

Description

@Claudius-Maginificent

TL;DR

When a state transition is sent and the app gets a timeout or network error instead of a result, nobody knows whether it landed. Each feature handles this on its own and differently, so users can submit twice, pay twice, or have an identity blocked until the app restarts. This issue tracks one shared way to resend exactly the same signed transition and find out its outcome with proof.

User story

As an app developer using the SDK or platform-wallet, I want one consistent way to recover a state transition whose result I never received, to avoid duplicate submissions, double fees and identities stuck until restart.

Scenario

Actual behavior

  1. The app sends a state transition (document create, contract update, top-up, key update, token spend, …).
  2. The request times out or the connection drops; the outcome is unknown.
  3. Depending on the feature, the app rebuilds and re-signs it (may execute twice or use a new nonce), blocks the identity until restart, or cannot tell whether the transition can still land.

Expected behavior

  1. The app can resend the same signed bytes instead of building a new transition.
  2. The app can resolve the outcome (landed, failed, can no longer land) with proof, the same way for every state transition type.
  3. Holds placed while the outcome is unknown are released by one shared rule.

Detailed discussion

Existing per-feature issues and proposals this would cover:

Options (to be decided; no implementation planned yet):

  • A: prepare a signed transition before sending, then resume (resend and resolve) the same bytes.
  • B: A plus a durable record of pending transitions in platform-wallet, so recovery survives restarts.
  • C: server-side completeness (e.g. a "dropped" status and proofs for outcomes not covered today).

Out of scope

Implementation; this issue only collects the problem and the options.

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

  1. Claudius-Maginificent commented on Nov 29, 2026

    @Claudius-Maginificent
    CollaboratorAuthor

    Adding data contract create to the transition types this issue should cover; it is not in the list above.

    PutContract (packages/rs-sdk/src/platform/transition/put_contract.rs) has the same two gaps as #3090 for documents:

    1. put_to_platform_and_wait_for_response returns the contract only on success. On an unknown outcome (a proof error after broadcast, or StateTransitionResultUnconfirmed) the caller loses the signed transition, so it cannot tell which contract ID Platform would assign and cannot look it up.
    2. The identity nonce is chosen inside prepare_contract_state_transition and cannot be passed in, so a retry cannot reuse it. Only a same-nonce retry guarantees the user is not charged for a second contract.

    platform-wallet's create_data_contract_with_signer is built on the same call and inherits both gaps.

    Downstream workaround: dashpay/dash-evo-tool#1230 rebuilds and signs the create transition itself (mirroring PutContract) to know the ID and keep the nonce for retries. That PR is now on hold until this issue provides the shared recovery path for contract creation.

    🤖 Generated with Claude Code

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions