@@ -562,6 +562,7 @@ impl PrometheusMetrics for SyncProtocolHandler {
562562
563563impl NetworkProtocolHandler for SyncProtocolHandler {
564564 fn initialize ( & self , io : & dyn NetworkContext ) {
565+ trace ! ( target: "sync" , "Initializing sync protocol handler for subprotocol: {}" , io. subprotocol_name( ) ) ;
565566 if io. subprotocol_name ( ) != PAR_PROTOCOL {
566567 io. register_timer ( PEERS_TIMER , Duration :: from_millis ( 700 ) )
567568 . expect ( "Error registering peers timer" ) ;
@@ -595,7 +596,7 @@ impl NetworkProtocolHandler for SyncProtocolHandler {
595596 trace_time ! ( "sync::connected" ) ;
596597 let node_id = io. session_info ( * peer) . unwrap ( ) . id ;
597598 if io. is_reserved_peer ( * peer) {
598- trace ! ( target: "sync" , "Connected to reserved peer {:?}" , node_id ) ;
599+ trace ! ( target: "sync" , "Connected to reserved peer {node_id :?} {peer}" ) ;
599600 }
600601 // If warp protocol is supported only allow warp handshake
601602 let warp_protocol = io. protocol_version ( PAR_PROTOCOL , * peer) . unwrap_or ( 0 ) != 0 ;
@@ -611,7 +612,7 @@ impl NetworkProtocolHandler for SyncProtocolHandler {
611612 fn disconnected ( & self , io : & dyn NetworkContext , peer : & PeerId ) {
612613 trace_time ! ( "sync::disconnected" ) ;
613614 if io. is_reserved_peer ( * peer) {
614- warn ! ( target: "sync" , "Disconnected from reserved peer peerID: {} {} " , peer, io. session_info( * peer) . expect( "" ) . id. map_or( "" . to_string( ) , |f| format!( "{:?}" , f) ) ) ;
615+ warn ! ( target: "sync" , "Disconnected from reserved peer peerID: {} protocol: {} peer: {} " , peer , io . subprotocol_name ( ) , io. session_info( * peer) . expect( "" ) . id. map_or( "" . to_string( ) , |f| format!( "{:?}" , f) ) ) ;
615616 }
616617 if io. subprotocol_name ( ) != PAR_PROTOCOL {
617618 self . sync . write ( ) . on_peer_aborting (
@@ -623,6 +624,10 @@ impl NetworkProtocolHandler for SyncProtocolHandler {
623624
624625 fn timeout ( & self , nc : & dyn NetworkContext , timer : TimerToken ) {
625626 trace_time ! ( "sync::timeout" ) ;
627+
628+ trace ! ( target: "sync" , "Timer {} triggered." , timer) ;
629+ // timer 2:
630+ // Timer 0 triggered.
626631 let mut io = NetSyncIo :: new ( nc, & * self . chain , & * self . snapshot_service , & self . overlay ) ;
627632 match timer {
628633 PEERS_TIMER => self . sync . write ( ) . maintain_peers ( & mut io) ,
0 commit comments