gossamer
gossamer copied to clipboard
read runtime version from code wasm custom sections
For newer runtimes, the runtime version can now be obtained from the WASM custom sections from the wasm code, and there is no longer a need to instantiate the full runtime to check its version.
For context:
- https://github.com/w3f/polkadot-spec/issues/524
- https://github.com/paritytech/substrate/issues/7327
- https://github.com/paritytech/substrate/pull/8688
Note reading the runtime version by instantiating it and calling Core_version
still need to be supported for older runtimes.
So the process should be:
- try to find versions from the wasm custom section
- fallback to instantiating + calling
Core_version
on the instance