Skip to content
Commit 8b9f2fed authored by Bastian Köcher's avatar Bastian Köcher
Browse files

Allow missing functions when checking the new runtime's version

When upgrading a runtime, we check that the version of the new runtime
is incrementing the `spec_version` or the `spec_name` changes. To do
this, we need to initialize the runtime and call `Core_version`. When
initializing the runtime we check all imports and if we can fulfill
them. Up to now, we would fail when the node did not provide all the
required host functions. In Westend this lead to older nodes rejecting
the runtime upgrade, as the runtime version could not be extracted, but
newer nodes with these host functions succeeded and generated a
different state root. This pr allows missing host functions. A missing
host function is replaced by a stub that returns an error when being
called. As `Core_version` doesn't call any host function besides
`malloc` and `free`, this should make sure that all nodes (with and
without the required) host functions generate the same block. This does
not prevent that old nodes will fail to author blocks with the new
runtime.
parent e60eb97f
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