@@ -29,7 +29,6 @@ use sc_client_api::BlockchainEvents;
2929use sc_consensus:: ImportQueue ;
3030use sc_executor:: { HeapAllocStrategy , WasmExecutor , DEFAULT_HEAP_ALLOC_STRATEGY } ;
3131use sc_network:: { NetworkBackend , NetworkBlock } ;
32- use sc_network_sync:: SyncingService ;
3332use sc_service:: { Configuration , PartialComponents , TFullBackend , TFullClient , TaskManager } ;
3433use sc_telemetry:: { Telemetry , TelemetryHandle , TelemetryWorker , TelemetryWorkerHandle } ;
3534use sp_keystore:: KeystorePtr ;
@@ -118,17 +117,18 @@ pub fn new_partial(
118117 . transpose ( ) ?;
119118
120119 let heap_pages = config
120+ . executor
121121 . default_heap_pages
122122 . map_or ( DEFAULT_HEAP_ALLOC_STRATEGY , |h| HeapAllocStrategy :: Static {
123123 extra_pages : h as _ ,
124124 } ) ;
125125
126126 let executor = WasmExecutor :: builder ( )
127- . with_execution_method ( config. wasm_method )
127+ . with_execution_method ( config. executor . wasm_method )
128128 . with_onchain_heap_alloc_strategy ( heap_pages)
129129 . with_offchain_heap_alloc_strategy ( heap_pages)
130- . with_max_runtime_instances ( config. max_runtime_instances )
131- . with_runtime_cache_size ( config. runtime_cache_size )
130+ . with_max_runtime_instances ( config. executor . max_runtime_instances )
131+ . with_runtime_cache_size ( config. executor . runtime_cache_size )
132132 . build ( ) ;
133133
134134 let ( client, backend, keystore_container, task_manager) =
@@ -222,12 +222,14 @@ where
222222 . map_err ( |e| sc_service:: Error :: Application ( Box :: new ( e) as Box < _ > ) ) ?;
223223
224224 let validator = parachain_config. role . is_authority ( ) ;
225- let prometheus_registry = parachain_config. prometheus_registry ( ) . cloned ( ) ;
226225 let is_authority = parachain_config. role . is_authority ( ) ;
227226 let transaction_pool = params. transaction_pool . clone ( ) ;
228227 let import_queue_service = params. import_queue . service ( ) ;
229- let net_config =
230- sc_network:: config:: FullNetworkConfiguration :: < _ , _ , N > :: new ( & parachain_config. network ) ;
228+ let prometheus_registry = parachain_config. prometheus_registry ( ) . cloned ( ) ;
229+ let net_config = sc_network:: config:: FullNetworkConfiguration :: < _ , _ , N > :: new (
230+ & parachain_config. network ,
231+ prometheus_registry. clone ( ) ,
232+ ) ;
231233
232234 let ( network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
233235 build_network ( BuildNetworkParams {
@@ -318,13 +320,12 @@ where
318320 let frontier_backend = frontier_backend. clone ( ) ;
319321 let pubsub_notification_sinks = pubsub_notification_sinks. clone ( ) ;
320322
321- Box :: new ( move |deny_unsafe , subscription_task_executor| {
323+ Box :: new ( move |subscription_task_executor| {
322324 let deps = crate :: rpc:: FullDeps {
323325 client : client. clone ( ) ,
324326 pool : transaction_pool. clone ( ) ,
325327 graph : transaction_pool. pool ( ) . clone ( ) ,
326328 sync : sync. clone ( ) ,
327- deny_unsafe,
328329 is_authority,
329330 network : network. clone ( ) ,
330331 backend : frontier_backend. clone ( ) ,
@@ -369,7 +370,7 @@ where
369370 // Here you can check whether the hardware meets your chains' requirements. Putting a link
370371 // in there and swapping out the requirements for your own are probably a good idea. The
371372 // requirements for a para-chain are dictated by its relay-chain.
372- match SUBSTRATE_REFERENCE_HARDWARE . check_hardware ( & hwbench) {
373+ match SUBSTRATE_REFERENCE_HARDWARE . check_hardware ( & hwbench, validator ) {
373374 Err ( err) if validator => {
374375 log:: warn!(
375376 "⚠️ The hardware does not meet the minimal requirements {} for role 'Authority' find out more at:\n \
@@ -487,7 +488,7 @@ fn start_aura_consensus(
487488 task_manager : & TaskManager ,
488489 relay_chain_interface : Arc < dyn RelayChainInterface > ,
489490 transaction_pool : Arc < sc_transaction_pool:: FullPool < Block , ParachainClient > > ,
490- sync_oracle : Arc < SyncingService < Block > > ,
491+ sync_service : Arc < sc_network_sync :: SyncingService < Block > > ,
491492 keystore : KeystorePtr ,
492493 para_id : ParaId ,
493494 collator_key : CollatorPair ,
@@ -511,8 +512,8 @@ fn start_aura_consensus(
511512 . map_err ( |e| sc_service:: Error :: Application ( Box :: new ( e) ) ) ?;
512513
513514 let announce_block = {
514- let sync_service = sync_oracle . clone ( ) ;
515- Arc :: new ( move |hash, data| sync_service . announce_block ( hash, data) )
515+ let sync = sync_service . clone ( ) ;
516+ Arc :: new ( move |hash, data| sync . announce_block ( hash, data) )
516517 } ;
517518
518519 let collator_service = cumulus_client_collator:: service:: CollatorService :: new (
@@ -522,33 +523,31 @@ fn start_aura_consensus(
522523 client. clone ( ) ,
523524 ) ;
524525
525- let fut =
526- aura:: run :: < Block , sp_consensus_aura:: sr25519:: AuthorityPair , _ , _ , _ , _ , _ , _ , _ , _ , _ > (
527- AuraParams {
528- create_inherent_data_providers : move |_, ( ) | async move { Ok ( ( ) ) } ,
529- block_import : block_import. clone ( ) ,
530- para_client : client. clone ( ) ,
531- para_backend : backend. clone ( ) ,
532- relay_client : relay_chain_interface. clone ( ) ,
533- code_hash_provider : move |block_hash| {
534- client
535- . code_at ( block_hash)
536- . ok ( )
537- . map ( |c| ValidationCode :: from ( c) . hash ( ) )
538- } ,
539- sync_oracle : sync_oracle. clone ( ) ,
540- keystore,
541- collator_key,
542- para_id,
543- overseer_handle,
544- relay_chain_slot_duration : Duration :: from_secs ( 6 ) ,
545- proposer : cumulus_client_consensus_proposer:: Proposer :: new ( proposer_factory) ,
546- collator_service,
547- // We got around 500ms for proposing
548- authoring_duration : Duration :: from_millis ( 1500 ) ,
549- reinitialize : false ,
526+ let fut = aura:: run :: < Block , sp_consensus_aura:: sr25519:: AuthorityPair , _ , _ , _ , _ , _ , _ , _ , _ > (
527+ AuraParams {
528+ create_inherent_data_providers : move |_, ( ) | async move { Ok ( ( ) ) } ,
529+ block_import : block_import. clone ( ) ,
530+ para_client : client. clone ( ) ,
531+ para_backend : backend. clone ( ) ,
532+ relay_client : relay_chain_interface. clone ( ) ,
533+ code_hash_provider : move |block_hash| {
534+ client
535+ . code_at ( block_hash)
536+ . ok ( )
537+ . map ( |c| ValidationCode :: from ( c) . hash ( ) )
550538 } ,
551- ) ;
539+ keystore,
540+ collator_key,
541+ para_id,
542+ overseer_handle,
543+ relay_chain_slot_duration : Duration :: from_secs ( 6 ) ,
544+ proposer : cumulus_client_consensus_proposer:: Proposer :: new ( proposer_factory) ,
545+ collator_service,
546+ // We got around 500ms for proposing
547+ authoring_duration : Duration :: from_millis ( 1500 ) ,
548+ reinitialize : false ,
549+ } ,
550+ ) ;
552551
553552 task_manager
554553 . spawn_essential_handle ( )
0 commit comments