paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.com/
1.9k stars 697 forks source link

XCM issue on Kusama #2238

Closed xlc closed 1 month ago

xlc commented 1 year ago

https://kusama.subscan.io/extrinsic/20471678-2?event=20471678-36 failed to deliver the message

Issues identified:

### Tasks
- [x] Partial execution is possible #2237
- [ ] Not enough test to catch the error before mainnet
- [ ] Not enough logs to help devs to understand what's wrong
- [ ] No good way to debug this
- [x] WithUniqueTopic throw away the underlying error #2239
- [ ] It is very hard to tell why XCM version conversion fail
- [ ] It is not possible to convert XCM v3 to v2 because there is no SetTopic on v2
- [ ] Version discovery between Kusama and Karura (and some other parachains) doesn't work. Karura have been upgraded to v3 for a while yet the version set on Kusama is still 2
KiChjang commented 1 year ago

It does have enough logs actually, the actual error itself helps a lot in determining where the problem was, so we really only need to remove the map_error: https://github.com/paritytech/polkadot-sdk/pull/2239/

KiChjang commented 1 year ago

Root cause is that SetTopic does not exist on v2, and since new runtimes now contain the WithUniqueTopic router which appends SetTopic, converting a v3 XCM to v2 fails.

xlc commented 1 year ago

One of the root cause is that version notification mechanism doesn't work between Kusama and Karura. The Kusama Asset Hub have v3 for Karura. Polkadot and Polkadot Asset Hub both have v3 for Acala.

dzmitry-lahoda commented 1 year ago

Hello, please share messages to send if any to handle setting version correctly. We have issue too.

dzmitry-lahoda commented 1 year ago

https://forum.moonbeam.network/t/proposal-mrxx-hotfix-for-kusama-fails-to-convert-xcm-from-v3-v2/1366

xlc commented 1 year ago

https://github.com/xlc/chopsticks-ksm-xcm is the issue reproduced using Chopsticks

albertov19 commented 1 year ago

@dzmitry-lahoda you have to check what is the request ID for your parachain on Kusama:

image

Or just put the Parachain ID in the query at the top.

Next, in your parachain, build a simple XCM message like https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwss.api.moonriver.moonbeam.network#/extrinsics/decode/0x670003010003040379290303000000000000

Note that in this case, the Query ID for Moonriver is 2,654 - Then send this message through ROOT origin, it can be via democracy, opengov, sudo, fast tracking, whatever mechanism the parachain uses. In Moonriver, this was whitelisted and put to vote via a Whitelist track (OpenGov).

dzmitry-lahoda commented 1 year ago

@albertov19 yeah, thanks you. after some tinkering we found query id for our chain. so it was not so self evident.

acatangiu commented 1 month ago

This was an observability and debuggability problem, closing in favor of https://github.com/paritytech/polkadot-sdk/issues/6119