From 1078773241e34e482cce983f1dde3d694ebf8eb9 Mon Sep 17 00:00:00 2001 From: Enddy Dumbrique Date: Wed, 18 Oct 2023 17:23:19 -0700 Subject: [PATCH] updates --- node/service/src/service.rs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/node/service/src/service.rs b/node/service/src/service.rs index f55b8f1813..0079c808d0 100644 --- a/node/service/src/service.rs +++ b/node/service/src/service.rs @@ -30,7 +30,10 @@ use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface}; // Substrate Imports use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE; use sc_consensus::{ImportQueue, LongestChain}; -use sc_executor::NativeElseWasmExecutor; +use sc_executor::{ + HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY, +}; + use sc_network::{NetworkBlock, NetworkService}; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; @@ -124,12 +127,19 @@ pub fn new_partial( }) .transpose()?; - let executor = ParachainExecutor::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, - ); + let heap_pages = config + .default_heap_pages + .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); + + let wasm = WasmExecutor::builder() + .with_execution_method(config.wasm_method) + .with_onchain_heap_alloc_strategy(heap_pages) + .with_offchain_heap_alloc_strategy(heap_pages) + .with_max_runtime_instances(config.max_runtime_instances) + .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::(