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

@ -145,6 +145,9 @@ pub fn validating_parser_config(features: &Features) -> wasmparser::ValidatingPa
enable_simd: features.simd,
enable_bulk_memory: false,
enable_multi_value: false,
#[cfg(feature = "deterministic")]
deterministic_only: true,
},
}
}

View File

@ -145,6 +145,9 @@ pub fn validate_and_report_errors_with_features(
enable_multi_value: false,
enable_reference_types: false,
enable_threads: features.threads,
#[cfg(feature = "deterministic")]
deterministic_only: true,
},
};
let mut parser = wasmparser::ValidatingParser::new(wasm, Some(config));