Skip to content

Commit

Permalink
fix(frame-benchmarking-cli): Use heap-pages param
Browse files Browse the repository at this point in the history
  • Loading branch information
ukint-vs committed Mar 16, 2024
1 parent 1c022f9 commit dfa2891
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion substrate/utils/frame/benchmarking-cli/src/pallet/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use frame_support::traits::StorageInfo;
use linked_hash_map::LinkedHashMap;
use sc_cli::{execution_method_from_cli, CliConfiguration, Result, SharedParams};
use sc_client_db::BenchmarkingState;
use sc_executor::WasmExecutor;
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
use sc_service::Configuration;
use serde::Serialize;
use sp_core::{
Expand Down Expand Up @@ -219,12 +219,20 @@ impl PalletCmd {
let method =
execution_method_from_cli(self.wasm_method, self.wasmtime_instantiation_strategy);

let heap_pages =
self.heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |p| HeapAllocStrategy::Static {
extra_pages: p as _,
});

let executor = WasmExecutor::<(
sp_io::SubstrateHostFunctions,
frame_benchmarking::benchmarking::HostFunctions,
ExtraHostFunctions,
)>::builder()
.with_execution_method(method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(2)
.with_runtime_cache_size(2)
.build();
Expand Down

0 comments on commit dfa2891

Please sign in to comment.