Here's a topic I've had in mind for quite some time that could evolve into an RFC:
Substrate uses WebAssembly MVP version for its high performance, language agnosticism, security, and to support easy upgradability and interoperability of blockchains. It has proven to be a very successful format that keeps evolving(slowly) and we could leverage some of its newer features.
This initial verison of WASM due to its limited functionality requires Substrate to define custom low level interfaces between the host client and the runtime, the WebAssebly System Interface(WASI) preview served as an experiment on how WASM can run in different contexts outside of the web browser interfacing with a host environment using a well defined interface, an outcome of said experiment is the component model, it allows separately-compiled components to work as interoperable WASM libraries that enable cross-language composition. Interfaces are now defined with WIT, a language to define contracts between components using higher level type definitions.
Retrofitting this concept into FRAME and the Substrate client would be challenging, instead we can explore using the component model as a new alternative way to write runtime code. Some of the possibilities to explore that the CM could open up:
Upgradability: Splitting up a runtime into a tree of components can simplify the way runtimes are upgraded, instead of changing the entire :code, one can update only the small part of the runtime that changed(e.g. config, a "pallet").
Security: Instead of having every piece of the runtime sharing the same privileged space, we can define layers of privilege similar to how unix systems define protection rings that have more or less access to certain resources/capabilities.
Developer experience: Cross-language composition allows critical parts of the runtime be defined in Rust while higher level "user land" code can be written in more developer friendly languages with simple opinionated APIs that allow for easier on-boarding and faster development cycle.
Here's a topic I've had in mind for quite some time that could evolve into an RFC:
Substrate uses WebAssembly MVP version for its high performance, language agnosticism, security, and to support easy upgradability and interoperability of blockchains. It has proven to be a very successful format that keeps evolving(slowly) and we could leverage some of its newer features.
This initial verison of WASM due to its limited functionality requires Substrate to define custom low level interfaces between the host client and the runtime, the WebAssebly System Interface(WASI) preview served as an experiment on how WASM can run in different contexts outside of the web browser interfacing with a host environment using a well defined interface, an outcome of said experiment is the component model, it allows separately-compiled components to work as interoperable WASM libraries that enable cross-language composition. Interfaces are now defined with WIT, a language to define contracts between components using higher level type definitions.
Retrofitting this concept into FRAME and the Substrate client would be challenging, instead we can explore using the component model as a new alternative way to write runtime code. Some of the possibilities to explore that the CM could open up:
:code
, one can update only the small part of the runtime that changed(e.g. config, a "pallet").