From da04765e941fd13b254174f46dfd859881edb40c Mon Sep 17 00:00:00 2001 From: Shahak Shama Date: Fri, 12 Jul 2024 12:14:36 +0200 Subject: [PATCH] chore(sync): add p2p sync server logs --- crates/papyrus_network/src/network_manager/mod.rs | 3 --- crates/papyrus_p2p_sync/src/server/mod.rs | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/papyrus_network/src/network_manager/mod.rs b/crates/papyrus_network/src/network_manager/mod.rs index d0b15991da..f18d209585 100644 --- a/crates/papyrus_network/src/network_manager/mod.rs +++ b/crates/papyrus_network/src/network_manager/mod.rs @@ -319,9 +319,6 @@ impl GenericNetworkManager { peer_id: _, protocol_name, } => { - info!( - "Received new inbound query: {query:?} for session id: {inbound_session_id:?}" - ); self.num_active_inbound_sessions += 1; gauge!( papyrus_metrics::PAPYRUS_NUM_ACTIVE_INBOUND_SESSIONS, diff --git a/crates/papyrus_p2p_sync/src/server/mod.rs b/crates/papyrus_p2p_sync/src/server/mod.rs index 5a4bca89be..78f2259d20 100644 --- a/crates/papyrus_p2p_sync/src/server/mod.rs +++ b/crates/papyrus_p2p_sync/src/server/mod.rs @@ -28,7 +28,7 @@ use starknet_api::block::BlockNumber; use starknet_api::core::ClassHash; use starknet_api::state::ThinStateDiff; use starknet_api::transaction::{Event, Transaction, TransactionHash, TransactionOutput}; -use tracing::error; +use tracing::{error, info}; #[cfg(test)] mod test; @@ -204,6 +204,7 @@ where Sender: Sink> + Unpin + Send + 'static, P2PSyncServerError: From<>>::Error>, { + info!("Got a new inbound query {query:?}"); let storage_reader_clone = self.storage_reader.clone(); tokio::task::spawn(async move { let result = send_data_for_query(storage_reader_clone, query.clone(), sender).await; @@ -401,6 +402,7 @@ where { // If this function fails, we still want to send fin before failing. let result = send_data_without_fin_for_query(&storage_reader, query, &mut sender).await; + info!("Sending fin message"); sender.feed(DataOrFin(None)).await?; result } @@ -432,6 +434,7 @@ where let data_vec = Data::fetch_block_data_from_db(block_number, &txn)?; for data in data_vec { // TODO: consider implement retry mechanism. + info!("Sending data"); sender.feed(DataOrFin(Some(data))).await?; } }