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
- Cargo.lock 8 additions, 1 deletionCargo.lock
- Cargo.toml 2 additions, 1 deletionCargo.toml
- core/executor/Cargo.toml 1 addition, 1 deletioncore/executor/Cargo.toml
- core/executor/src/allocator.rs 31 additions, 31 deletionscore/executor/src/allocator.rs
- core/executor/src/error.rs 6 additions, 3 deletionscore/executor/src/error.rs
- core/executor/src/lib.rs 2 additions, 0 deletionscore/executor/src/lib.rs
- core/executor/src/sandbox.rs 12 additions, 8 deletionscore/executor/src/sandbox.rs
- core/executor/src/wasm_executor.rs 1214 additions, 1196 deletionscore/executor/src/wasm_executor.rs
- core/executor/src/wasm_runtimes_cache.rs 12 additions, 6 deletionscore/executor/src/wasm_runtimes_cache.rs
- core/executor/src/wasm_utils.rs 83 additions, 181 deletionscore/executor/src/wasm_utils.rs
- core/sr-io/src/lib.rs 1 addition, 1 deletioncore/sr-io/src/lib.rs
- core/sr-io/with_std.rs 2 additions, 2 deletionscore/sr-io/with_std.rs
- core/sr-io/without_std.rs 3 additions, 4 deletionscore/sr-io/without_std.rs
- core/sr-std/without_std.rs 2 additions, 2 deletionscore/sr-std/without_std.rs
- core/test-runtime/src/lib.rs 2 additions, 2 deletionscore/test-runtime/src/lib.rs
- core/wasm-interface/Cargo.toml 8 additions, 0 deletionscore/wasm-interface/Cargo.toml
- core/wasm-interface/src/lib.rs 324 additions, 0 deletionscore/wasm-interface/src/lib.rs
- core/wasm-interface/src/wasmi_impl.rs 79 additions, 0 deletionscore/wasm-interface/src/wasmi_impl.rs
- node-template/src/service.rs 1 addition, 1 deletionnode-template/src/service.rs
- srml/system/src/offchain.rs 2 additions, 2 deletionssrml/system/src/offchain.rs
Please register or sign in to comment