2

I want to execute Transact on AssetHub from another parachain and therefore need to WithdrawAsset and BuyExecution beforehand.

Unfortunately, I keep running into FailedToTransactAsset on AH. I am unsure whether I am referring correctly to the DOT Asset as Concrete { parents: 1, interior: here }. I have funded the origin sovereign parachain account with enough DOT.

The pseudo code of the XCM is

let dot = MultiAsset {
    id: AssetId::Concrete(MultiLocation::parent()),
    fun: Fungibility::Fungible(10_000_000_000), // 1 DOT
};

let xcm_to_send = Xcm(vec![
    WithdrawAsset(dot.clone().into()),
    BuyExecution { fees: dot.into(), weight_limit: WeightLimit::Unlimited },
    Transact {
        origin_kind: OriginKind::Native,
        require_weight_at_most: Weight::from_parts(REF_TIME, PROOF_SIZE),
        call: call.encode().into(),
    },
]);

Here's the encoded call data:

0x790003010100a10f031400040001000002093d0013000002043205e5140002093d000006010300286bee823801001c000710deadbeef140d0100010100411f

I am testing this with Chopsticks. Unfortunately, I haven't found a way how to inspect the nested error of FailedToTransactAsset yet.

5
  • Is this 0x790003010100a10f031400040001000002093d0013000002043205e5140002093d000006010300286bee823801001c000710deadbeef140d0100010100411f the encoded call in Transact? for what chain? I can not decode it
    – NachoPal
    Feb 21 at 12:57
  • Sorry about that. This hex is the entire polkadot_xcm::send call crafted on a custom chain which is not public and would exceed the scope of your help. I know that send is usually restricted to root, on my custom chain it is not though. The v1.1.2 Polkadot Runtimes release enables remote accounts to be recognised.
    – 0x5hmoo
    Feb 21 at 15:17
  • Can you share the encoded call inside the Transact?
    – NachoPal
    Feb 21 at 15:44
  • The Transact is a simple remarkWithEvent call for testing purposes: 0x000710deadbeef
    – 0x5hmoo
    Feb 22 at 7:52
  • The same error (FailedToTransact("AccountIdConversionFailed")) occurs when I try to transfer DOT from Polkadot to a remote account on AssetHub { parents: 0, interior: X1(AccountId32: { network: Some(...), id: ALICE })}. Here's the call hex for Polkadot: 0x630903000100a10f0300010101002e36c499d14939b1c69dce0594a78b1534404e7e2e767fa69be3f7eb35a3b2e3d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0304000000000b008cb6611e010000000000
    – 0x5hmoo
    Feb 22 at 8:35

2 Answers 2

1

I would need to see de decoded call to give an accurate answer, but I can tell that the origin_kind in the Transact is wrong, try with OriginKind::SovereignAccount.

By the way, remarkWithEvent will not pass the AssetHub's SafeCallFilter.

1
  • Both of your statements are correct. I changed the extrinsic to a transfer and used SovereignAccount which lead the call to succeed! Thanks so much!
    – 0x5hmoo
    Feb 23 at 14:39
-1

I don't exactly know, how the chopsticks runs AssetHub and polkadot-parachain, but is it possible to add there RUST_LOG=xcm=trace somehow?

2
  • 1
    Try to add runtime-log-level: 5 in your Chopsticks's config file
    – NachoPal
    Feb 21 at 12:59
  • Thanks, that certainly adds more logs! Beforehand, I just used LOG_LEVEL=debug which was not helpful. Unfortunately, the XCM error is not expanded. AFAICS, I need to build an AssetHub WASM with log lines added by myself. Trying this now.
    – 0x5hmoo
    Feb 21 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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