First step for generating host externals out of the function definition in `sr-io` (#3567)
* Adds new wrapper traits for wasm executor
* Add new crate `substrate-wasm-interface`
Thew new crate holds types and traits for the communicating between the
wasm runtime and the host.
* Rewrite externals with new macro etc
* Fix vec initialization
* Make executor tests working
* Remove unused code + warnings
* Introduce `Pointer` and `WordSize` for working with wasm
* Fix tests and compilation
* Fix compilation
* Apply suggestions from code review
Co-Authored-By:
Sergei Pepyakin <sergei@parity.io>
* Review feedback
* Remove unused conversions
* Make each host function its own struct
`HostFunctions` now just returns these function structs. Each function
can be executed by using one of the function structs. The inherent host
functions are now moved to the "normal" host functions.
* Remove byteorder
* Add floating point types
* Make pointer interface more safe
* Add type alias for wasm-interface Result
* More review comments
Showing
- substrate/Cargo.lock 8 additions, 1 deletionsubstrate/Cargo.lock
- substrate/Cargo.toml 2 additions, 1 deletionsubstrate/Cargo.toml
- substrate/core/executor/Cargo.toml 1 addition, 1 deletionsubstrate/core/executor/Cargo.toml
- substrate/core/executor/src/allocator.rs 31 additions, 31 deletionssubstrate/core/executor/src/allocator.rs
- substrate/core/executor/src/error.rs 6 additions, 3 deletionssubstrate/core/executor/src/error.rs
- substrate/core/executor/src/lib.rs 2 additions, 0 deletionssubstrate/core/executor/src/lib.rs
- substrate/core/executor/src/sandbox.rs 12 additions, 8 deletionssubstrate/core/executor/src/sandbox.rs
- substrate/core/executor/src/wasm_executor.rs 1214 additions, 1196 deletionssubstrate/core/executor/src/wasm_executor.rs
- substrate/core/executor/src/wasm_runtimes_cache.rs 12 additions, 6 deletionssubstrate/core/executor/src/wasm_runtimes_cache.rs
- substrate/core/executor/src/wasm_utils.rs 83 additions, 181 deletionssubstrate/core/executor/src/wasm_utils.rs
- substrate/core/sr-io/src/lib.rs 1 addition, 1 deletionsubstrate/core/sr-io/src/lib.rs
- substrate/core/sr-io/with_std.rs 2 additions, 2 deletionssubstrate/core/sr-io/with_std.rs
- substrate/core/sr-io/without_std.rs 3 additions, 4 deletionssubstrate/core/sr-io/without_std.rs
- substrate/core/sr-std/without_std.rs 2 additions, 2 deletionssubstrate/core/sr-std/without_std.rs
- substrate/core/test-runtime/src/lib.rs 2 additions, 2 deletionssubstrate/core/test-runtime/src/lib.rs
- substrate/core/wasm-interface/Cargo.toml 8 additions, 0 deletionssubstrate/core/wasm-interface/Cargo.toml
- substrate/core/wasm-interface/src/lib.rs 324 additions, 0 deletionssubstrate/core/wasm-interface/src/lib.rs
- substrate/core/wasm-interface/src/wasmi_impl.rs 79 additions, 0 deletionssubstrate/core/wasm-interface/src/wasmi_impl.rs
- substrate/node-template/src/service.rs 1 addition, 1 deletionsubstrate/node-template/src/service.rs
- substrate/srml/system/src/offchain.rs 2 additions, 2 deletionssubstrate/srml/system/src/offchain.rs
Please register or sign in to comment