When deterministic feature will be enabled (turned-off by default) it'll guarantee deterministic

execution of wasm programs across different hardware/circumstances.
This is very useful for Blockchain projects having wasm smart-contracts

This is critical for Blockchain projects that require execution to be deterministic
in order to reach a consensus of the state transition of each smart-contract transaction.
This commit is contained in:
Yaron Wittenstein
2019-10-07 16:58:58 +03:00
parent c8e9530805
commit 6ca5812798
7 changed files with 22 additions and 6 deletions

View File

@ -70,7 +70,7 @@
//! let value = add_one.call(42)?;
//!
//! assert_eq!(value, 43);
//!
//!
//! Ok(())
//! }
//! ```
@ -199,13 +199,15 @@ pub fn default_compiler() -> impl Compiler {
feature = "default-backend-llvm",
any(
feature = "default-backend-cranelift",
feature = "default-backend-singlepass"
feature = "default-backend-singlepass",
feature = "deterministic"
)
),
all(
feature = "default-backend-cranelift",
feature = "default-backend-singlepass"
)
any(feature = "default-backend-singlepass", feature = "deterministic")
),
all(feature = "default-backend-singlepass", feature = "deterministic")
))]
compile_error!(
"The `default-backend-X` features are mutually exclusive. Please choose just one"
@ -214,7 +216,7 @@ pub fn default_compiler() -> impl Compiler {
#[cfg(feature = "default-backend-llvm")]
use wasmer_llvm_backend::LLVMCompiler as DefaultCompiler;
#[cfg(feature = "default-backend-singlepass")]
#[cfg(any(feature = "default-backend-singlepass", feature = "deterministic"))]
use wasmer_singlepass_backend::SinglePassCompiler as DefaultCompiler;
#[cfg(feature = "default-backend-cranelift")]