Skip to content

Commit

Permalink
try-runtime: Use configured wasm execution method (paritytech#13694)
Browse files Browse the repository at this point in the history
* try-runtime: Use configured wasm execution method

* Fix compilation

(cherry picked from commit d0449fd)
  • Loading branch information
bkchr authored and ekovalev committed Jul 3, 2023
1 parent 8b7d319 commit 6fedf4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/cli/src/arg_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ impl std::fmt::Display for WasmExecutionMethod {
/// into an execution method which can be used internally.
pub fn execution_method_from_cli(
execution_method: WasmExecutionMethod,
_instantiation_strategy: WasmtimeInstantiationStrategy,
instantiation_strategy: WasmtimeInstantiationStrategy,
) -> sc_service::config::WasmExecutionMethod {
match execution_method {
WasmExecutionMethod::Interpreted => sc_service::config::WasmExecutionMethod::Interpreted,
WasmExecutionMethod::Compiled => sc_service::config::WasmExecutionMethod::Compiled {
instantiation_strategy: match _instantiation_strategy {
instantiation_strategy: match instantiation_strategy {
WasmtimeInstantiationStrategy::PoolingCopyOnWrite =>
sc_service::config::WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
WasmtimeInstantiationStrategy::RecreateInstanceCopyOnWrite =>
Expand Down
8 changes: 4 additions & 4 deletions utils/frame/try-runtime/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
//! given the right flag:
//!
//! ```ignore
//!
//! #[cfg(feature = "try-runtime")]
//! fn pre_upgrade() -> Result<Vec<u8>, &'static str> {}
//!
Expand Down Expand Up @@ -365,8 +364,9 @@ use remote_externalities::{
TestExternalities,
};
use sc_cli::{
CliConfiguration, RuntimeVersion, WasmExecutionMethod, WasmtimeInstantiationStrategy,
DEFAULT_WASMTIME_INSTANTIATION_STRATEGY, DEFAULT_WASM_EXECUTION_METHOD,
execution_method_from_cli, CliConfiguration, RuntimeVersion, WasmExecutionMethod,
WasmtimeInstantiationStrategy, DEFAULT_WASMTIME_INSTANTIATION_STRATEGY,
DEFAULT_WASM_EXECUTION_METHOD,
};
use sc_executor::{sp_wasm_interface::HostFunctions, WasmExecutor};
use sp_api::HashT;
Expand Down Expand Up @@ -832,7 +832,7 @@ pub(crate) fn build_executor<H: HostFunctions>(shared: &SharedParams) -> WasmExe
let runtime_cache_size = 2;

WasmExecutor::new(
sc_executor::WasmExecutionMethod::Interpreted,
execution_method_from_cli(shared.wasm_method, shared.wasmtime_instantiation_strategy),
heap_pages,
max_runtime_instances,
None,
Expand Down

0 comments on commit 6fedf4d

Please sign in to comment.