Skip to content

Shielded: shielded_shield_from_account() lacks an amount==0 guard at the FFI boundary #3707

@QuantumExplorer

Description

@QuantumExplorer

What

PlatformWallet::shielded_shield_from_account (packages/rs-platform-wallet/src/wallet/platform_wallet.rs) has no early rejection of amount == 0.

Why it needs fixing

With amount == 0 and any balance covering the fee reserve, the input-selection loop exits immediately with an empty chosen map. The post-loop insufficient-balance check is accumulated_claim < amount0 < 0 → false, so it does not fire. The request then flows into the downstream shield build path and fails late and opaquely — after worker spin-up and proof setup.

The SwiftExampleApp UI prevents amount 0, but other FFI consumers don't get that guard.

Fix

Reject amount == 0 at the API boundary before any work. One-line guard; lowest priority of the deferred set.

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