Unverified Commit fa3c93dd authored by asynchronous rob's avatar asynchronous rob Committed by GitHub
Browse files

Switch to Wasmtime for parachain execution (#2265)



* Switch to Wasmtime for parachain execution

* Fix the signature for halt's validate_block

* wasmtime feature enabled from cli

* Adds missing feature
Co-authored-by: Sergey Pepyakin's avatarSergei Shulepov <sergei@parity.io>
Co-authored-by: Bastian Köcher's avatarBastian Köcher <git@kchr.de>
parent cecb3207
Pipeline #120485 passed with stages
in 27 minutes and 46 seconds
......@@ -40,7 +40,7 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate"
[features]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker", "polkadot-parachain" ]
wasmtime = [ "sc-cli/wasmtime" ]
wasmtime = [ "sc-cli/wasmtime", "polkadot-parachain/wasmtime" ]
db = [ "service/db" ]
cli = [
"structopt",
......
......@@ -32,6 +32,7 @@ shared_memory = { version = "0.10.0", optional = true }
[features]
default = ["std"]
wasmtime = [ "sc-executor/wasmtime" ]
wasm-api = []
std = [
"parity-scale-codec/std",
......
......@@ -198,6 +198,9 @@ pub fn validate_candidate_internal(
spawner: impl SpawnNamed + 'static,
) -> Result<ValidationResult, ValidationError> {
let executor = sc_executor::WasmExecutor::new(
#[cfg(all(feature = "wasmtime", not(any(target_os = "android", target_os = "unknown"))))]
sc_executor::WasmExecutionMethod::Compiled,
#[cfg(any(not(feature = "wasmtime"), target_os = "android", target_os = "unknown"))]
sc_executor::WasmExecutionMethod::Interpreted,
// TODO: Make sure we don't use more than 1GB: https://github.com/paritytech/polkadot/issues/699
Some(1024),
......
......@@ -50,6 +50,6 @@ pub fn oom(_: core::alloc::Layout) -> ! {
#[cfg(not(feature = "std"))]
#[no_mangle]
pub extern fn validate_block(params: *const u8, len: usize) -> usize {
pub extern fn validate_block(params: *const u8, len: usize) -> u64 {
loop {}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment