executor: Migrate wasmtime backend to a high-level API (#4686)
* Migrate wasmtime backend to wasmtime-api * Port to a newer version of wasmtime * Update to the latest changes. * Rejig the sandbox module a bit * Materialze * Fixes. * executor wasm_runtime fix * Refactor everything * More refactoring * Even more refactorings * More cleaning. * Update to the latest wasmtime * Reformat * Renames * Refactoring and comments. * Docs * Rename FunctionExecutor to host. * Imrpove docs. * fmt * Remove panic * Assert the number of arguments are equal between wasmtime and hostfunc. * Comment a possible panic if there is no corresponding value variant. * Check signature of the entrypoint. * Use git version of wasmtime * Refine and doc the sandbox code. * Comment RefCells. * Update wasmtime to the latest-ish master. This may solve a problem with segfaults. * Apply suggestions from code review Co-Authored-By:Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Use full SHA1 hash of wasmtime commit. * Add a panic message. * Add some documentation * Update wasmtime version to include SIGSEGV fix * Update to crates.io version of wasmtime * Make it work. * Move the creation of memory into `InstanceWrapper::new` * Make `InstanceWrapper` !Send & !Sync * Avoid using `take_mut` * Update client/executor/wasmtime/Cargo.toml Co-Authored-By:
Bastian Köcher <bkchr@users.noreply.github.com> * Limit maximum size of memory. * Rename `init_state` to `with_initialized_state` Co-authored-by:
Tomasz Drwięga <tomusdrw@users.noreply.github.com> Co-authored-by:
Bastian Köcher <bkchr@users.noreply.github.com>
Showing
- substrate/Cargo.lock 105 additions, 53 deletionssubstrate/Cargo.lock
- substrate/client/executor/common/src/wasm_runtime.rs 0 additions, 6 deletionssubstrate/client/executor/common/src/wasm_runtime.rs
- substrate/client/executor/src/integration_tests/mod.rs 2 additions, 2 deletionssubstrate/client/executor/src/integration_tests/mod.rs
- substrate/client/executor/src/wasm_runtime.rs 4 additions, 1 deletionsubstrate/client/executor/src/wasm_runtime.rs
- substrate/client/executor/wasmi/src/lib.rs 2 additions, 10 deletionssubstrate/client/executor/wasmi/src/lib.rs
- substrate/client/executor/wasmtime/Cargo.toml 1 addition, 8 deletionssubstrate/client/executor/wasmtime/Cargo.toml
- substrate/client/executor/wasmtime/src/host.rs 349 additions, 0 deletionssubstrate/client/executor/wasmtime/src/host.rs
- substrate/client/executor/wasmtime/src/imports.rs 333 additions, 0 deletionssubstrate/client/executor/wasmtime/src/imports.rs
- substrate/client/executor/wasmtime/src/instance_wrapper.rs 258 additions, 0 deletionssubstrate/client/executor/wasmtime/src/instance_wrapper.rs
- substrate/client/executor/wasmtime/src/lib.rs 4 additions, 3 deletionssubstrate/client/executor/wasmtime/src/lib.rs
- substrate/client/executor/wasmtime/src/runtime.rs 85 additions, 450 deletionssubstrate/client/executor/wasmtime/src/runtime.rs
- substrate/client/executor/wasmtime/src/state_holder.rs 77 additions, 0 deletionssubstrate/client/executor/wasmtime/src/state_holder.rs
- substrate/client/executor/wasmtime/src/trampoline.rs 0 additions, 361 deletionssubstrate/client/executor/wasmtime/src/trampoline.rs
- substrate/client/executor/wasmtime/src/util.rs 1 addition, 104 deletionssubstrate/client/executor/wasmtime/src/util.rs
Please register or sign in to comment