paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.85k stars 674 forks source link

Metadata V16: Add code functionality as WASM blob #4714

Open lexnv opened 4 months ago

lexnv commented 4 months ago

The metadata V16 is capable of expressing type information only. One of the shortcomings of V15 is that the metadata cannot express code functionality.

This would be beneficial for users like subxt. For example, subxt could rely on the hashing functionality exposed in the metadata WASM blob to remove the Hashing type (equivalent of system's pallet Hashing). Expressing the hashing functions will reduce our code and allow us to be more generic in targeting different chains.

There's also the need from the community to place various methods in the metadata (extracted from the forum post).

One concern with this approach is that some users in the future will add the signing function of extrinsics to the metadata, or a similar function that exposes the private key (or sensitive data) to the "untrusted" WASM blob.

That said, I would still opt for this functionality in the metadata to offer a better user experience for developers. Currently, this can be done as explained in this comment of the forum post via CustomValueMetadata fields.

Raising this to get your feedback before thinking of the technical approach 🙏

Maybe part of: https://github.com/paritytech/polkadot-sdk/issues/4520

// cc @paritytech/subxt-team @bkchr @skunert

Polkadot-Forum commented 4 months ago

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/upcoming-metadata-v16-features-to-include-in-v16/8153/5

Polkadot-Forum commented 1 month ago

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/metadata-v16-updates/9557/7