@@ -17,7 +17,7 @@ use sp_runtime::traits::HashingFor;
1717
1818use node_subtensor_runtime:: Block ;
1919use sc_cli:: SubstrateCli ;
20- use sc_service:: PartialComponents ;
20+ use sc_service:: { Configuration , PartialComponents } ;
2121
2222impl SubstrateCli for Cli {
2323 fn impl_name ( ) -> String {
@@ -209,8 +209,56 @@ pub fn run() -> sc_cli::Result<()> {
209209 None => {
210210 let runner = cli. create_runner ( & cli. run ) ?;
211211 runner. run_node_until_exit ( |config| async move {
212+ let config = override_default_heap_pages ( config, 60_000 ) ;
212213 service:: new_full ( config) . map_err ( sc_cli:: Error :: Service )
213214 } )
214215 }
215216 }
216217}
218+
219+ /// Override default heap pages
220+ fn override_default_heap_pages ( config : Configuration , pages : u64 ) -> Configuration {
221+ Configuration {
222+ default_heap_pages : Some ( pages) ,
223+ impl_name : config. impl_name ,
224+ impl_version : config. impl_version ,
225+ role : config. role ,
226+ tokio_handle : config. tokio_handle ,
227+ transaction_pool : config. transaction_pool ,
228+ network : config. network ,
229+ keystore : config. keystore ,
230+ database : config. database ,
231+ trie_cache_maximum_size : config. trie_cache_maximum_size ,
232+ state_pruning : config. state_pruning ,
233+ blocks_pruning : config. blocks_pruning ,
234+ chain_spec : config. chain_spec ,
235+ wasm_method : config. wasm_method ,
236+ wasm_runtime_overrides : config. wasm_runtime_overrides ,
237+ rpc_addr : config. rpc_addr ,
238+ rpc_max_connections : config. rpc_max_connections ,
239+ rpc_cors : config. rpc_cors ,
240+ rpc_methods : config. rpc_methods ,
241+ rpc_max_request_size : config. rpc_max_request_size ,
242+ rpc_max_response_size : config. rpc_max_response_size ,
243+ rpc_id_provider : config. rpc_id_provider ,
244+ rpc_max_subs_per_conn : config. rpc_max_subs_per_conn ,
245+ rpc_port : config. rpc_port ,
246+ rpc_message_buffer_capacity : config. rpc_message_buffer_capacity ,
247+ rpc_batch_config : config. rpc_batch_config ,
248+ rpc_rate_limit : config. rpc_rate_limit ,
249+ prometheus_config : config. prometheus_config ,
250+ telemetry_endpoints : config. telemetry_endpoints ,
251+ offchain_worker : config. offchain_worker ,
252+ force_authoring : config. force_authoring ,
253+ disable_grandpa : config. disable_grandpa ,
254+ dev_key_seed : config. dev_key_seed ,
255+ tracing_targets : config. tracing_targets ,
256+ tracing_receiver : config. tracing_receiver ,
257+ max_runtime_instances : config. max_runtime_instances ,
258+ announce_block : config. announce_block ,
259+ data_path : config. data_path ,
260+ base_path : config. base_path ,
261+ informant_output_format : config. informant_output_format ,
262+ runtime_cache_size : config. runtime_cache_size ,
263+ }
264+ }
0 commit comments