@@ -30,7 +30,10 @@ use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
30
30
// Substrate Imports
31
31
use frame_benchmarking_cli:: SUBSTRATE_REFERENCE_HARDWARE ;
32
32
use sc_consensus:: { ImportQueue , LongestChain } ;
33
- use sc_executor:: NativeElseWasmExecutor ;
33
+ use sc_executor:: {
34
+ HeapAllocStrategy , NativeElseWasmExecutor , WasmExecutor , DEFAULT_HEAP_ALLOC_STRATEGY ,
35
+ } ;
36
+
34
37
use sc_network:: { NetworkBlock , NetworkService } ;
35
38
use sc_network_sync:: SyncingService ;
36
39
use sc_service:: { Configuration , PartialComponents , TFullBackend , TFullClient , TaskManager } ;
@@ -124,12 +127,19 @@ pub fn new_partial(
124
127
} )
125
128
. transpose ( ) ?;
126
129
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) ;
133
143
134
144
let ( client, backend, keystore_container, task_manager) =
135
145
sc_service:: new_full_parts :: < Block , RuntimeApi , _ > (
0 commit comments