-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Enrich metadata with type information #8615
Conversation
Would paritytech/frame-metadata#6 be to big/out of scope to be part of this new version? |
Not sure, it certainly would be of enormous benefit in terms of the size of the metadata. The consideration would be how to generate/distribute the version of the metadata which includes the docs, perhaps could be embedded with the clients which use it e.g. |
Just kill it. This never brought any benefit. |
How sensible is it to introduce new RPC calls, e.g. |
I've created a newtype as Is it related to this issue? Is it soon to be solved? |
Not required since paritytech/substrate#8615
Not required since paritytech/substrate#8615
Enrich metadata with type information paritytech/substrate#8615
Enrich metadata with type information paritytech/substrate#8615
* WIP: Upgrade substrate * Upgrade substrate to ce1746ddf6588c8f9ecfb77411c3cac7a2c09db3 * Update Cargo.lock * Fix cargo check --features=runtime-benchmarks * Upgrade substrate to e1ddbb3ffec3c8f05de6cb05d9f5f7a922788c3f * Add `LightSyncStateExtension` to the chain spec as an extension * Upgrade substrate to eb4de697ccd45948254db422abbcd735ae3c295a * cargo fmt * Upgrade substrate to ba153b9ae050eda022f002d74d76f98d1e339a81 Enrich metadata with type information paritytech/substrate#8615 * Upgrade substrate to 435f56edc14a3a7e895ff5370f6e5179dc547cc4 * Upgrade substrate to 88b4fc861129b63b445492e3088d7f12382f0128 * Upgrade substrate to ce3c31f2bfa7e10817a8a0833faddeaee818910d * Upgrade substrate to 7fcebc86856164a346f6762d339e8cc3b6ec9d30 * Upgrade substrate to bf9683eee40f82cc4e01a05cd375b0e8bba3c8ef * Upgrade substrate to 12b6441ef138303f50fa2fb20895fbf57c8e4735 (polkadot-v0.9.12-without-cache) * Upgrade substrate to e09e70a3d14b3757de0be427c6ac22dfc6fcd498 (purestake/substrate-polkadot-0.9.12) * bump to edition 2021; fix compile errors * Upgrade substrate to 3a5aa8c1a48b015b12e2419fa76b2e2530b3ac75 (purestake/substrate-polkadot-0.9.13) * Fix node compile error * Downgrade substrate to c881b9c86df5d0e4e3607921598768a3ab8ccdc8 (PureStake/frontier#moonbeam-polkadot-v0.9.13) * init pallet-evm from purestake * Use purestake/substrate branch moonbeam-polkadot-v0.9.13 for consistency * Add evm to genesis config * CI: bump rust toolchain version to nightly-2021-12-13 * add pallet-ethereum: init * install pallet ethereum and self contained unchecked extrinsic * impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime * disable node/testing * Add NetApi RPC endpoint * debug1 * fix compile error * add transaction converter * use opaque::Block * Add Eth RPC * add pallet-deposit for transferring fund from substrate to evm * prefund accounts * set eth chainid to 12191 * set ss58prefix to 42 * use forked frontier * bump frontier: add evm decimal converter * patch ss58-registry * Revert "set ss58prefix to 42" This reverts commit c7d6c0d. * bump frontier: add TokenDecimals support in pallet-evm * pallet-evm: set CallOrigin/WithdrawOrigin to EnsureAddressTruncated * drop FrontierBlockImport consensus support to maintain backward compatibility * add pallet-template * upgrade frontier(pallet-evm): add fn token_decimals() -> u8 * add standard precompiles * add PalletTemplatePrecompile * create pallet-template-precompiles under /precompiles * deposit: add benchmarking * add PalletTemplateInterface.sol * pallet-template-precompiles: fix do_something() dispatch * add pallet-evm-precompile-balances-erc20 from moonbeam * pallet-template-precompiles: fix deps repo * init withdraw-balance-precompiles * add withdraw-balance-precompiles to runtime * pallet-evm: impl custom FeeCalculator and GasWeightMapping * withdraw balance debug * withdraw-balance: fix compile errors * add nftmart-nft-precompiles * init nftmart-{auction,order}-precompiles * update nftmart-* precompiles contract interface * add pallet-nop and precompiles for debugging * add frame-system-precompiles * initialize precompile opcode placeholder to allow calling from other contracts * nftmart-nft-precompiles: add arg parsing logic * add account type conversion * nftmart-nft-precompiles: dispatch_call: burn * nftmart-nft-precompiles: dispatch_call: mint * nftmart-nft-precompiles: dispatch_call: destroy_class * nftmart-nft-precompiles: dispatch_call: create_class * nftmart-nft-precompiles: dispatch_call: proxy_mint * sp-arithmetic: turn off default-features to make compiler happy * precompiles: add write methods for all nft pallets * rewrite precompiles with BTreeMap * Add return value to createClass() * impl EvmData for NftItem * add pallet-ethereum-chain-id to make chain_id configurable * fix token decimals * fix withdraw-balance precompile gasometer * init pallet-staking-precompiles * pallet-staking-precompiles: add chill() * init pallet-identity * pallet-staking-precompiles: add more methods * nftmart-nft-precompiles: add read methods * debug: disable non essential precompiles * precompiles/utils: reduce warning * pallet-identity-precompiles: add set_name() * ethereum-chain-id: add setter method * runtime: expose EthereumChainId's methods * bump runtime version to 280 * housekeeping * fix cargo bench --features runtime-benchmarks * bump frontier * fix readme * add cargo doc workflow build step * frontier: use associated const for TOKEN_DECIMAL git grep github.com/purestake/substrate | cut -d : -f 1 | sort -u | xargs sed -i -e s,github.com/purestake/substrate,github.com/nftt-studio/substrate,g Co-authored-by: navigaid <navigaid@gmail.com>
Closes #917 👀,
polkadot companion: paritytech/polkadot#3336
Migration guide: https://gist.github.com/ascjones/0d81a4c44e84cacd9f714cd34a6de823
Overview
frame-metadata
crate with https://github.com/paritytech/frame-metadata/v14
metadata structure defined here, which contains type information usingscale-info
TypeInfo
derive which will generate the static type information to be provided in the metadata.See the latest generated metadata json for the default
node-runtime
here. This was generated by running the substrate node on this branch and then running https://github.com/ascjones/subsee to download and decode -> json serialize.A prototype (Rust only for now) code generator exists here: https://github.com/ascjones/chameleon to verify whether there is enough information in the metadata to generate all types.
todo:
DefaultByteGetter
pattern for storage/constants for the new metadata.0.7
release containing all substrate compatibility featuresparity-common
andframe-metadata
to use this releasescale-info
type registration)vec!
allocations okay which replace existing static array refs?frame-metadata
andscale-info
types, e.g. remove all thev13
s and add some imports to remove fully qualified types, which are there primarily for easy grepping during development.PhantomData
inscale-info
as it can in some cases require an unnecessary trait bound for the generic parameter. Can justskip
those fields, or just revisit the approach, see https://github.com/paritytech/scale-info/blob/f0f689be810fc221a2aa9f015c0b0e1cd35fdd55/src/ty/mod.rs#L425state_getMetadata
, is there a benefit to oregenerating/compressing it? Relates to previous point.frame-metadata
crate with https://github.com/paritytech/frame-metadataframe-metadata
to crates.io and replace git dependecies with thatFollow ups:
OpaqueMetadata::new(Runtime::metadata().into())
in runtime metadata API: Enrich metadata with type information #8615 (comment)