@@ -345,12 +345,12 @@ where
345345 height : BlockHeight ,
346346 error : & NodeError ,
347347 ) -> Result < ( ) , chain_client:: Error > {
348- let validator = & self . remote_node . public_key ;
348+ let validator = & self . remote_node . address ( ) ;
349349 match error {
350350 NodeError :: WrongRound ( validator_round) if * validator_round > round => {
351351 tracing:: debug!(
352- ? validator, %chain_id, %validator_round, %round,
353- "Validator is at a higher round; synchronizing. " ,
352+ validator, %chain_id, %validator_round, %round,
353+ "validator is at a higher round; synchronizing" ,
354354 ) ;
355355 self . client
356356 . synchronize_chain_state_from ( & self . remote_node , chain_id)
@@ -361,20 +361,20 @@ where
361361 found_block_height,
362362 } if expected_block_height > found_block_height => {
363363 tracing:: debug!(
364- ? validator,
364+ validator,
365365 %chain_id,
366366 %expected_block_height,
367367 %found_block_height,
368- "Validator is at a higher height; synchronizing. " ,
368+ "validator is at a higher height; synchronizing" ,
369369 ) ;
370370 self . client
371371 . synchronize_chain_state_from ( & self . remote_node , chain_id)
372372 . await ?;
373373 }
374374 NodeError :: WrongRound ( validator_round) if * validator_round < round => {
375375 tracing:: debug!(
376- ? validator, %chain_id, %validator_round, %round,
377- "Validator is at a lower round; sending chain info. " ,
376+ validator, %chain_id, %validator_round, %round,
377+ "validator is at a lower round; sending chain info" ,
378378 ) ;
379379 self . send_chain_information (
380380 chain_id,
@@ -438,8 +438,9 @@ where
438438 // The proposal is for a different round, so we need to update the validator.
439439 // TODO: this should probably be more specific as to which rounds are retried.
440440 tracing:: debug!(
441- "Wrong round; sending chain {chain_id} to validator {}." ,
442- self . remote_node. public_key
441+ remote_node = self . remote_node. address( ) ,
442+ %chain_id,
443+ "wrong round; sending chain to validator" ,
443444 ) ;
444445 self . send_chain_information (
445446 chain_id,
@@ -455,8 +456,9 @@ where
455456 && found_block_height == proposal. content . block . height =>
456457 {
457458 tracing:: debug!(
458- "Wrong height; sending chain {chain_id} to validator {}." ,
459- self . remote_node. public_key
459+ remote_node = self . remote_node. address( ) ,
460+ %chain_id,
461+ "wrong height; sending chain to validator" ,
460462 ) ;
461463 // The proposal is for a later block height, so we need to update the validator.
462464 self . send_chain_information (
@@ -476,8 +478,9 @@ where
476478 . is_none_or ( |h| * h < height) =>
477479 {
478480 tracing:: debug!(
479- "Missing cross-chain update; sending chain {origin} to validator {}." ,
480- self . remote_node. public_key
481+ remote_node = %self . remote_node. address( ) ,
482+ chain_id = %origin,
483+ "Missing cross-chain update; sending chain to validator." ,
481484 ) ;
482485 sent_cross_chain_updates. insert ( origin, height) ;
483486 // Some received certificates may be missing for this validator
@@ -492,20 +495,18 @@ where
492495 }
493496 Err ( NodeError :: EventsNotFound ( event_ids) ) => {
494497 let mut publisher_heights = BTreeMap :: new ( ) ;
495- let new_chain_ids = event_ids
498+ let chain_ids = event_ids
496499 . iter ( )
497500 . map ( |event_id| event_id. chain_id )
498501 . filter ( |chain_id| !publisher_chain_ids_sent. contains ( chain_id) )
499502 . collect :: < BTreeSet < _ > > ( ) ;
500503 tracing:: debug!(
501- "Missing events; sending chains {new_chain_ids:?} to validator {}" ,
502- self . remote_node. public_key
503- ) ;
504- ensure ! (
505- !new_chain_ids. is_empty( ) ,
506- NodeError :: EventsNotFound ( event_ids)
504+ remote_node = self . remote_node. address( ) ,
505+ ?chain_ids,
506+ "missing events; sending chains to validator" ,
507507 ) ;
508- for chain_id in new_chain_ids {
508+ ensure ! ( !chain_ids. is_empty( ) , NodeError :: EventsNotFound ( event_ids) ) ;
509+ for chain_id in chain_ids {
509510 let height = self
510511 . client
511512 . local_node
@@ -711,32 +712,32 @@ where
711712 . chain ( manager. requested_signed_proposal )
712713 {
713714 if proposal. content . round == manager. current_round {
714- if let Err ( err ) = self . remote_node . handle_block_proposal ( proposal) . await {
715- tracing:: info!( "Failed to send block proposal: {err} ") ;
715+ if let Err ( error ) = self . remote_node . handle_block_proposal ( proposal) . await {
716+ tracing:: info!( %error , "failed to send block proposal") ;
716717 } else {
717718 return Ok ( ( ) ) ;
718719 }
719720 }
720721 }
721722 if let Some ( LockingBlock :: Regular ( validated) ) = manager. requested_locking . map ( |b| * b) {
722723 if validated. round == manager. current_round {
723- if let Err ( err ) = self
724+ if let Err ( error ) = self
724725 . remote_node
725726 . handle_optimized_validated_certificate (
726727 & validated,
727728 CrossChainMessageDelivery :: NonBlocking ,
728729 )
729730 . await
730731 {
731- tracing:: info!( "Failed to send locking block: {err} ") ;
732+ tracing:: info!( %error , "failed to send locking block") ;
732733 } else {
733734 return Ok ( ( ) ) ;
734735 }
735736 }
736737 }
737738 if let Some ( cert) = manager. timeout {
738739 if cert. round >= remote_round {
739- tracing:: debug!( "Sending timeout for {}" , cert. round) ;
740+ tracing:: debug!( round = % cert. round, "sending timeout" ) ;
740741 self . remote_node . handle_timeout_certificate ( * cert) . await ?;
741742 }
742743 }
0 commit comments