Function sc_executor_wasmtime::create_runtime_from_artifact[][src]

pub unsafe fn create_runtime_from_artifact(
    compiled_artifact: &[u8],
    config: Config,
    host_functions: Vec<&'static dyn Function>
) -> Result<WasmtimeRuntime, WasmError>
Expand description

The same as create_runtime but takes a precompiled artifact, which makes this function considerably faster than create_runtime.

Safety

The caller must ensure that the compiled artifact passed here was produced by prepare_runtime_artifact. Otherwise, there is a risk of arbitrary code execution with all implications.

It is ok though if the compiled_artifact was created by code of another version or with different configuration flags. In such case the caller will receive an Err deterministically.