Skip to content
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

Import runtime Call / Storage metadata without import the whole runtime #1624

Closed
xlc opened this issue Sep 19, 2023 · 2 comments
Closed

Import runtime Call / Storage metadata without import the whole runtime #1624

xlc opened this issue Sep 19, 2023 · 2 comments

Comments

@xlc
Copy link
Contributor

xlc commented Sep 19, 2023

Previous issue: paritytech/substrate#8158

In order to use XCM::Transact, we need to know how to encode the call on destination chain. The best way should be just import the Call enum from runtime. But we cannot do it because last time we tried, it tries to import the whole Rococo runtime into our parachain runtime, which obviously wouldn't work.

We should have some way to allow others to import some generated types from runtime, without import the whole thing.

Not exactly sure how it can be implemented though, all the generic makes thing harder. One potential solution is reconstruct the enum from metadata and expose them.

@bkontur
Copy link
Contributor

bkontur commented Sep 19, 2023

For something very similar, we used subxt-codegen library which has ability to generate runtime Call metadata at least (I am not sure about Storage), generated file looks like this.
E.g. you can generate metadata from live running node or from downloaded wasm file (maybe there are also other options), we integrated just these two options here.

@bkchr
Copy link
Member

bkchr commented Sep 25, 2023

Actually a very good point @bkontur.

This means the issue can be closed @xlc?

@xlc xlc closed this as completed Sep 25, 2023
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 26, 2024
* Change back sv-locked-for-gav-xcm-v3-and-bridges-3 -> sv-locked-for-gav-xcm-v3-and-bridges

* Change back locked-for-gav-xcm-v3-and-bridges-3 -> locked-for-gav-xcm-v3-and-bridges

* Changed cumulus branch: gav-xcm-v3 -> cumulus-locked-for-gav-xcm-v3-and-bridges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants