diff --git a/crates/p2p/src/request_response/inbound.rs b/crates/p2p/src/request_response/inbound.rs index 17164c0f..1c77969b 100644 --- a/crates/p2p/src/request_response/inbound.rs +++ b/crates/p2p/src/request_response/inbound.rs @@ -6,6 +6,7 @@ use futures::{AsyncReadExt, AsyncWriteExt, FutureExt}; use libp2p::swarm::Stream; use libp2p::{core::UpgradeInfo, InboundUpgrade}; use ssz_rs::Deserialize; +use tracing::trace; use super::models::{ BoundError, GetMetaData, GoodbyeReason, Ping, PooledUserOpHashesReq, PooledUserOpsByHashReq, @@ -44,7 +45,7 @@ impl InboundUpgrade for InboundContainer { .take(REQUEST_SIZE_MAXIMUM) .read_to_end(&mut data) .await?; - + trace!("Received {} bytes", data.len()); if data.is_empty() { Err(BoundError::IoError(io::Error::new( std::io::ErrorKind::UnexpectedEof, diff --git a/crates/p2p/src/request_response/outbound.rs b/crates/p2p/src/request_response/outbound.rs index 790713b2..2444d664 100644 --- a/crates/p2p/src/request_response/outbound.rs +++ b/crates/p2p/src/request_response/outbound.rs @@ -1,6 +1,7 @@ use futures::{future::BoxFuture, AsyncReadExt, AsyncWriteExt, FutureExt}; use libp2p::{core::UpgradeInfo, OutboundUpgrade, Stream}; use ssz_rs::{Deserialize, Serialize}; +use tracing::{debug, trace}; use super::{ models::{ @@ -23,6 +24,7 @@ impl UpgradeInfo for OutboundContainer { type Info = ProtocolId; type InfoIter = Vec; fn protocol_info(&self) -> Self::InfoIter { + debug!("protocol_info {:?}", self.request); match self.request { Request::Status(_) => vec![ProtocolId::new(Protocol::Status)], Request::GoodbyeReason(_) => vec![ProtocolId::new(Protocol::Goodbye)], @@ -60,6 +62,7 @@ impl OutboundUpgrade for OutboundContainer { } }; let compressed = snap::raw::Encoder::new().compress_vec(&buffer)?; + trace!("Sending {:?} bytes", compressed); socket_mut.write_all(&compressed).await?; socket_mut.close().await?; @@ -69,6 +72,7 @@ impl OutboundUpgrade for OutboundContainer { .read_to_end(&mut comressed_response) .await?; let decompressed = snap::raw::Decoder::new().decompress_vec(&comressed_response)?; + trace!("Received {:?} bytes", decompressed); let response = match info.message_name { Protocol::Status => Response::Status(Status::deserialize(&decompressed)?), Protocol::Goodbye => {