@@ -517,8 +517,13 @@ where
517517 {
518518 debug ! ( "Accepting redundant notification for new message" ) ;
519519 }
520- if let Err ( e) =
521- Self :: find_received_certificates_from_validator ( this. clone ( ) , name, node) . await
520+ if let Err ( e) = Self :: find_received_certificates_from_validator (
521+ this. clone ( ) ,
522+ name,
523+ node,
524+ local_node. clone ( ) ,
525+ )
526+ . await
522527 {
523528 error ! ( "Fail to process notification: {e}" ) ;
524529 }
@@ -852,6 +857,7 @@ where
852857 committees : BTreeMap < Epoch , Committee > ,
853858 max_epoch : Epoch ,
854859 mut node : A ,
860+ mut node_client : LocalNodeClient < S > ,
855861 ) -> Result < ( ValidatorName , u64 , Vec < Certificate > ) , NodeError >
856862 where
857863 A : ValidatorNode + Send + Sync + ' static + Clone ,
@@ -866,6 +872,16 @@ where
866872 for entry in response. info . requested_received_log {
867873 let query = ChainInfoQuery :: new ( entry. chain_id )
868874 . with_sent_certificates_in_range ( BlockHeightRange :: single ( entry. height ) ) ;
875+ let local_response = node_client
876+ . handle_chain_info_query ( query. clone ( ) )
877+ . await
878+ . map_err ( |error| NodeError :: LocalNodeQuery {
879+ error : error. to_string ( ) ,
880+ } ) ?;
881+ if !local_response. info . requested_sent_certificates . is_empty ( ) {
882+ new_tracker += 1 ;
883+ continue ;
884+ }
869885
870886 let mut response = node. handle_chain_info_query ( query) . await ?;
871887 let Some ( certificate) = response. info . requested_sent_certificates . pop ( ) else {
@@ -961,6 +977,7 @@ where
961977 self . node_client
962978 . synchronize_chain_state ( nodes. clone ( ) , self . admin_id )
963979 . await ?;
980+ let node_client = self . node_client . clone ( ) ;
964981 // Now we should have a complete view of all committees in the system.
965982 let ( committees, max_epoch) = self . known_committees ( ) . await ?;
966983 // Proceed to downloading received certificates.
@@ -972,8 +989,15 @@ where
972989 |name, node| {
973990 let tracker = * trackers. get ( & name) . unwrap_or ( & 0 ) ;
974991 let committees = committees. clone ( ) ;
992+ let node_client = node_client. clone ( ) ;
975993 Box :: pin ( Self :: synchronize_received_certificates_from_validator (
976- chain_id, name, tracker, committees, max_epoch, node,
994+ chain_id,
995+ name,
996+ tracker,
997+ committees,
998+ max_epoch,
999+ node,
1000+ node_client,
9771001 ) )
9781002 } ,
9791003 )
@@ -1005,6 +1029,7 @@ where
10051029 this : Arc < Mutex < Self > > ,
10061030 name : ValidatorName ,
10071031 node : A ,
1032+ node_client : LocalNodeClient < S > ,
10081033 ) -> Result < ( ) , ChainClientError >
10091034 where
10101035 A : ValidatorNode + Send + Sync + ' static + Clone ,
@@ -1025,6 +1050,7 @@ where
10251050 committees,
10261051 max_epoch,
10271052 node,
1053+ node_client,
10281054 )
10291055 . await ?;
10301056 // Process received certificates. If the client state has changed during the
0 commit comments