@@ -54,7 +54,7 @@ use cumulus_primitives_core::{
5454} ;
5555use cumulus_relay_chain_interface:: { OverseerHandle , RelayChainInterface } ;
5656use futures:: { prelude:: * , FutureExt } ;
57- use polkadot_primitives:: { CollatorPair , UpgradeGoAhead } ;
57+ use polkadot_primitives:: { unchecked_new_approved_peer_id , CollatorPair , UpgradeGoAhead } ;
5858use prometheus_endpoint:: Registry ;
5959use sc_client_api:: { Backend , BlockchainEvents } ;
6060use sc_client_db:: DbHash ;
@@ -63,7 +63,7 @@ use sc_consensus::{
6363 BlockImportParams , DefaultImportQueue , LongestChain ,
6464} ;
6565use sc_consensus_manual_seal:: consensus:: aura:: AuraConsensusDataProvider ;
66- use sc_network:: { config:: FullNetworkConfiguration , NotificationMetrics } ;
66+ use sc_network:: { config:: FullNetworkConfiguration , NotificationMetrics , PeerId } ;
6767use sc_service:: { Configuration , Error , PartialComponents , TaskManager } ;
6868use sc_telemetry:: TelemetryHandle ;
6969use sc_transaction_pool:: TransactionPoolHandle ;
@@ -564,6 +564,7 @@ where
564564 relay_chain_slot_duration : Duration ,
565565 para_id : ParaId ,
566566 collator_key : CollatorPair ,
567+ collator_peer_id : PeerId ,
567568 _overseer_handle : OverseerHandle ,
568569 announce_block : Arc < dyn Fn ( Hash , Option < Vec < u8 > > ) + Send + Sync > ,
569570 backend : Arc < ParachainBackend < Block > > ,
@@ -586,6 +587,7 @@ where
586587 ) ;
587588
588589 let client_for_aura = client. clone ( ) ;
590+ let collator_peer_id = unchecked_new_approved_peer_id ( collator_peer_id. to_bytes ( ) ) ;
589591 let params = SlotBasedParams {
590592 create_inherent_data_providers : move |_, ( ) | async move { Ok ( ( ) ) } ,
591593 block_import,
@@ -598,6 +600,7 @@ where
598600 } ,
599601 keystore,
600602 collator_key,
603+ collator_peer_id,
601604 para_id,
602605 proposer,
603606 collator_service,
@@ -688,20 +691,21 @@ where
688691 relay_chain_slot_duration : Duration ,
689692 para_id : ParaId ,
690693 collator_key : CollatorPair ,
694+ collator_peer_id : PeerId ,
691695 overseer_handle : OverseerHandle ,
692696 announce_block : Arc < dyn Fn ( Hash , Option < Vec < u8 > > ) + Send + Sync > ,
693697 backend : Arc < ParachainBackend < Block > > ,
694698 node_extra_args : NodeExtraArgs ,
695699 _: ( ) ,
696700 ) -> Result < ( ) , Error > {
701+ let collator_peer_id = unchecked_new_approved_peer_id ( collator_peer_id. to_bytes ( ) ) ;
697702 let proposer = sc_basic_authorship:: ProposerFactory :: with_proof_recording (
698703 task_manager. spawn_handle ( ) ,
699704 client. clone ( ) ,
700705 transaction_pool,
701706 prometheus_registry,
702707 telemetry. clone ( ) ,
703708 ) ;
704-
705709 let collator_service = CollatorService :: new (
706710 client. clone ( ) ,
707711 Arc :: new ( task_manager. spawn_handle ( ) ) ,
@@ -725,6 +729,7 @@ where
725729 } ,
726730 keystore,
727731 collator_key,
732+ collator_peer_id,
728733 para_id,
729734 overseer_handle,
730735 relay_chain_slot_duration,
0 commit comments