diff --git a/Cargo.lock b/Cargo.lock index c5cbef9..990667a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1436,6 +1436,7 @@ dependencies = [ "substrate-frame-rpc-system", "substrate-prometheus-endpoint", "try-runtime-cli", + "wasmtime", ] [[package]] @@ -4103,6 +4104,12 @@ dependencies = [ "cc", ] +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + [[package]] name = "idna" version = "0.2.3" @@ -4353,6 +4360,26 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "ittapi" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a5c0b993601cad796222ea076565c5d9f337d35592f8622c753724f06d7271" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7b5e473765060536a660eed127f758cf1a810c73e49063264959c60d1727d9" +dependencies = [ + "cc", +] + [[package]] name = "jobserver" version = "0.1.27" @@ -4599,6 +4626,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "libc" version = "0.2.152" @@ -8954,6 +8987,17 @@ dependencies = [ "cc", ] +[[package]] +name = "pulldown-cmark" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +dependencies = [ + "bitflags 1.3.2", + "memchr", + "unicase", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -13353,6 +13397,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.14" @@ -13588,6 +13641,15 @@ version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +[[package]] +name = "wasm-encoder" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111495d6204760238512f57a9af162f45086504da332af210f2f75dd80b34f1d" +dependencies = [ + "leb128", +] + [[package]] name = "wasm-instrument" version = "0.3.0" @@ -13718,6 +13780,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", + "async-trait", "bincode", "cfg-if", "indexmap 1.9.3", @@ -13732,10 +13795,13 @@ dependencies = [ "target-lexicon", "wasmparser", "wasmtime-cache", + "wasmtime-component-macro", "wasmtime-cranelift", "wasmtime-environ", + "wasmtime-fiber", "wasmtime-jit", "wasmtime-runtime", + "wat", "windows-sys 0.45.0", ] @@ -13768,6 +13834,27 @@ dependencies = [ "zstd 0.11.2+zstd.1.5.2", ] +[[package]] +name = "wasmtime-component-macro" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267096ed7cc93b4ab15d3daa4f195e04dbb7e71c7e5c6457ae7d52e9dd9c3607" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74e02ca7a4a3c69d72b88f26f0192e333958df6892415ac9ab84dcc42c9000c2" + [[package]] name = "wasmtime-cranelift" version = "8.0.1" @@ -13824,6 +13911,19 @@ dependencies = [ "wasmtime-types", ] +[[package]] +name = "wasmtime-fiber" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab182d5ab6273a133ab88db94d8ca86dc3e57e43d70baaa4d98f94ddbd7d10a" +dependencies = [ + "cc", + "cfg-if", + "rustix 0.36.17", + "wasmtime-asm-macros", + "windows-sys 0.45.0", +] + [[package]] name = "wasmtime-jit" version = "8.0.1" @@ -13836,6 +13936,7 @@ dependencies = [ "cfg-if", "cpp_demangle", "gimli 0.27.3", + "ittapi", "log", "object 0.30.4", "rustc-demangle", @@ -13890,6 +13991,7 @@ dependencies = [ "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", + "wasmtime-fiber", "wasmtime-jit-debug", "windows-sys 0.45.0", ] @@ -13906,6 +14008,38 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "wasmtime-wit-bindgen" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "983db9cc294d1adaa892a53ff6a0dc6605fc0ab1a4da5d8a2d2d4bde871ff7dd" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wast" +version = "70.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee4bc54bbe1c6924160b9f75e374a1d07532e7580eb632c0ee6cdd109bb217e" +dependencies = [ + "leb128", + "memchr", + "unicode-width", + "wasm-encoder", +] + +[[package]] +name = "wat" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f0dce8cdc288c717cf01e461a1e451a7b8445d53451123536ba576e423a101a" +dependencies = [ + "wast", +] + [[package]] name = "web-sys" version = "0.3.66" @@ -14368,6 +14502,21 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-parser" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f887c3da527a51b321076ebe6a7513026a4757b6d4d144259946552d6fc728b3" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 1.9.3", + "log", + "pulldown-cmark", + "unicode-xid", + "url", +] + [[package]] name = "wyz" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index e548e87..4a088c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ serde_json = "1.0.111" scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } smallvec = "1.11.2" color-print = "0.3.5" +wasmtime="8.0.1" # Substrate frame-benchmarking = { version = "27.0.0", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index e527d68..b983133 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -24,6 +24,7 @@ serde = { workspace = true } jsonrpsee = { workspace = true } futures = { workspace = true } serde_json = { workspace = true } +wasmtime = { workspace = true } # Local contracts-parachain-runtime = { path = "../parachain-runtime", version = "0.35.0" } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 70052f1..6ad9978 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -151,4 +151,3 @@ fn testnet_genesis( "sudo": { "key": Some(root) } }) } - diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index 464ba5a..b146097 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -66,4 +66,3 @@ fn testnet_genesis( }, }) } - diff --git a/node/src/cli.rs b/node/src/cli.rs index 6e8ac5c..f1885f7 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -114,4 +114,3 @@ impl RelayChainCli { } } } - diff --git a/node/src/command.rs b/node/src/command.rs index ef8a8b4..07b1d59 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -16,7 +16,6 @@ use sc_service::config::{BasePath, PrometheusConfig}; use sp_runtime::traits::AccountIdConversion; use std::net::SocketAddr; - fn load_spec(id: &str) -> std::result::Result, String> { Ok(match id { "" | "dev" => Box::new(chain_spec::dev::development_config().unwrap()), @@ -398,4 +397,3 @@ impl CliConfiguration for RelayChainCli { self.base.base.node_name() } } - diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 8496e0f..60aaabf 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use contracts_parachain_runtime::{opaque::Block, AccountId, Balance, Nonce}; -pub use sc_rpc::{DenyUnsafe, }; +pub use sc_rpc::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; @@ -54,4 +54,3 @@ where module.merge(TransactionPayment::new(client).into_rpc())?; Ok(module) } - diff --git a/node/src/service.rs b/node/src/service.rs index 8f10ed9..59fe7f6 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -438,4 +438,3 @@ pub async fn start_parachain_node( ) -> sc_service::error::Result<(TaskManager, Arc)> { start_node_impl(parachain_config, polkadot_config, collator_options, para_id, hwbench).await } - diff --git a/node/src/service/dev.rs b/node/src/service/dev.rs index 9b5c5a7..1dd21b1 100644 --- a/node/src/service/dev.rs +++ b/node/src/service/dev.rs @@ -2,7 +2,7 @@ use contracts_node_runtime::{self, opaque::Block, RuntimeApi}; use futures::FutureExt; -use sc_client_api::{Backend}; +use sc_client_api::Backend; pub use sc_executor::NativeElseWasmExecutor; use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sc_telemetry::{Telemetry, TelemetryWorker}; diff --git a/parachain-runtime/src/lib.rs b/parachain-runtime/src/lib.rs index 3ef26d3..2e83379 100644 --- a/parachain-runtime/src/lib.rs +++ b/parachain-runtime/src/lib.rs @@ -849,4 +849,3 @@ cumulus_pallet_parachain_system::register_validate_block! { Runtime = Runtime, BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, } - diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 5188081..9082386 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -9,7 +9,10 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); mod assets_config; mod contracts_config; -use frame_support::dispatch::DispatchClass; +use frame_support::{ + dispatch::DispatchClass, + genesis_builder_helper::{build_config, create_default_config}, +}; use frame_system::limits::{BlockLength, BlockWeights}; use polkadot_runtime_common::SlowAdjustingFeeUpdate; use sp_api::impl_runtime_apis; @@ -24,7 +27,6 @@ use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; -use frame_support::genesis_builder_helper::{build_config, create_default_config}; // A few exports that help ease life for downstream crates. pub use frame_support::{