Skip to content

Commit 80e507e

Browse files
author
Enddy Dumbrique
committed
updates
1 parent 7ccf00d commit 80e507e

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

node/cli/src/command.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,8 @@ pub fn run() -> Result<()> {
305305
Some(Subcommand::ExportGenesisState(cmd)) => {
306306
let runner = cli.create_runner(cmd)?;
307307
runner.sync_run(|config| {
308-
// REVIEW: from cumulus/parachain-template/node/src/command.rs
309-
// REVIEW: Always set instant_sealing to false
310308
let partials = new_partial(&config, false)?;
311-
//REVIEW: v1.0.0 changed to: client: &impl ExecutorProvider<Block>
309+
312310
cmd.run(&*config.chain_spec, &*partials.client)
313311
})
314312
},

node/service/src/service.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
3030
// Substrate Imports
3131
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
3232
use sc_consensus::{ImportQueue, LongestChain};
33-
use sc_executor::NativeElseWasmExecutor;
33+
use sc_executor::{
34+
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
35+
};
36+
3437
use sc_network::{NetworkBlock, NetworkService};
3538
use sc_network_sync::SyncingService;
3639
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
@@ -124,12 +127,19 @@ pub fn new_partial(
124127
})
125128
.transpose()?;
126129

127-
let executor = ParachainExecutor::new(
128-
config.wasm_method,
129-
config.default_heap_pages,
130-
config.max_runtime_instances,
131-
config.runtime_cache_size,
132-
);
130+
let heap_pages = config
131+
.default_heap_pages
132+
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
133+
134+
let wasm = WasmExecutor::builder()
135+
.with_execution_method(config.wasm_method)
136+
.with_onchain_heap_alloc_strategy(heap_pages)
137+
.with_offchain_heap_alloc_strategy(heap_pages)
138+
.with_max_runtime_instances(config.max_runtime_instances)
139+
.with_runtime_cache_size(config.runtime_cache_size)
140+
.build();
141+
142+
let executor = ParachainExecutor::new_with_wasm_executor(wasm);
133143

134144
let (client, backend, keystore_container, task_manager) =
135145
sc_service::new_full_parts::<Block, RuntimeApi, _>(

0 commit comments

Comments
 (0)