From 40b1aec465cb7277aca600acfdf5ba3cec9b6f7c Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 18 Dec 2023 16:43:20 +0100 Subject: [PATCH 1/8] Try updating to wasmi v0.32 --- Cargo.lock | 20 ++++++++++++-------- lib/Cargo.toml | 2 +- lib/src/executor/vm/interpreter.rs | 3 ++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b01e246559..620ca58ca0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1635,6 +1635,12 @@ dependencies = [ "adler", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "nix" version = "0.27.1" @@ -2850,10 +2856,10 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acfc1e384a36ca532d070a315925887247f3c7e23567e23e0ac9b1c5d6b8bf76" +version = "0.32.0-beta.0" +source = "git+https://github.com/paritytech/wasmi#86d097623592dc499852ea4bb01cace0097d70a4" dependencies = [ + "multi-stash", "smallvec", "spin", "wasmi_arena", @@ -2864,14 +2870,12 @@ dependencies = [ [[package]] name = "wasmi_arena" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" +source = "git+https://github.com/paritytech/wasmi#86d097623592dc499852ea4bb01cace0097d70a4" [[package]] name = "wasmi_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +version = "0.14.0" +source = "git+https://github.com/paritytech/wasmi#86d097623592dc499852ea4bb01cace0097d70a4" dependencies = [ "downcast-rs", "libm", diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 7c1f94fe0d..5d5eba36a0 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -77,7 +77,7 @@ siphasher = { version = "1.0.0", default-features = false } slab = { version = "0.4.8", default-features = false } smallvec = { version = "1.11.0", default-features = false } twox-hash = { version = "1.6.3", default-features = false } -wasmi = { version = "0.31.0", default-features = false } +wasmi = { git = "https://github.com/paritytech/wasmi", default-features = false } x25519-dalek = { version = "2.0.0-rc.3", default-features = false, features = ["alloc", "precomputed-tables", "static_secrets", "zeroize"] } zeroize = { version = "1.6.0", default-features = false, features = ["alloc"] } diff --git a/lib/src/executor/vm/interpreter.rs b/lib/src/executor/vm/interpreter.rs index e4fe69c508..2efb521644 100644 --- a/lib/src/executor/vm/interpreter.rs +++ b/lib/src/executor/vm/interpreter.rs @@ -66,6 +66,7 @@ impl InterpreterPrototype { config.wasm_mutable_global(false); config.wasm_saturating_float_to_int(false); config.wasm_tail_call(false); + config.compilation_mode(wasmi::CompilationMode::Lazy); wasmi::Engine::new(&config) }; @@ -129,7 +130,7 @@ impl InterpreterPrototype { &mut store, func_type.clone(), move |_caller, parameters, _ret| { - Err(wasmi::core::Trap::from(InterruptedTrap { + Err(wasmi::Error::host(InterruptedTrap { function_index, parameters: parameters .iter() From 8672e27cccbb71092cd14b0b4fbe54b2920a6886 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 18 Dec 2023 19:29:11 +0100 Subject: [PATCH 2/8] Use crates.io version --- Cargo.lock | 13 ++++++++----- lib/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 620ca58ca0..91789f93c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2856,8 +2856,9 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.32.0-beta.0" -source = "git+https://github.com/paritytech/wasmi#86d097623592dc499852ea4bb01cace0097d70a4" +version = "0.32.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0aad9322aebdae4ab039e53bcd5a81dae75047dd55cada2c04124bd3438a99e" dependencies = [ "multi-stash", "smallvec", @@ -2870,12 +2871,14 @@ dependencies = [ [[package]] name = "wasmi_arena" version = "0.4.0" -source = "git+https://github.com/paritytech/wasmi#86d097623592dc499852ea4bb01cace0097d70a4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" [[package]] name = "wasmi_core" -version = "0.14.0" -source = "git+https://github.com/paritytech/wasmi#86d097623592dc499852ea4bb01cace0097d70a4" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ac482df6761020b2b75c9aade41c105993c5b9f64156c349bb7ccad226a6ecd" dependencies = [ "downcast-rs", "libm", diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 5d5eba36a0..e8a105952d 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -77,7 +77,7 @@ siphasher = { version = "1.0.0", default-features = false } slab = { version = "0.4.8", default-features = false } smallvec = { version = "1.11.0", default-features = false } twox-hash = { version = "1.6.3", default-features = false } -wasmi = { git = "https://github.com/paritytech/wasmi", default-features = false } +wasmi = { version = "0.32.0-beta.1", default-features = false } x25519-dalek = { version = "2.0.0-rc.3", default-features = false, features = ["alloc", "precomputed-tables", "static_secrets", "zeroize"] } zeroize = { version = "1.6.0", default-features = false, features = ["alloc"] } From ef6a5a5b1456c6ad0db4af15443204bec1660660 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 19 Dec 2023 09:17:34 +0100 Subject: [PATCH 3/8] CHANGELOG --- wasm-node/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index 8b2d6b11e5..27c7ddd469 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Changed + +- The WebAssembly runtime is now compiled lazily, meaning that only the code that is executed is validated and translated. Thanks to this, compiling a runtime is now four times faster and the time to head of the chain is around 200ms faster. ([#1488](https://github.com/smol-dot/smoldot/pull/1488)) + ## 2.0.14 - 2023-12-11 ### Fixed From 3adececd58799072097e7c2243b978af6aa2b358 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 19 Dec 2023 09:27:24 +0100 Subject: [PATCH 4/8] Add new ExecHints --- full-node/src/consensus_service.rs | 2 +- .../runtime_caches_service.rs | 2 +- full-node/src/lib.rs | 2 +- fuzz/fuzz_targets/wasm-module-wasmi.rs | 4 +- lib/src/chain_spec.rs | 2 +- lib/src/executor/host.rs | 2 +- lib/src/executor/runtime_host.rs | 2 +- lib/src/executor/runtime_host/tests.rs | 2 +- lib/src/executor/vm.rs | 66 ++++++++++++++++--- lib/src/executor/vm/interpreter.rs | 5 +- lib/src/transactions/validate/tests.rs | 2 +- lib/src/verify/body_only.rs | 2 +- light-base/src/runtime_service.rs | 5 +- light-base/src/sync_service/standalone.rs | 6 +- 14 files changed, 83 insertions(+), 21 deletions(-) diff --git a/full-node/src/consensus_service.rs b/full-node/src/consensus_service.rs index bd68cb3a16..056e832bc3 100644 --- a/full-node/src/consensus_service.rs +++ b/full-node/src/consensus_service.rs @@ -316,7 +316,7 @@ impl ConsensusService { executor::host::HostVmPrototype::new(executor::host::Config { module: finalized_code, heap_pages, - exec_hint: executor::vm::ExecHint::CompileAheadOfTime, // TODO: probably should be decided by the optimisticsync + exec_hint: executor::vm::ExecHint::ValidateAndCompile, // TODO: probably should be decided by the optimisticsync allow_unresolved_imports: false, }) .map_err(InitError::FinalizedRuntimeInit)? diff --git a/full-node/src/json_rpc_service/runtime_caches_service.rs b/full-node/src/json_rpc_service/runtime_caches_service.rs index 943ec816fa..fb443b62b8 100644 --- a/full-node/src/json_rpc_service/runtime_caches_service.rs +++ b/full-node/src/json_rpc_service/runtime_caches_service.rs @@ -105,7 +105,7 @@ impl RuntimeCachesService { executor::host::Config { module: &code, heap_pages, - exec_hint: executor::vm::ExecHint::CompileAheadOfTime, + exec_hint: executor::vm::ExecHint::ValidateAndCompile, allow_unresolved_imports: true, // TODO: configurable? or if not, document }, ) diff --git a/full-node/src/lib.rs b/full-node/src/lib.rs index 7053f51bdc..7f86dca30f 100644 --- a/full-node/src/lib.rs +++ b/full-node/src/lib.rs @@ -853,7 +853,7 @@ async fn open_database( genesis_storage.value(b":heappages"), ) .unwrap(), - exec_hint: executor::vm::ExecHint::Oneshot, + exec_hint: executor::vm::ExecHint::ValidateAndExecuteOnce, allow_unresolved_imports: true, }) .unwrap() diff --git a/fuzz/fuzz_targets/wasm-module-wasmi.rs b/fuzz/fuzz_targets/wasm-module-wasmi.rs index f287e61ca7..21c21e9d2a 100644 --- a/fuzz/fuzz_targets/wasm-module-wasmi.rs +++ b/fuzz/fuzz_targets/wasm-module-wasmi.rs @@ -21,7 +21,9 @@ libfuzzer_sys::fuzz_target!(|data: &[u8]| { let _ = smoldot::executor::host::HostVmPrototype::new(smoldot::executor::host::Config { module: data, heap_pages: smoldot::executor::DEFAULT_HEAP_PAGES, - exec_hint: smoldot::executor::vm::ExecHint::ForceWasmi, + exec_hint: smoldot::executor::vm::ExecHint::ForceWasmi { + lazy_validation: false, + }, allow_unresolved_imports: true, }); }); diff --git a/lib/src/chain_spec.rs b/lib/src/chain_spec.rs index 6823c8f927..79184aae25 100644 --- a/lib/src/chain_spec.rs +++ b/lib/src/chain_spec.rs @@ -116,7 +116,7 @@ impl ChainSpec { let vm_prototype = executor::host::HostVmPrototype::new(executor::host::Config { module: &wasm_code, heap_pages, - exec_hint: executor::vm::ExecHint::Oneshot, + exec_hint: executor::vm::ExecHint::ValidateAndExecuteOnce, allow_unresolved_imports: true, }) .map_err(FromGenesisStorageError::VmInitialization)?; diff --git a/lib/src/executor/host.rs b/lib/src/executor/host.rs index 5fdca98779..2814682f52 100644 --- a/lib/src/executor/host.rs +++ b/lib/src/executor/host.rs @@ -152,7 +152,7 @@ //! let prototype = HostVmPrototype::new(Config { //! module: &wasm_binary_code, //! heap_pages: HeapPages::from(2048), -//! exec_hint: smoldot::executor::vm::ExecHint::Oneshot, +//! exec_hint: smoldot::executor::vm::ExecHint::ValidateAndExecuteOnce, //! allow_unresolved_imports: false //! }).unwrap(); //! prototype.run_no_param("Core_version").unwrap().into() diff --git a/lib/src/executor/runtime_host.rs b/lib/src/executor/runtime_host.rs index 7ca86efde1..3adc6d2d5e 100644 --- a/lib/src/executor/runtime_host.rs +++ b/lib/src/executor/runtime_host.rs @@ -1775,7 +1775,7 @@ impl Inner { let vm_prototype = match host::HostVmPrototype::new(host::Config { module: req.wasm_code(), heap_pages: executor::DEFAULT_HEAP_PAGES, - exec_hint: vm::ExecHint::Oneshot, + exec_hint: vm::ExecHint::ValidateAndExecuteOnce, allow_unresolved_imports: false, // TODO: what is a correct value here? }) { Ok(w) => w, diff --git a/lib/src/executor/runtime_host/tests.rs b/lib/src/executor/runtime_host/tests.rs index 90ad4cdfd0..b83a67e314 100644 --- a/lib/src/executor/runtime_host/tests.rs +++ b/lib/src/executor/runtime_host/tests.rs @@ -74,7 +74,7 @@ fn execute_blocks() { host::HostVmPrototype::new(host::Config { module: code, heap_pages, - exec_hint: crate::executor::vm::ExecHint::Oneshot, + exec_hint: crate::executor::vm::ExecHint::ExecuteOnceWithNonDeterministicValidation, allow_unresolved_imports: false, }) .unwrap() diff --git a/lib/src/executor/vm.rs b/lib/src/executor/vm.rs index 4c1918ad1c..ed91f1ccd6 100644 --- a/lib/src/executor/vm.rs +++ b/lib/src/executor/vm.rs @@ -145,7 +145,7 @@ impl VirtualMachinePrototype { ), feature = "wasmtime" ))] - ExecHint::CompileAheadOfTime => VirtualMachinePrototypeInner::Jit( + ExecHint::ValidateAndCompile => VirtualMachinePrototypeInner::Jit( jit::JitPrototype::new(config.module_bytes, config.symbols)?, ), #[cfg(not(all( @@ -159,13 +159,41 @@ impl VirtualMachinePrototype { ), feature = "wasmtime" )))] - ExecHint::CompileAheadOfTime => VirtualMachinePrototypeInner::Interpreter( - interpreter::InterpreterPrototype::new(config.module_bytes, config.symbols)?, + ExecHint::ValidateAndCompile => VirtualMachinePrototypeInner::Interpreter( + interpreter::InterpreterPrototype::new( + config.module_bytes, + interpreter::CompilationMode::Eager, + config.symbols, + )?, ), - ExecHint::Oneshot | ExecHint::Untrusted | ExecHint::ForceWasmi => { + ExecHint::ValidateAndExecuteOnce | ExecHint::Untrusted => { VirtualMachinePrototypeInner::Interpreter( interpreter::InterpreterPrototype::new( config.module_bytes, + interpreter::CompilationMode::Eager, + config.symbols, + )?, + ) + } + ExecHint::CompileWithNonDeterministicValidation + | ExecHint::ExecuteOnceWithNonDeterministicValidation => { + VirtualMachinePrototypeInner::Interpreter( + interpreter::InterpreterPrototype::new( + config.module_bytes, + interpreter::CompilationMode::Lazy, + config.symbols, + )?, + ) + } + ExecHint::ForceWasmi { lazy_validation } => { + VirtualMachinePrototypeInner::Interpreter( + interpreter::InterpreterPrototype::new( + config.module_bytes, + if lazy_validation { + interpreter::CompilationMode::Lazy + } else { + interpreter::CompilationMode::Eager + }, config.symbols, )?, ) @@ -713,18 +741,37 @@ impl fmt::Debug for VirtualMachine { pub enum ExecHint { /// The WebAssembly code will be instantiated once and run many times. /// If possible, compile this WebAssembly code ahead of time. - CompileAheadOfTime, + ValidateAndCompile, + + /// The WebAssembly code will be instantiated once and run many times. + /// Contrary to [`ExecHint::ValidateAndCompile`], the WebAssembly code isn't fully validated + /// ahead of time, meaning that invalid WebAssembly modules might successfully be compiled, + /// which is an indesirable property in some contexts. + CompileWithNonDeterministicValidation, + /// The WebAssembly code is expected to be only run once. /// /// > **Note**: This isn't a hard requirement but a hint. - Oneshot, + ValidateAndExecuteOnce, + + /// The WebAssembly code will be instantiated once and run many times. + /// Contrary to [`ExecHint::ValidateAndExecuteOnce`], the WebAssembly code isn't fully + /// validated ahead of time, meaning that invalid WebAssembly modules might successfully be + /// compiled, which is an indesirable property in some contexts. + ExecuteOnceWithNonDeterministicValidation, + /// The WebAssembly code running through this VM is untrusted. Untrusted, /// Forces using the `wasmi` backend. /// /// This variant is useful for testing purposes. - ForceWasmi, + ForceWasmi { + /// If `true`, lazy validation is enabled. This leads to a faster initialization time, + /// but can also successfully validate invalid modules, which is an indesirable property + /// in some contexts. + lazy_validation: bool, + }, /// Forces using the `wasmtime` backend. /// /// This variant is useful for testing purposes. @@ -761,7 +808,10 @@ impl ExecHint { /// /// > **Note**: This function is most useful for testing purposes. pub fn available_engines() -> impl Iterator { - iter::once(ExecHint::ForceWasmi).chain(Self::force_wasmtime_if_available()) + iter::once(ExecHint::ForceWasmi { + lazy_validation: false, + }) + .chain(Self::force_wasmtime_if_available()) } /// Returns `ForceWasmtime` if it is available on the current platform, and `None` otherwise. diff --git a/lib/src/executor/vm/interpreter.rs b/lib/src/executor/vm/interpreter.rs index 2efb521644..b4124602c8 100644 --- a/lib/src/executor/vm/interpreter.rs +++ b/lib/src/executor/vm/interpreter.rs @@ -25,6 +25,8 @@ use super::{ use alloc::{borrow::ToOwned as _, string::ToString as _, sync::Arc, vec::Vec}; use core::fmt; +pub use wasmi::CompilationMode; + /// See [`super::VirtualMachinePrototype`]. pub struct InterpreterPrototype { /// Base components that can be used to recreate a prototype later if desired. @@ -52,6 +54,7 @@ impl InterpreterPrototype { /// See [`super::VirtualMachinePrototype::new`]. pub fn new( module_bytes: &[u8], + compilation_mode: CompilationMode, symbols: &mut dyn FnMut(&str, &str, &Signature) -> Result, ) -> Result { let engine = { @@ -66,7 +69,7 @@ impl InterpreterPrototype { config.wasm_mutable_global(false); config.wasm_saturating_float_to_int(false); config.wasm_tail_call(false); - config.compilation_mode(wasmi::CompilationMode::Lazy); + config.compilation_mode(compilation_mode); wasmi::Engine::new(&config) }; diff --git a/lib/src/transactions/validate/tests.rs b/lib/src/transactions/validate/tests.rs index 9abcffc869..8d4c14cd9e 100644 --- a/lib/src/transactions/validate/tests.rs +++ b/lib/src/transactions/validate/tests.rs @@ -30,7 +30,7 @@ fn validate_from_proof() { module: hex::decode(&test.runtime_code).unwrap(), heap_pages: executor::DEFAULT_HEAP_PAGES, allow_unresolved_imports: true, - exec_hint: executor::vm::ExecHint::Oneshot, + exec_hint: executor::vm::ExecHint::ExecuteOnceWithNonDeterministicValidation, }) .unwrap(); diff --git a/lib/src/verify/body_only.rs b/lib/src/verify/body_only.rs index 8bc0c825ed..9ee2275439 100644 --- a/lib/src/verify/body_only.rs +++ b/lib/src/verify/body_only.rs @@ -776,7 +776,7 @@ impl RuntimeCompilation { let new_runtime = match host::HostVmPrototype::new(host::Config { module: code, heap_pages: self.heap_pages, - exec_hint: vm::ExecHint::CompileAheadOfTime, + exec_hint: vm::ExecHint::ValidateAndCompile, // TODO: let API user choose this allow_unresolved_imports: false, }) { Ok(vm) => vm, diff --git a/light-base/src/runtime_service.rs b/light-base/src/runtime_service.rs index acf2d07f46..ca553830d1 100644 --- a/light-base/src/runtime_service.rs +++ b/light-base/src/runtime_service.rs @@ -2533,13 +2533,16 @@ impl SuccessfulRuntime { let module = code.as_ref().ok_or(RuntimeError::CodeNotFound)?; let heap_pages = executor::storage_heap_pages_to_value(heap_pages.as_deref()) .map_err(RuntimeError::InvalidHeapPages)?; - let exec_hint = executor::vm::ExecHint::CompileAheadOfTime; + // Because the runtime has been validated by at least the author of the block, we assume + // that it is valid. This significantly speeds up the compilation. + let exec_hint = executor::vm::ExecHint::CompileWithNonDeterministicValidation; // We try once with `allow_unresolved_imports: false`. If this fails due to unresolved // import, we try again but with `allowed_unresolved_imports: true`. // Having unresolved imports might cause errors later on, for example when validating // transactions or getting the parachain heads, but for now we continue the execution // and print a warning. + // TODO: should log the fact that we're compiling a runtime and the time it takes, as this is a heavy operation match executor::host::HostVmPrototype::new(executor::host::Config { module, heap_pages, diff --git a/light-base/src/sync_service/standalone.rs b/light-base/src/sync_service/standalone.rs index bf31becb0e..4d52eb769a 100644 --- a/light-base/src/sync_service/standalone.rs +++ b/light-base/src/sync_service/standalone.rs @@ -960,7 +960,11 @@ impl Task { // Warp syncing compiles the runtime. The compiled runtime will later be yielded // in the `WarpSyncFinished` variant, which is then provided as an event. let before_instant = self.platform.now(); - let (new_sync, error) = req.build(all::ExecHint::CompileAheadOfTime, true); + // Because the runtime being compiled has been validated by 2/3rds of the + // validators of the chain, we can assume that it is valid. Doing so significantly + // increases the compilation speed. + let (new_sync, error) = + req.build(all::ExecHint::CompileWithNonDeterministicValidation, true); let elapsed = self.platform.now() - before_instant; match error { Ok(()) => { From aaec4c917e72f1fd32d78f7e6c2f1b66a5278bb7 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 21 Dec 2023 09:02:45 +0100 Subject: [PATCH 5/8] Try the git version again --- Cargo.lock | 22 ++++++++++++++++------ lib/Cargo.toml | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 91789f93c7..e750563f4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1685,6 +1685,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.41", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -2857,10 +2868,11 @@ dependencies = [ [[package]] name = "wasmi" version = "0.32.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0aad9322aebdae4ab039e53bcd5a81dae75047dd55cada2c04124bd3438a99e" +source = "git+https://github.com/paritytech/wasmi#f96475ef1135d11858e0859cee97ea07f93c6d3d" dependencies = [ "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin", "wasmi_arena", @@ -2871,14 +2883,12 @@ dependencies = [ [[package]] name = "wasmi_arena" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" +source = "git+https://github.com/paritytech/wasmi#f96475ef1135d11858e0859cee97ea07f93c6d3d" [[package]] name = "wasmi_core" version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac482df6761020b2b75c9aade41c105993c5b9f64156c349bb7ccad226a6ecd" +source = "git+https://github.com/paritytech/wasmi#f96475ef1135d11858e0859cee97ea07f93c6d3d" dependencies = [ "downcast-rs", "libm", diff --git a/lib/Cargo.toml b/lib/Cargo.toml index e8a105952d..5d5eba36a0 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -77,7 +77,7 @@ siphasher = { version = "1.0.0", default-features = false } slab = { version = "0.4.8", default-features = false } smallvec = { version = "1.11.0", default-features = false } twox-hash = { version = "1.6.3", default-features = false } -wasmi = { version = "0.32.0-beta.1", default-features = false } +wasmi = { git = "https://github.com/paritytech/wasmi", default-features = false } x25519-dalek = { version = "2.0.0-rc.3", default-features = false, features = ["alloc", "precomputed-tables", "static_secrets", "zeroize"] } zeroize = { version = "1.6.0", default-features = false, features = ["alloc"] } From f918697af236d45eb81576db0eee6689e602f561 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 21 Dec 2023 10:21:10 +0100 Subject: [PATCH 6/8] Fix compilation error due to merge --- full-node/src/consensus_service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/full-node/src/consensus_service.rs b/full-node/src/consensus_service.rs index 3bcc6403af..3e3405c645 100644 --- a/full-node/src/consensus_service.rs +++ b/full-node/src/consensus_service.rs @@ -1927,7 +1927,7 @@ impl SyncBackground { } all::ProcessOne::WarpSyncBuildRuntime(build_runtime) => { let (new_sync, outcome) = - build_runtime.build(all::ExecHint::CompileAheadOfTime, true); + build_runtime.build(all::ExecHint::ValidateAndCompile, true); self.sync = new_sync; if let Err(err) = outcome { self.log_callback.log( From 80dbb6f8ae45731ab2e49f17c7acf8a7c17291fa Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sat, 23 Dec 2023 09:14:41 +0100 Subject: [PATCH 7/8] crates.io version --- Cargo.lock | 11 +++++++---- lib/Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 888628ebb2..a5ad6e39cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2867,8 +2867,9 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.32.0-beta.1" -source = "git+https://github.com/paritytech/wasmi#f96475ef1135d11858e0859cee97ea07f93c6d3d" +version = "0.32.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aab06f5b4dadd225f47efe41308550ab01f0b6aa2585d7823c3f215e5777ebd" dependencies = [ "multi-stash", "num-derive", @@ -2883,12 +2884,14 @@ dependencies = [ [[package]] name = "wasmi_arena" version = "0.4.0" -source = "git+https://github.com/paritytech/wasmi#f96475ef1135d11858e0859cee97ea07f93c6d3d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" [[package]] name = "wasmi_core" version = "0.15.0" -source = "git+https://github.com/paritytech/wasmi#f96475ef1135d11858e0859cee97ea07f93c6d3d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ac482df6761020b2b75c9aade41c105993c5b9f64156c349bb7ccad226a6ecd" dependencies = [ "downcast-rs", "libm", diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 5d5eba36a0..638def52bd 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -77,7 +77,7 @@ siphasher = { version = "1.0.0", default-features = false } slab = { version = "0.4.8", default-features = false } smallvec = { version = "1.11.0", default-features = false } twox-hash = { version = "1.6.3", default-features = false } -wasmi = { git = "https://github.com/paritytech/wasmi", default-features = false } +wasmi = { version = "0.32.0-beta.2", default-features = false } x25519-dalek = { version = "2.0.0-rc.3", default-features = false, features = ["alloc", "precomputed-tables", "static_secrets", "zeroize"] } zeroize = { version = "1.6.0", default-features = false, features = ["alloc"] } From 7887648ba88f8826bbeb49996c9ee3efe8d79821 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Sat, 23 Dec 2023 09:21:51 +0100 Subject: [PATCH 8/8] Cargo.lock needs update for some reason --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 6cb339674b..fca8a67306 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1693,7 +1693,7 @@ checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]]