Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fully self-descriptive metadata types #917

Closed
emielsebastiaan opened this issue Oct 17, 2018 · 9 comments · Fixed by #8615
Closed

Fully self-descriptive metadata types #917

emielsebastiaan opened this issue Oct 17, 2018 · 9 comments · Fixed by #8615
Labels
J0-enhancement An additional feature request.
Milestone

Comments

@emielsebastiaan
Copy link

One thing I am missing has to do with the Types one can find in the Metadata.

Some types are (Rust?!) base types such as ‘u32’, ‘bool’ or base structures such as ‘vec’. It is quite clear how to deal with these in an objective manner.

What I am missing has to do with the higher level objects such as T::Balance, ValidatorPrefs, Address, et cetera. The metadata is not self-descriptive enough to ‘know’ the composition of these higher level objects/structures. Hence an outside system (such as a 'generalized substrate explorer' [https://polkascan.io]) would need to ‘hard code’ the composition of such types or structures.

So I suppose what i am suggesting is to extend the metadata with a description of the composition of higher level objects and structures.

PS: discussion with Gavin on Riot hinted that this is non-trivial change and will likely not be picked up before 2020. Hence this issue is for future reference.

@gavofyork gavofyork added this to the The Distant Future milestone Oct 17, 2018
@gavofyork gavofyork added the J0-enhancement An additional feature request. label Oct 17, 2018
@gnunicorn gnunicorn modified the milestones: The Distant Future, Ideas Mar 4, 2020
lamafab pushed a commit to lamafab/substrate that referenced this issue Jun 16, 2020
…tytech#917)

* Add cli to wasm tests, update and bring closer to the substrate browser code

* Remove ws.js

* Update cli/src/browser.rs

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

* Update browser.rs

Co-authored-by: Gavin Wood <gavin@parity.io>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
@gui1117
Copy link
Contributor

gui1117 commented Jan 26, 2021

Some update on it, this will be solved by using scale-info https://github.com/paritytech/scale-info so that full type description will be available in the metadata.

Some more advancment detail #7971 (comment)

@emielsebastiaan
Copy link
Author

Almost 2.5 years in the making :)

This feature will (hopefully) lower the maintenance burden on the API-layer teams significantly.
The Polkascan team really looks forward to this feature.

@shawntabrizi
Copy link
Member

@ascjones How close are we on this?

We have some ideas which may be temporary fix in the meantime if this will take 6-8 more months.

@ascjones
Copy link
Contributor

ascjones commented Mar 25, 2021

Not that long for sure, on the home stretch now - maybe 1-2 months depending on how much time I can dedicate to it, and also what we decide to do about where the metadata itself will be stored (discussed in #8370)

What's your specific use case and what did you have in mind? One approach would be for me to manually generate the metadata for your runtime in the new format, which is possible before all my work gets merged into master.

@xlc
Copy link
Contributor

xlc commented Mar 25, 2021

Some patched version Encode/Decode derive that generates the type metadata and print them on with some special build flag will already be useful. At this will allow us easily to maintain the type definition that currently are manually created.

@shawntabrizi
Copy link
Member

shawntabrizi commented Mar 25, 2021

yes, that was my hack solution too. Create some kind of temporary RPC which will have the types needed for that node to work.

There isnt a specific use case that i am hunting for (other than making the lives of everyone better). We were walking through the backlog, and this was an issue that has been open for like 3 years. So just trying to figure out if we should come up with a temporary solution.

@apopiak
Copy link
Contributor

apopiak commented Apr 1, 2021

Let's get that hacky thing going

@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 7, 2021
@gui1117
Copy link
Contributor

gui1117 commented Jul 8, 2021

WIP #8615

@stale stale bot removed the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 8, 2021
liuchengxu added a commit to chainx-org/substrate that referenced this issue Aug 23, 2021
* Move misc csv files to genesis_config/res

* Split out bitcoin and sdot genesis info

* Move genesis wasm files to genesis_config/res/wasm

* Split out genesis_config/chainx.rs

* Acc bootstrap_intentions_config() and bootstrap_trustee_intentions_config()

* Move hex() to genesis_config/chainx.rs

* Team and council accounts number is 8 not 7

Avoid the alllocation
@ghost ghost closed this as completed in #8615 Sep 15, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
8 participants