Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolkadotXCM Reserve Transfer Asset with Multiple Asset and FeeItem is Zero (0) #3661

Open
2 tasks done
albertov19 opened this issue Mar 12, 2024 · 3 comments
Open
2 tasks done
Assignees
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known. T6-XCM This PR/Issue is related to XCM.

Comments

@albertov19
Copy link

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

We are testing doing a transfer from Polkadot AssetHub to Moonbeam (using Chopsticks), and we noticed the weirdest issue.

When transferring two assets (in this case, it was PINK and USDT, the latter to be used as the feeAssetItem), whenever USDT is set as an asset 0 and the feeAssetItem = 0, the call would fail with wasm: unreachable instructions....

Nevertheless, if you switch the asset order (leaving everything else the same, amounts, etc) and set feeAssetItem = 1, it works 🤯 .

Steps to reproduce

To replicate, you can run Asset-Hub, Moonbeam and Polkadot with Chopsticks using the following AssetHub configuration file:

endpoint: wss://statemint-rpc.dwellir.com
mock-signature-host: true
block: ${env.STATEMINT_BLOCK_NUMBER}
db: ./db.sqlite

import-storage:
  System:
    Account:
      -
        -
          - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
        - providers: 1
          data:
            free: 1000000000000000
  Assets:
    Account:
      - [[1984, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
      - [[1337, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
      - [[21, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: 1000000000 }]
      - [[23, 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY], { balance: "1000000000000000000" }]

The following call fails (Assets(0) = USDT, feeAssetItem = 0):

0x1f0801010100511f010001030098891e5fd24ef33a488a47101f65d212ff6e650e0108000002043205011f0002093d000000020432055c0002093d000000000000

The following call succeeds (Assets(1) = USDT, feeAssetItem = 1)

0x1f0801010100511f010001030098891e5fd24ef33a488a47101f65d212ff6e650e01080000020432055c0002093d00000002043205011f0002093d000100000000
@albertov19 albertov19 added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Mar 12, 2024
@acatangiu
Copy link
Contributor

acatangiu commented Mar 12, 2024

Might be same underlying issue described in #2123?

Assets are sorted when going from vec<Asset> to Assets, so the order in which you add them in PJS might not be same final order and feeAssetItem = 0 might actually be pointing to the other asset.

The "asset idx" API is bad and we should just change it to explicitly specify the asset instead of an index in the list.

Still, that doesn't explain how it'd fail with wasm: unreachable instructions...

@acatangiu acatangiu added the T6-XCM This PR/Issue is related to XCM. label Mar 12, 2024
@albertov19
Copy link
Author

Yeah, I think the problem feels relatable to that described in #2123. Although I was reporting it from a more user-centric perspective, I could not find it when looking for it.

When will #2129 hit AssetHub?

Thanks for the quick answer

@acatangiu
Copy link
Contributor

We should still investigate and see what is with the wasm error, afaict if the only problem is using wrong asset for paying fees, then transfer should fail with not enough fees not unreachable instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known. T6-XCM This PR/Issue is related to XCM.
Projects
Status: Next to pick up
Development

No branches or pull requests

3 participants