Skip to content
Commit a534274c authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

runtime-interface: Implement `register_only` functions (#10640)



* runtime-interface: Implement `register_only` functions

The runtime interface supports versioning of functions. Currently, if you add a new function it will
be used by the runtime automatically. This results in requiring all nodes of a network to upgrade
before the runtime is upgraded, otherwise they will fail to instantiate the new runtime because of
missing host functions. This pr introduces `register_only` functions. This can be used when a new
runtime interface function should be introduced, but the actual usage can be deferred. This means
that nodes will have the host function for this, but the runtime will still use the old version of
the function when being compiled for wasm. However, when a runtime is enacted that uses the new host
function, the "old nodes" will already have the host function and will continue to work.

* Update primitives/runtime-interface/src/lib.rs

Co-authored-by: default avatarcheme <[email protected]>

* Update primitives/runtime-interface/proc-macro/src/utils.rs

Co-authored-by: default avatarcheme <[email protected]>

* FMT

Co-authored-by: default avatarcheme <[email protected]>
parent c33fb8db
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment