From 4e34486e6878e6fb59b14888963c0b7939f57d6a Mon Sep 17 00:00:00 2001 From: girazoki Date: Thu, 2 May 2024 16:33:23 +0200 Subject: [PATCH 1/4] deprecate at least in container-chain nodes, native executor --- container-chains/nodes/frontier/src/service.rs | 2 +- container-chains/nodes/simple/src/service.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/container-chains/nodes/frontier/src/service.rs b/container-chains/nodes/frontier/src/service.rs index d8dea4196..8780e38b8 100644 --- a/container-chains/nodes/frontier/src/service.rs +++ b/container-chains/nodes/frontier/src/service.rs @@ -45,7 +45,7 @@ use { }, }; -type ParachainExecutor = NativeElseWasmExecutor; +type ParachainExecutor = WasmExecytor; type ParachainClient = TFullClient; type ParachainBackend = TFullBackend; type ParachainBlockImport = TParachainBlockImport< diff --git a/container-chains/nodes/simple/src/service.rs b/container-chains/nodes/simple/src/service.rs index b39a44fe8..2f980541b 100644 --- a/container-chains/nodes/simple/src/service.rs +++ b/container-chains/nodes/simple/src/service.rs @@ -31,7 +31,7 @@ use { parity_scale_codec::Encode, polkadot_parachain_primitives::primitives::HeadData, sc_consensus::BasicQueue, - sc_executor::NativeElseWasmExecutor, + sc_executor::WasmExecutor, sc_service::{Configuration, TFullBackend, TFullClient, TaskManager}, sp_blockchain::HeaderBackend, sp_consensus_slots::{Slot, SlotDuration}, @@ -55,7 +55,7 @@ impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor { } } -type ParachainExecutor = NativeElseWasmExecutor; +type ParachainExecutor = WasmExecutor; type ParachainClient = TFullClient; type ParachainBackend = TFullBackend; type ParachainBlockImport = TParachainBlockImport, ParachainBackend>; From 6c41bde03500fb2de05564dcd2a06b7e2d63ec13 Mon Sep 17 00:00:00 2001 From: girazoki Date: Thu, 2 May 2024 16:47:14 +0200 Subject: [PATCH 2/4] make it compile --- container-chains/nodes/frontier/src/service.rs | 5 ++--- container-chains/nodes/simple/src/service.rs | 17 +---------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/container-chains/nodes/frontier/src/service.rs b/container-chains/nodes/frontier/src/service.rs index 8780e38b8..f28ac64b9 100644 --- a/container-chains/nodes/frontier/src/service.rs +++ b/container-chains/nodes/frontier/src/service.rs @@ -18,7 +18,6 @@ #[allow(deprecated)] use { - crate::client::TemplateRuntimeExecutor, container_chain_template_frontier_runtime::{opaque::Block, RuntimeApi}, cumulus_client_cli::CollatorOptions, cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport, @@ -33,7 +32,7 @@ use { parity_scale_codec::Encode, polkadot_parachain_primitives::primitives::HeadData, sc_consensus::BasicQueue, - sc_executor::NativeElseWasmExecutor, + sc_executor::WasmExecutor, sc_service::{Configuration, TFullBackend, TFullClient, TaskManager}, sp_blockchain::HeaderBackend, sp_consensus_slots::{Slot, SlotDuration}, @@ -45,7 +44,7 @@ use { }, }; -type ParachainExecutor = WasmExecytor; +type ParachainExecutor = WasmExecutor; type ParachainClient = TFullClient; type ParachainBackend = TFullBackend; type ParachainBlockImport = TParachainBlockImport< diff --git a/container-chains/nodes/simple/src/service.rs b/container-chains/nodes/simple/src/service.rs index 2f980541b..c6ba66edb 100644 --- a/container-chains/nodes/simple/src/service.rs +++ b/container-chains/nodes/simple/src/service.rs @@ -40,22 +40,7 @@ use { std::{sync::Arc, time::Duration}, }; -/// 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> { - container_chain_template_simple_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - container_chain_template_simple_runtime::native_version() - } -} - -type ParachainExecutor = WasmExecutor; +type ParachainExecutor = WasmExecutor; type ParachainClient = TFullClient; type ParachainBackend = TFullBackend; type ParachainBlockImport = TParachainBlockImport, ParachainBackend>; From 18f4ffa202ed745f6e11dcef46ee6b2bbd620a0e Mon Sep 17 00:00:00 2001 From: girazoki Date: Thu, 2 May 2024 17:21:19 +0200 Subject: [PATCH 3/4] remove leftovers --- container-chains/nodes/frontier/src/client.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/container-chains/nodes/frontier/src/client.rs b/container-chains/nodes/frontier/src/client.rs index 1d9ca9fd1..959377759 100644 --- a/container-chains/nodes/frontier/src/client.rs +++ b/container-chains/nodes/frontier/src/client.rs @@ -31,19 +31,6 @@ pub type HostFunctions = frame_benchmarking::benchmarking::HostFunctions; #[cfg(not(feature = "runtime-benchmarks"))] pub type HostFunctions = (); -pub struct TemplateRuntimeExecutor; -impl NativeExecutionDispatch for TemplateRuntimeExecutor { - type ExtendHostFunctions = HostFunctions; - - fn dispatch(method: &str, data: &[u8]) -> Option> { - container_chain_template_frontier_runtime::api::dispatch(method, data) - } - - fn native_version() -> NativeVersion { - container_chain_template_frontier_runtime::native_version() - } -} - /// A set of APIs that every runtimes must implement. pub trait BaseRuntimeApiCollection: sp_api::ApiExt From 9a0ac9969afd714fbf562b520e22db04f4a5c693 Mon Sep 17 00:00:00 2001 From: girazoki Date: Thu, 2 May 2024 17:26:38 +0200 Subject: [PATCH 4/4] leftovers agin --- container-chains/nodes/frontier/src/client.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/container-chains/nodes/frontier/src/client.rs b/container-chains/nodes/frontier/src/client.rs index 959377759..49b3c41f9 100644 --- a/container-chains/nodes/frontier/src/client.rs +++ b/container-chains/nodes/frontier/src/client.rs @@ -15,22 +15,12 @@ // along with Tanssi. If not, see . // Substrate -use { - sc_executor::{NativeExecutionDispatch, NativeVersion}, - sp_consensus_aura::sr25519::AuthorityId as AuraId, -}; +use sp_consensus_aura::sr25519::AuthorityId as AuraId; // Local use container_chain_template_frontier_runtime::{opaque::Block, AccountId, Index}; use crate::eth::EthCompatRuntimeApiCollection; -/// Only enable the benchmarking host functions when we actually want to benchmark. -#[cfg(feature = "runtime-benchmarks")] -pub type HostFunctions = frame_benchmarking::benchmarking::HostFunctions; -/// Otherwise we use empty host functions for ext host functions. -#[cfg(not(feature = "runtime-benchmarks"))] -pub type HostFunctions = (); - /// A set of APIs that every runtimes must implement. pub trait BaseRuntimeApiCollection: sp_api::ApiExt