@@ -78,8 +78,9 @@ use sc_network::{
7878} ;
7979use sc_service:: {
8080 config:: {
81- BlocksPruning , DatabaseSource , KeystoreConfig , MultiaddrWithPeerId , NetworkConfiguration ,
82- OffchainWorkerConfig , PruningMode , RpcBatchRequestConfig , RpcEndpoint , WasmExecutionMethod ,
81+ BlocksPruning , DatabaseSource , ExecutorConfiguration , KeystoreConfig , MultiaddrWithPeerId ,
82+ NetworkConfiguration , OffchainWorkerConfig , PruningMode , RpcBatchRequestConfig ,
83+ RpcConfiguration , RpcEndpoint , WasmExecutionMethod ,
8384 } ,
8485 BasePath , ChainSpec as ChainSpecService , Configuration , Error as ServiceError ,
8586 PartialComponents , Role , RpcHandlers , TFullBackend , TFullClient , TaskManager ,
@@ -194,15 +195,16 @@ pub fn new_partial(
194195 enable_import_proof_record : bool ,
195196) -> Result < Service , sc_service:: Error > {
196197 let heap_pages = config
198+ . executor
197199 . default_heap_pages
198200 . map_or ( DEFAULT_HEAP_ALLOC_STRATEGY , |h| HeapAllocStrategy :: Static { extra_pages : h as _ } ) ;
199201
200202 let executor = WasmExecutor :: builder ( )
201- . with_execution_method ( config. wasm_method )
203+ . with_execution_method ( config. executor . wasm_method )
202204 . with_onchain_heap_alloc_strategy ( heap_pages)
203205 . with_offchain_heap_alloc_strategy ( heap_pages)
204- . with_max_runtime_instances ( config. max_runtime_instances )
205- . with_runtime_cache_size ( config. runtime_cache_size )
206+ . with_max_runtime_instances ( config. executor . max_runtime_instances )
207+ . with_runtime_cache_size ( config. executor . runtime_cache_size )
206208 . build ( ) ;
207209
208210 let ( client, backend, keystore_container, task_manager) =
@@ -863,38 +865,41 @@ pub fn node_config(
863865 state_pruning : Some ( PruningMode :: ArchiveAll ) ,
864866 blocks_pruning : BlocksPruning :: KeepAll ,
865867 chain_spec : spec,
866- wasm_method : WasmExecutionMethod :: Compiled {
867- instantiation_strategy : sc_executor_wasmtime:: InstantiationStrategy :: PoolingCopyOnWrite ,
868+ executor : ExecutorConfiguration {
869+ wasm_method : WasmExecutionMethod :: Compiled {
870+ instantiation_strategy :
871+ sc_executor_wasmtime:: InstantiationStrategy :: PoolingCopyOnWrite ,
872+ } ,
873+ ..ExecutorConfiguration :: default ( )
874+ } ,
875+ rpc : RpcConfiguration {
876+ addr : None ,
877+ max_connections : Default :: default ( ) ,
878+ cors : None ,
879+ methods : Default :: default ( ) ,
880+ max_request_size : Default :: default ( ) ,
881+ max_response_size : Default :: default ( ) ,
882+ id_provider : None ,
883+ max_subs_per_conn : Default :: default ( ) ,
884+ port : 9945 ,
885+ message_buffer_capacity : Default :: default ( ) ,
886+ batch_config : RpcBatchRequestConfig :: Unlimited ,
887+ rate_limit : None ,
888+ rate_limit_whitelisted_ips : Default :: default ( ) ,
889+ rate_limit_trust_proxy_headers : Default :: default ( ) ,
868890 } ,
869- rpc_addr : None ,
870- rpc_max_connections : Default :: default ( ) ,
871- rpc_cors : None ,
872- rpc_methods : Default :: default ( ) ,
873- rpc_max_request_size : Default :: default ( ) ,
874- rpc_max_response_size : Default :: default ( ) ,
875- rpc_id_provider : None ,
876- rpc_max_subs_per_conn : Default :: default ( ) ,
877- rpc_port : 9945 ,
878- rpc_message_buffer_capacity : Default :: default ( ) ,
879- rpc_batch_config : RpcBatchRequestConfig :: Unlimited ,
880- rpc_rate_limit : None ,
881- rpc_rate_limit_whitelisted_ips : Default :: default ( ) ,
882- rpc_rate_limit_trust_proxy_headers : Default :: default ( ) ,
883891 prometheus_config : None ,
884892 telemetry_endpoints : None ,
885- default_heap_pages : None ,
886893 offchain_worker : OffchainWorkerConfig { enabled : true , indexing_enabled : false } ,
887894 force_authoring : false ,
888895 disable_grandpa : false ,
889896 dev_key_seed : Some ( key_seed) ,
890897 tracing_targets : None ,
891898 tracing_receiver : Default :: default ( ) ,
892- max_runtime_instances : 8 ,
893899 announce_block : true ,
894900 data_path : root,
895901 base_path,
896902 wasm_runtime_overrides : None ,
897- runtime_cache_size : 2 ,
898903 } )
899904}
900905
@@ -1006,19 +1011,19 @@ pub fn run_relay_chain_validator_node(
10061011 ) ;
10071012
10081013 if let Some ( port) = port {
1009- config. rpc_addr = Some ( vec ! [ RpcEndpoint {
1010- batch_config: config. rpc_batch_config ,
1011- cors: config. rpc_cors . clone( ) ,
1014+ config. rpc . addr = Some ( vec ! [ RpcEndpoint {
1015+ batch_config: config. rpc . batch_config ,
1016+ cors: config. rpc . cors . clone( ) ,
10121017 listen_addr: SocketAddr :: V4 ( SocketAddrV4 :: new( Ipv4Addr :: LOCALHOST , port) ) ,
1013- max_connections: config. rpc_max_connections ,
1014- max_payload_in_mb: config. rpc_max_request_size ,
1015- max_payload_out_mb: config. rpc_max_response_size ,
1016- max_subscriptions_per_connection: config. rpc_max_subs_per_conn ,
1017- max_buffer_capacity_per_connection: config. rpc_message_buffer_capacity ,
1018- rpc_methods: config. rpc_methods ,
1019- rate_limit: config. rpc_rate_limit ,
1020- rate_limit_trust_proxy_headers: config. rpc_rate_limit_trust_proxy_headers ,
1021- rate_limit_whitelisted_ips: config. rpc_rate_limit_whitelisted_ips . clone( ) ,
1018+ max_connections: config. rpc . max_connections ,
1019+ max_payload_in_mb: config. rpc . max_request_size ,
1020+ max_payload_out_mb: config. rpc . max_response_size ,
1021+ max_subscriptions_per_connection: config. rpc . max_subs_per_conn ,
1022+ max_buffer_capacity_per_connection: config. rpc . message_buffer_capacity ,
1023+ rpc_methods: config. rpc . methods ,
1024+ rate_limit: config. rpc . rate_limit ,
1025+ rate_limit_trust_proxy_headers: config. rpc . rate_limit_trust_proxy_headers ,
1026+ rate_limit_whitelisted_ips: config. rpc . rate_limit_whitelisted_ips . clone( ) ,
10221027 retry_random_port: true ,
10231028 is_optional: false ,
10241029 } ] ) ;
0 commit comments