-
Notifications
You must be signed in to change notification settings - Fork 0
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
Configure XCM messaging between Relay Chain and Parachain #31
Conversation
note to self: make a test to teleport from the parachain to the relay chain |
@serg-temchenko do you think we should implement integration tests like this, at this stage? |
So...
However, I'd say that's acceptable as I was able to replicate the same thing with launching local rococo asset hub and local rococo relay chain. For some reason, teleporting it back to the relay chain doesn't work (locally). It took me a while to figure out correct parameters for the transaction back and I was going around in circles. Most important thing about those parameters is that you need to set |
This PR is also related to Issue #14 and highlights an overlooked aspect related to transferring assets from other parachains. To avoid confusion and clarify the concepts, we need to distinguish between two types of asset transfers in our system: one involves teleporting assets using XCM, and the other involves transferring assets internally within our parachain between different accounts using the balances pallet. Also, I've created a separate issue #36 for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please point to some docs or describe what has been changed and why in this PR so we could easily understand what is happening here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing particularly sticks out to me, but I do have some questions.
Basically, you dispatch an extrinsic: xcmPallet.teleportAssets with a proper configuration (it took some time to figure this one out). Proper configuration in the end, could be based off the implementation of teleport functionality in the polkadot.js.org/apps.
- Should we open a new issue for further investigation?
- Is there any way of automating these tests?
- Shouldn't we document the procedure somewhere?
This teleport functionality for Polkadot<->AssetHub, Kusama<->AssetHub is there, but for some reason it doesn't show for our chain, didn't debug why though.
Could this be related to the IDs?
Created one: #39.
Probably there is, but it needs to be designed and consider. It boils down to e2e testing on local testnet.
It's kinda documented here, in the PR description, but I'll add it to the
Got no idea, #39. |
It should be merged after #37 is merged, for the build to succeed. |
Related to #16.
It's a part of an end-user scenario, when someone wants to use our system chain, first needs to have an account and funds to seal some kind of storage deal.
This PR answers the question: how do we transfer Native DOTs to the parachain and how to implement it?
Transfering native assets between chains happens via XCM messages which are executed by a XCM virtual machine on nodes.
Here is a great description how does it work under the hood.
Bottom line is, there are 2 kinds of asset transfer. One is Teleport, the other one is Reserve. Our chain is a system parachain, so we are using Teleportation, because it's designed for a trusted chains.
Under the hood it burns the tokens on one chain and mints them on the other one, that's why they need to be trusted.
In this regard, our chain works similarly to the Asset Hub(which also uses native tokens).
The configuration I did is based off two main configurations:
Basically, we needed to setup trust:
xcm_config
, so we don't Mint assets from god knows who,And a whole lot of testing...
The tests were performed using https://polkadot.js.org/apps/, Developer -> Extrinsics tab, and the website was connected to our local testnet.
Basically, you dispatch an extrinsic:
xcmPallet.teleportAssets
with a proper configuration (it took some time to figure this one out). Proper configuration in the end, could be based off the implementation ofteleport
functionality in thepolkadot.js.org/apps
. This teleport functionality for Polkadot<->AssetHub, Kusama<->AssetHub is there, but for some reason it doesn't show for our chain, didn't debug why though.In the end, the proper XCM messages are:
Where accounts ID where converted using the
subkey
command, by just copying AccountIDs there:➜ polkadot-sdk git:(polkadot-v1.11.0) ✗ ./target/release/subkey inspect 5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL Public Key URI `5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL` is account: Network ID/Version: substrate Public key (hex): 0x1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c Account ID: 0x1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c Public key (SS58): 5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL SS58 Address: 5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL
Note that the accounts on the relay chain and parachain have the same account id, as they use the same SS58 prefix.
Tested the scenario, screenshots, i.e. Eve received funds when it was teleported from the relay chain.