polkadot-fellows / runtimes

The various runtimes which make up the core subsystems of networks for which the Fellowship is represented.
GNU General Public License v3.0
124 stars 71 forks source link

Sending bridged DOT from AH to parachain fails after upgrade #281

Open olanod opened 2 months ago

olanod commented 2 months ago

Before the last upgrade at block 6793666 there's an example of a limited reserve transfer assets of DOT from Kusama asset hub to parachain 2281 which was successful, after the upgrade we can see another example at block 6814790 which fails with the error InvalidAssetUnknownReserve. It seems like a regression unless sending such foreign asset to a Kusama parachain is expected to be done differently now.

joepetrowski commented 2 months ago

@acatangiu @franciscoaguirre

acatangiu commented 2 months ago

Yes, it is an unintended regression.

The fact that we could do it before the upgrade with the old extrinsic was just "lucky". Once on the parachain, the extrinsic could not send it anywhere else (not even back).

The currently deployed runtime includes https://github.com/paritytech/polkadot-sdk/pull/1672 and https://github.com/paritytech/polkadot-sdk/pull/2388 which allow transfers of foreign assets in all directions within same consensus.

Unfortunately, for bridged assets the "smart logic" added to the extrinsics in above PRs doesn't work anymore because the code cannot determine anymore which chain on this side of the bridge is allowed to act as a reserve for an asset on the other side of the bridge.

For moving bridged assets around I created a new extrinsic https://github.com/paritytech/polkadot-sdk/pull/3695 that allows the caller to force/override/specify reserve locations for "exotic" assets (where such information is not available in the runtime). I am also pushing for an offchain asset registry to hold this information: https://forum.polkadot.network/t/xcm-asset-registry/1168/3. Unfortunately, https://github.com/paritytech/polkadot-sdk/pull/3695 did not make it into AH 1.2.0 runtimes, but I plan to add it very soon in a AH runtime "patch upgrade".

olanod commented 1 month ago

@acatangiu will this be possible already in 1.2.2 ? how would the transfer extrinsic look like?

acatangiu commented 1 month ago

will this be possible already in 1.2.2 ?

Not possible yet in 1.2.2, I see on https://github.com/polkadot-fellows/runtimes/releases/ that 1.2.1, 1.2.2 and 1.2.3 were patch releases for other chains for other issues. Asset Hub runtimes latest release is still 1.2.0.

I'll try to get it in https://github.com/polkadot-fellows/runtimes/issues/288, but I can't promise I'll make it (many things on my plate). You can try to do it yourself too (backport this new method from latest pallet-xcm to whatever pallet-xcm version was used in 1.2.0 - this can help you easily find which versions used where https://github.com/paritytech/psvm).

how would the transfer extrinsic look like?

Example test for bridged asset AssetHub->Parachain - the actual call used here. Example test for bridged asset Parachain->AssetHub - the actual call used here.

In general, the emulated tests should cover all transfers scenarios and showcase how to do anything. Please let me know if you have a scenario not covered there.

P.S.: there's many other goodies on the way too: https://forum.polkadot.network/t/xcm-user-and-developer-experience-improvements/4511/21

acatangiu commented 1 month ago

Backported for upcoming release: https://github.com/polkadot-fellows/runtimes/pull/311

acatangiu commented 3 weeks ago

@olanod following the v1.2.4 upgrade, you can now do this with the following xt:

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-asset-hub-kusama.luckyfriday.io#/extrinsics/decode/0x1f0d03010100a523030400020109020002286bee010300020109020103040d0102040001010068170716ab7c6735dd0a1012045d9ea33891b5f6596cf97eb217d0962d86a51800

Please confirm it works for you too.