Skip to content

Shielded: Type 15/18 (shield, shield-from-asset-lock) report success on relay-ACK, not proven execution #3704

@QuantumExplorer

Description

@QuantumExplorer

What

In packages/rs-platform-wallet/src/wallet/shielded/operations.rs, the five shielded transition builders split into two broadcast styles:

  • transfer, unshield, withdraw use state_transition.broadcast_and_wait::<StateTransitionProofResult>(sdk, None) — waits until Platform has processed the transition and returns a cryptographic proof of the result.
  • shield (Type 15) and shield_from_asset_lock (Type 18) use state_transition.broadcast(sdk, None) and return Ok(()) as soon as a single DAPI gateway accepts the bytes for relay.

Why it needs fixing

"One peer accepted my submission" ≠ "Platform included and executed it." A faulty or hostile DAPI node can ACK submission, then the transition is rejected at consensus or silently dropped — and the host has already told the user the shield succeeded.

  • The rich addresses_not_enough_funds diagnostic in the shield path is mostly unreachable, because the error surfaces only after we've already returned Ok.
  • Type 18 is worse: the asset-lock proof is single-use. A false-positive success can strand the user's funds.

Success should mean "Platform proved execution", matching the other three transition types.

Fix

Switch shield and shield_from_asset_lock to broadcast_and_wait::<StateTransitionProofResult>. This is a behavior change (longer call, error timing moves to confirmation), so it warrants its own commit + testing.

Deferred from #3603 review (thepastaclaw).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions