Skip to content

[xcm] Failing to deposit dust (below minimum value) will fail the whole XCM program #4408

Closed
@acatangiu

Description

@acatangiu

Description

The implementation of DepositAsset will directly abort if any asset can't be deposited. This can happen if the amount of the asset is below its minimum balance and the receiver doesn't have a balance of it yet, in that case the asset transactor will directly fail with TokenError::BelowMinimum via the following call flow:

This is especially a problem for more complex XCMs that transfer multiple assets, which can completely fail when the leftover fee-asset amount (after paying the fees) is just dust and might not meet "min value" for depositing.

Proposed solution

Treat TokenError::BelowMinimum error as non-fatal in xcm-executor, effectively ignore errors of failures to deposit dust.

Any dust that cannot be deposited, shall be dropped (effectively burned).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.T6-XCMThis PR/Issue is related to XCM.

    Type

    No type

    Projects

    Status

    Done

    Status

    Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions