Skip to content

Commit e71511b

Browse files
authored
Merge pull request #425 from filecoin-project/feat/wasmtime-config
Set some wasmtime config settings
2 parents 3b85ede + 281690b commit e71511b

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

fvm/src/machine/engine.rs

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,48 @@ pub struct Engine(Arc<EngineInner>);
1717

1818
impl Default for Engine {
1919
fn default() -> Self {
20-
Engine::new(&wasmtime::Config::default()).unwrap()
20+
let mut c = wasmtime::Config::default();
21+
22+
// c.max_wasm_stack(); https://github.com/filecoin-project/ref-fvm/issues/424
23+
24+
// wasmtime default: false
25+
c.wasm_threads(false);
26+
27+
// wasmtime default: true
28+
c.wasm_simd(false);
29+
30+
// wasmtime default: false
31+
c.wasm_multi_memory(false);
32+
33+
// wasmtime default: false
34+
c.wasm_memory64(false);
35+
36+
// wasmtime default: true
37+
c.wasm_bulk_memory(true);
38+
39+
// wasmtime default: false
40+
c.wasm_module_linking(false);
41+
42+
// wasmtime default: true
43+
c.wasm_multi_value(false); // ??
44+
45+
// wasmtime default: depends on the arch
46+
// > This is true by default on x86-64, and false by default on other architectures.
47+
c.wasm_reference_types(false);
48+
49+
// wasmtime default: false
50+
//
51+
// from wasmtime docs:
52+
// > When Cranelift is used as a code generation backend this will
53+
// > configure it to replace NaNs with a single canonical value. This
54+
// > is useful for users requiring entirely deterministic WebAssembly
55+
// > computation. This is not required by the WebAssembly spec, so it is
56+
// > not enabled by default.
57+
c.cranelift_nan_canonicalization(true);
58+
59+
// c.cranelift_opt_level(Speed); ?
60+
61+
Engine::new(&c).unwrap()
2162
}
2263
}
2364

0 commit comments

Comments
 (0)