diff --git a/crates/topos-p2p/src/behaviour/grpc/event.rs b/crates/topos-p2p/src/behaviour/grpc/event.rs index 8d9c5c478..4c9b72523 100644 --- a/crates/topos-p2p/src/behaviour/grpc/event.rs +++ b/crates/topos-p2p/src/behaviour/grpc/event.rs @@ -3,7 +3,6 @@ use tonic::transport::Channel; use super::{OutboundError, RequestId}; -#[allow(unused)] #[derive(Debug)] pub enum Event { OutboundFailure { diff --git a/crates/topos-p2p/src/runtime/handle_event/grpc.rs b/crates/topos-p2p/src/runtime/handle_event/grpc.rs index a17c83a6a..bb275a14f 100644 --- a/crates/topos-p2p/src/runtime/handle_event/grpc.rs +++ b/crates/topos-p2p/src/runtime/handle_event/grpc.rs @@ -1,10 +1,52 @@ +use tracing::debug; + use crate::{behaviour::grpc, Runtime}; use super::{EventHandler, EventResult}; #[async_trait::async_trait] impl EventHandler for Runtime { - async fn handle(&mut self, _event: grpc::Event) -> EventResult { + async fn handle(&mut self, event: grpc::Event) -> EventResult { + match event { + grpc::Event::OutboundFailure { + peer_id, + request_id, + error, + } => { + debug!( + "Outbound connection failure to peer {} for request {}: {}", + peer_id, request_id, error + ); + } + grpc::Event::OutboundSuccess { + peer_id, + request_id, + .. + } => { + debug!( + "Outbound connection success to peer {} for request {}", + peer_id, request_id + ); + } + grpc::Event::InboundNegotiatedConnection { + request_id, + connection_id, + } => { + debug!( + "Inbound connection negotiated for request {} with connection {}", + request_id, connection_id + ); + } + grpc::Event::OutboundNegotiatedConnection { + peer_id, + request_id, + } => { + debug!( + "Outbound connection negotiated to peer {} for request {}", + peer_id, request_id + ); + } + } Ok(()) } }