* executor: Use non wasmi-specific execution in tests.
* executor: Move all runtime execution tests into tests file.
* executor: Use test_case macro to easily execute tests with different
Wasm execution methods.
* executor: Convert errors to strings with Display, not Debug.
* node-executor: Rewrite benchmarks with criterion.
They were not passing compilation before and criterion seems to be more
widely used in Substrate.
* executor: Begin implementation of Wasm runtime.
The implementation demonstrates the outline of the execution, but does
not link against the external host functions.
* executor: Define and implement basic FunctionExecutor.
The SandboxCapabilities::invoke is still left unimplemented.
* executor: Implement host function trampoline generation.
* executor: Instantiate and link runtime module to env module.
* executor: Provide input data during wasmtime execution.
* executor: Implement SandboxCapabilites::invoke for wasmtime executor.
* executor: Integrate and test wasmtime execution method.
* executor: Improve FunctionExecution error messages.
* Scope the unsafe blocks to be smaller.
* Rename TrampolineState to EnvState.
* Let EnvState own its own compiler instead of unsafe lifetime cast.
* Refactor out some common wasmi/wasmtime logic.
* Typos and cosmetic changes.
* More trampoline comments.
* Cargo.lock update.
* cli: CLI option for running Substrate with compiled Wasm execution.
* executor: Switch dependency from fork to official wasmtime repo.
* Quiet down cranelift logs.
* Explicitly catch panics during host calls.
We do this to ensure that panics do not cross language boundaries.
* Additional checks and clarifications in make_trampoline.
* Fixes after merge from master and panic safety for wasmtime
instantiation.
* fix child_storage_hash
* extract common implementation for ext and testing
* cleaning impl.
* replace ExtBasisMut by actual Ext
* remove extbasis.
* Update tests to use Ext from test externalities.
* use Ext constructor for getting ext from TestExternalities.
* Add missing extensions from ext.
* fix wasmi test
* Fix merge error.
The macro generates the functions with the signature we expect for wasm
functions. This macro is useful for tests where we need to call into
wasm. Parameter passing is done by SCALE encoding the input and output
parameters.
* Move `Externalities` into `substrate-externalities`
- `Externalities` now support generic extensions
- Split of `primtives-storage` for storage primitive types
* Move the externalities scoping into `substrate-externalities`
* Fix compilation
* Review feedback
* Adds macro for declaring extensions
* Fix benchmarks
* Introduce `ExtensionStore` trait
* Last review comments
* Implement it for `ExtensionStore`
* executor: Move definitions of externals out of wasm_executor module.
* executor: Create WasmRuntime trait.
This will be used to decouple the runtime cache from wasmi execution.
* executor: Remove WasmExecutor and move methods to wasmi_execution.
These will now be crate-internal functions and there is no need
for the struct.
* executor: Set default default_heap_pages in NativeExecutor.
* cli: CLI configuration for Wasm execution method.
* executor: Remove wasmi-specific code from wasm_runtime.
* Respond to review comments.
* 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
* Introduce `wasm-builder` and `wasm-builder-runner` to retire `build.sh`
Make use of `wasm-builder` in `test-runtime`.
* Add build script and remove the wasm project
* Port `node-runtime` to new wasm-builder
* Make `substrate-executor` tests work with `wasm-builder`
* Move `node-template` to `wasm-builder`
* Remove `build.sh` :)
* Remove the last include_bytes
* Adds the missing build.rs files
* Remove `build.sh` from CI
* Debug CI
* Make it work in CI
* CI attempt 3
* Make `substrate-runtime-test` compile on stable
* Ahhh, some missed `include_bytes!`
* AHH
* Add suggestions
* Improve search for `Cargo.lock` and don't panic if it is not found
* Searching from manifest path was no good idea
* Make the `wasm-builder` source better configurable
* Expose the bloaty wasm binary as well
* Make sure to rerun WASM recompilation on changes in dependencies
* Introduce new `WASM_BUILD_TYPE` env and make sure to call `build.rs` on
changes to env variables
* Remove `build.sh` from READMEs
* Rename the projects
* Fixes CI
* Update lock file
* Fixes merge-conflict
* Apply suggestions from code review
Co-Authored-By: TriplEight <denis.pisarev@parity.io>
* Try to make windows happy
* Replace all back slashes in paths with slashes
* Apply suggestions from code review
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Use cargo from `CARGO` env variable
* Fix compilation
* Use `rustup` for running the nightly build
* Make individual projects skipable
* Fix compilation
* Fixes compilation
* Build all WASM projects in one workspace
* Replace more back slashes!
* Remove `inlcude_bytes!`
* Adds some documentation
* Apply suggestions from code review
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
* Apply suggestions from code review
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
* More review comments
* Update `Cargo.lock`
* Set license
* Apply suggestions from code review
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* More review comments + adds `TRIGGER_WASM_BUILD` env
* Fix doc tests
* Increase version + update README
* Switch crates.io version of `wasm-builder`
* Update README
* Switch to released version of `wasm-builder-runner`
* Remove As usage from CHT
* Remove As usage from CHT (continue)
* Restrict BN <-> int conversions in CT
* more BN <-> u64 conversions removed
* upd spec_version
* Apply suggestions from code review
Co-Authored-By: Gavin Wood <github@gavwood.com>
* Apply suggestions from code review
Co-Authored-By: Gavin Wood <github@gavwood.com>
* more grumbles
* fix last grumbles + compilation
* too long lines
* too long lines
* Replace unwrap with expect
* Move expect to call sites
* Bubble errors up and trap
* Update wasm
* Update invalid pointer
* Remove test which makes problems in CI
* Check for underflow
* Remove unneeded script
* Rename Substrate Demo -> Substrate
* Rename demo -> node
* Build wasm from last rename.
* Merge ed25519 into substrate-primitives
* Minor tweak
* Rename substrate -> core
* Move substrate-runtime-support to core/runtime/support
* Rename/move substrate-runtime-version
* Move codec up a level
* Rename substrate-codec -> parity-codec
* Move environmental up a level
* Move pwasm-* up to top, ready for removal
* Remove requirement of s-r-support from s-r-primitives
* Move core/runtime/primitives into core/runtime-primitives
* Remove s-r-support dep from s-r-version
* Remove dep of s-r-support from bft
* Remove dep of s-r-support from node/consensus
* Sever all other core deps from s-r-support
* Forgot the no_std directive
* Rename non-SRML modules to sr-* to avoid match clashes
* Move runtime/* to srml/*
* Rename substrate-runtime-* -> srml-*
* Move srml to top-level