w3f / polkadot-spec

The Polkadot Protocol Specification
https://spec.polkadot.network
Creative Commons Attribution Share Alike 4.0 International
180 stars 70 forks source link

Test and spec the use of exported WASM memory for Kusama compatibility. #224

Open FlorianFranzen opened 4 years ago

FlorianFranzen commented 4 years ago

Newer versions of the Kusama and all Polkadot CC1 runtimes are build with the --import-memory flag, which enables the support of the Wasm Memory extension. This extension is then used by the substrates Wasm executor to pass data to the runtime in a more optimized way.

Not all Kusama runtimes where built with this feature, so the executor has to support the previous method as well to sync Kusama.

All of this need to be speced.

FlorianFranzen commented 4 years ago

This will probably also mean that we will have to provide an additional wasm-adapter or even an additional substrate-adapter.

E.g. just adding (e3239f5) this flag on the current wasm-adapter crashes the current substrate-adapter on loading the wasm: thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: "Trap: Trap { kind: Unreachable }"', src/pdre_api/utils.rs:88:9

FlorianFranzen commented 3 years ago

Partly fixed in #402. Needs some more work in the testsuite and should be mentions once we add Kusama specific info.