gossamer icon indicating copy to clipboard operation
gossamer copied to clipboard

read runtime version from code wasm custom sections

Open qdm12 opened this issue 2 years ago • 0 comments

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:

  1. try to find versions from the wasm custom section
  2. fallback to instantiating + calling Core_version on the instance

qdm12 avatar Aug 17 '22 15:08 qdm12