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
Please register or sign in to comment