17 releases (8 stable)

new 1.3.1-pre.3 Apr 19, 2024
1.3.0 Apr 23, 2024
1.1.1 Feb 12, 2024
1.1.1-rc.0 Jan 29, 2024
0.1.0 Dec 26, 2023

#5 in #instantiate

Download history 35/week @ 2024-01-08 11/week @ 2024-01-15 27/week @ 2024-01-22 33/week @ 2024-01-29 32/week @ 2024-02-05 107/week @ 2024-02-12 59/week @ 2024-02-19 30/week @ 2024-02-26 20/week @ 2024-03-04 35/week @ 2024-03-11 18/week @ 2024-03-18 42/week @ 2024-04-01 25/week @ 2024-04-08 307/week @ 2024-04-15

374 downloads per month
Used in 3 crates (via gear-core-backend)

GPL-3.0 license

105KB
2K SLoC

This crate provides means to instantiate and execute wasm modules.

It works even when the user of this library executes from inside the wasm VM. In this case the same VM is used for execution of both the sandbox owner and the sandboxed module, without compromising security and without the performance penalty of full wasm emulation inside wasm.

This is achieved by using bindings to the wasm VM, which are published by the host API. This API is thin and consists of only a handful functions. It contains functions for instantiating modules and executing them, but doesn't contain functions for inspecting the module structure. The user of this library is supposed to read the wasm module.

When this crate is used in the std environment all these functions are implemented by directly calling the wasm VM.

Examples of possible use-cases for this library are not limited to the following:

  • implementing program runtimes that use Wasm for contract code
  • executing a wasm substrate runtime inside of a wasm parachain

Dependencies

~12–30MB
~456K SLoC