Struct sc_executor_wasmtime::Semantics
source · pub struct Semantics {
pub instantiation_strategy: InstantiationStrategy,
pub deterministic_stack_limit: Option<DeterministicStackLimit>,
pub canonicalize_nans: bool,
pub parallel_compilation: bool,
pub heap_alloc_strategy: HeapAllocStrategy,
pub wasm_multi_value: bool,
pub wasm_bulk_memory: bool,
pub wasm_reference_types: bool,
pub wasm_simd: bool,
}
Fields§
§instantiation_strategy: InstantiationStrategy
The instantiation strategy to use.
deterministic_stack_limit: Option<DeterministicStackLimit>
Specifying Some
will enable deterministic stack height. That is, all executor
invocations will reach stack overflow at the exactly same point across different wasmtime
versions and architectures.
This is achieved by a combination of running an instrumentation pass on input code and configuring wasmtime accordingly.
Since this feature depends on instrumentation, it can be set only if runtime is
instantiated using the runtime blob, e.g. using create_runtime
.
canonicalize_nans: bool
Controls whether wasmtime should compile floating point in a way that doesn’t allow for non-determinism.
By default, the wasm spec allows some local non-determinism wrt. certain floating point operations. Specifically, those operations that are not defined to operate on bits (e.g. fneg) can produce NaN values. The exact bit pattern for those is not specified and may depend on the particular machine that executes wasmtime generated JITed machine code. That is a source of non-deterministic values.
The classical runtime environment for Substrate allowed it and punted this on the runtime developers. For PVFs, we want to ensure that execution is deterministic though. Therefore, for PVF execution this flag is meant to be turned on.
parallel_compilation: bool
Configures wasmtime to use multiple threads for compiling.
heap_alloc_strategy: HeapAllocStrategy
The heap allocation strategy to use.
wasm_multi_value: bool
Enables WASM Multi-Value proposal
wasm_bulk_memory: bool
Enables WASM Bulk Memory Operations proposal
wasm_reference_types: bool
Enables WASM Reference Types proposal
wasm_simd: bool
Enables WASM Fixed-Width SIMD proposal
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Semantics
impl Send for Semantics
impl Sync for Semantics
impl Unpin for Semantics
impl UnwindSafe for Semantics
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.