1

I am setting up the integration tests to transfer Asset from Parachain A to Parachain B (clone Parachain A).

The XCM execution went successfully on Parachain A, the balance was deducted successfully, but Parachain B got a problem receiving tokens. It throws errors on Parachain B at BuyExecution with error xcm::v2::traits::Error::TooExpensive. There is Trader has been set up for fee calculation, also 8_000_000_000_000 in weight but seems I missed something to make it works.

If anyone has experienced the same issues, would really appreciate if you can shed some lights so I can isolate and fix the issue.

enter image description here

7
  • 1
    Can you show us the list of XCM instructions that you've constructed? Apr 28 at 8:00
  • Hi @KeithYeung, I did it through orml xtokens transfer, basically, the below XCM instructions have been executed. // On parachain A: WithdrawAsset (Succeeded) => DepositReserveAsset (Succeeded) // On parachain B: ReserveAssetDeposited (Succeed) => ClearOrigin (Succeed) => BuyExecution (Failed) => DepositAsset -> Not reach
    – jpcoder
    Apr 28 at 8:05
  • 1
    The payment provided (whatever that is) cannot be used to pay for the weight which BuyExecution is attempting to purchase. Without seeing the actual XCM instruction, the contents of the Holding register and the specifics of the Trader type, it's impossible to describe what you should change to make it work.
    – Gav
    Apr 28 at 8:48
  • 1
    The two issues most likely are: a) the asset which Trader is expecting is not the asset which BuyExecution is attempting to pay with (perhaps the MultiLocation is incorrect?); or b) Trader has been configured with an asset-per-weight price which results in more of the asset needed for the weight you're trying to buy than the payment you are attempting to pay for it with.
    – Gav
    Apr 28 at 9:02
  • 1
    Are you using IdentityFee rather than WeightToFee? Relevant issue: github.com/paritytech/cumulus/issues/920
    – Squirrel
    Apr 28 at 10:18

1 Answer 1

1

Thanks for all the comments. Based on the suggestions, I have identified the issue and posted here which may help other Substrate builders in the future.

As mentioned by @Gav, there is a problem with the asset that pay for weight, doing more debugging with this line when Trader calculates fee. I found the asset MultiLocation is mismatched.

1
  • 1
    Please mark the question as answered if you're happy it's solved now.
    – Gav
    May 1 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.