diff --git a/Cargo.lock b/Cargo.lock index a8e37a57d..ebd364793 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8417,7 +8417,6 @@ dependencies = [ "macros", "pallet-funding", "pallet-transaction-payment-rpc", - "parity-scale-codec", "polimec-runtime", "politest-runtime", "polkadot-cli", @@ -8445,10 +8444,10 @@ dependencies = [ "sp-blockchain", "sp-consensus-aura", "sp-core", + "sp-io", "sp-keystore", "sp-runtime", "sp-timestamp", - "sp-transaction-pool", "staging-xcm", "substrate-build-script-utils", "substrate-frame-rpc-system", @@ -8485,6 +8484,7 @@ dependencies = [ "cumulus-pallet-session-benchmarking", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-utility", "frame-benchmarking", diff --git a/nodes/parachain/Cargo.toml b/nodes/parachain/Cargo.toml index 5eaaf5e64..cf4659fa2 100644 --- a/nodes/parachain/Cargo.toml +++ b/nodes/parachain/Cargo.toml @@ -13,7 +13,6 @@ version.workspace = true [dependencies] clap = { workspace = true, features = ["derive"] } log.workspace = true -parity-scale-codec = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json.workspace = true jsonrpsee = { workspace = true, features = ["server"] } @@ -49,6 +48,7 @@ sc-transaction-pool.workspace = true sc-transaction-pool-api.workspace = true sc-network-sync.workspace = true sp-api.workspace = true +sp-io.workspace = true sp-block-builder.workspace = true sp-blockchain.workspace = true sp-consensus-aura.workspace = true @@ -56,7 +56,6 @@ sp-core.workspace = true sp-keystore.workspace = true sp-runtime.workspace = true sp-timestamp.workspace = true -sp-transaction-pool.workspace = true substrate-frame-rpc-system.workspace = true substrate-prometheus-endpoint.workspace = true @@ -89,6 +88,7 @@ runtime-benchmarks = [ "cumulus-primitives-core/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", "pallet-funding/runtime-benchmarks", "polimec-runtime/runtime-benchmarks", "politest-runtime/runtime-benchmarks", @@ -98,6 +98,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", ] try-runtime = [ + "frame-support/try-runtime", "pallet-funding/try-runtime", "polimec-runtime/try-runtime", "politest-runtime/try-runtime", @@ -107,19 +108,19 @@ try-runtime = [ std = [ "cumulus-primitives-core/std", "frame-benchmarking/std", + "frame-support/std", "log/std", "pallet-funding/std", - "parity-scale-codec/std", "polkadot-primitives/std", "serde/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", "sp-core/std", + "sp-io/std", "sp-keystore/std", "sp-runtime/std", "sp-timestamp/std", - "sp-transaction-pool/std", "xcm/std", ] on-chain-release-build = [ diff --git a/nodes/parachain/src/service.rs b/nodes/parachain/src/service.rs index 1b6911887..b13068083 100644 --- a/nodes/parachain/src/service.rs +++ b/nodes/parachain/src/service.rs @@ -50,7 +50,7 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE; use sc_client_api::Backend; use sc_consensus::ImportQueue; -use sc_executor::{HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; +use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use sc_network::NetworkBlock; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; @@ -59,22 +59,7 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; -/// Native executor type. -pub struct ParachainNativeExecutor; - -impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor { - type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; - - fn dispatch(method: &str, data: &[u8]) -> Option> { - polimec_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - polimec_runtime::native_version() - } -} - -type ParachainExecutor = NativeElseWasmExecutor; +type ParachainExecutor = WasmExecutor<(sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions)>; type ParachainClient = TFullClient; @@ -111,7 +96,7 @@ pub fn new_partial(config: &Configuration) -> Result .default_heap_pages .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); - let wasm = WasmExecutor::builder() + let executor = WasmExecutor::builder() .with_execution_method(config.wasm_method) .with_onchain_heap_alloc_strategy(heap_pages) .with_offchain_heap_alloc_strategy(heap_pages) @@ -119,8 +104,6 @@ pub fn new_partial(config: &Configuration) -> Result .with_runtime_cache_size(config.runtime_cache_size) .build(); - let executor = ParachainExecutor::new_with_wasm_executor(wasm); - let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),