@@ -5,7 +5,7 @@ use openmina_core::{bug_condition, fuzzed_maybe, Substate};
55use crate :: connection:: incoming:: { P2pConnectionIncomingAction , P2pConnectionIncomingState } ;
66use crate :: {
77 Data , P2pNetworkConnectionError , P2pNetworkPnetAction , P2pNetworkSchedulerAction ,
8- P2pNetworkSchedulerState , P2pNetworkSelectAction , P2pState , SelectKind ,
8+ P2pNetworkSchedulerState , P2pNetworkSelectAction , P2pState , PeerId , SelectKind ,
99} ;
1010
1111use self :: p2p_network_noise_state:: ResponderConsumeOutput ;
@@ -155,9 +155,13 @@ impl P2pNetworkNoiseState {
155155 if noise_state. expected_peer_id . is_some_and ( |expected_per_id| {
156156 expected_per_id != remote_peer_id
157157 } ) {
158- * state = P2pNetworkNoiseStateInner :: Error ( dbg ! (
159- NoiseError :: RemotePeerIdMismatch
160- ) ) ;
158+ let lhs = noise_state
159+ . expected_peer_id
160+ . map_or ( "none" . to_string ( ) , PeerId :: to_libp2p_string) ;
161+ let rhs = remote_peer_id. to_libp2p_string ( ) ;
162+ * state = P2pNetworkNoiseStateInner :: Error (
163+ NoiseError :: RemotePeerIdMismatch ( format ! ( "{lhs} != {rhs}" ) ) ,
164+ ) ;
161165 } else {
162166 * state = P2pNetworkNoiseStateInner :: Done {
163167 incoming : true ,
@@ -357,8 +361,12 @@ impl P2pNetworkNoiseState {
357361 if noise_state. expected_peer_id . is_some_and ( |expected_per_id| {
358362 expected_per_id != remote_peer_id
359363 } ) {
364+ let lhs = noise_state
365+ . expected_peer_id
366+ . map_or ( "none" . to_string ( ) , PeerId :: to_libp2p_string) ;
367+ let rhs = remote_peer_id. to_libp2p_string ( ) ;
360368 * state = P2pNetworkNoiseStateInner :: Error (
361- NoiseError :: RemotePeerIdMismatch ,
369+ NoiseError :: RemotePeerIdMismatch ( format ! ( "{lhs} != {rhs}" ) ) ,
362370 ) ;
363371 } else {
364372 * state = P2pNetworkNoiseStateInner :: Done {
0 commit comments