refactor(protocol/sandbox): migrate to Wasmtime#4860
Conversation
|
Unstable right now. Will be considered in future |
# Conflicts: # Cargo.lock # Cargo.toml # ethexe/processor/src/host/api/mod.rs # ethexe/rpc/src/lib.rs # ethexe/signer/src/storage.rs # examples/ctor/build.rs # gcli/src/template.rs # pallets/gear/src/tests.rs # sandbox/host/Cargo.toml # sandbox/host/src/sandbox/wasmer_backend.rs # sandbox/sandbox/Cargo.toml # sandbox/sandbox/src/embedded_executor.rs # utils/calc-stack-height/src/main.rs # utils/gear-wasmer-cache/Cargo.toml # utils/gear-wasmer-cache/src/lib.rs # utils/gring/tests/command.rs # utils/lazy-pages-fuzzer/src/wasmtime_backend.rs
There was a problem hiding this comment.
Code Review
This pull request migrates the WebAssembly sandbox backend from Wasmer to Wasmtime across the entire workspace, including ethexe, protocol, and vara components. The transition involves implementing a new Wasmtime backend, updating gas metering weights to account for Winch compiler optimizations, and removing Wasmer-specific caching logic. Feedback identifies several critical issues, including compilation errors in Linker::get and Val::ty usage, and potential panics from expect calls in host functions and instantiation that violate repository safety rules. Additionally, a typo shadowing the HostError type was found, and an improvement was suggested to restore store data after function invocation to prevent side effects.
2848b77 to
e0d4d1e
Compare
# Conflicts: # Cargo.toml
Resolves #5432
NOTE: Substrate's Wasmtime is also updated
NOTE: our published crates on crates.io still use Wasmtime 8 - #5485