w3f/polkadot-spec

Runtime custom sections missing mention of `runtime_apis`

tomaka opened this issue · 0 comments

Section 2.6.3.4 mentions:

For newer Runtimes, the Runtime version (Section C.4.1.) can be read directly from the Wasm custom section with the name runtime_version. The content is a SCALE encoded structure as described in Section C.4.1..

However there are actually two sections, one runtime_version for the version with an empty list of APIs, and one section runtime_apis with just the list of APIs (the content of the apis field of the struct in section C.4.1.). This was done so for implementation difficulty reasons.

Additionally, due to accidents, some runtimes have one custom section but not the other. When that is the case, the custom section must be ignored, and the host should fall back to calling Core_version.