Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove some useless logs #1869

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions sn_networking/src/event/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,16 @@ impl SwarmDriver {
if port == our_port {
info!(%address, "external address: new candidate has the same configured port, adding it.");
self.swarm.add_external_address(address);

if tracing::level_enabled!(tracing::Level::TRACE) {
let all_external_addresses =
self.swarm.external_addresses().collect_vec();
let all_listeners = self.swarm.listeners().collect_vec();
trace!("All our listeners: {all_listeners:?}");
trace!(
"All our external addresses: {all_external_addresses:?}"
);
}
} else {
info!(%address, %our_port, "external address: new candidate has a different port, not adding it.");
}
Expand All @@ -577,10 +587,6 @@ impl SwarmDriver {
trace!("external address: listen port not set. This has to be set if you're running a node");
}
}
let all_external_addresses = self.swarm.external_addresses().collect_vec();
let all_listeners = self.swarm.listeners().collect_vec();
trace!("All our listeners: {all_listeners:?}");
trace!("All our external addresses: {all_external_addresses:?}");
}
SwarmEvent::ExternalAddrConfirmed { address } => {
event_string = "ExternalAddrConfirmed";
Expand Down Expand Up @@ -677,7 +683,6 @@ impl SwarmDriver {
shall_removed.len(),
self.live_connected_peers.len()
);
trace!(?self.relay_manager);

for (connection_id, peer_id) in shall_removed {
let _ = self.live_connected_peers.remove(&connection_id);
Expand Down
8 changes: 8 additions & 0 deletions sn_networking/src/relay_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use crate::driver::{BadNodes, NodeBehaviour};
use itertools::Itertools;
use libp2p::{
core::transport::ListenerId, multiaddr::Protocol, Multiaddr, PeerId, StreamProtocol, Swarm,
};
Expand Down Expand Up @@ -205,6 +206,13 @@ impl RelayManager {
peer_id: &PeerId,
swarm: &mut Swarm<NodeBehaviour>,
) {
if tracing::level_enabled!(tracing::Level::TRACE) {
let all_external_addresses = swarm.external_addresses().collect_vec();
let all_listeners = swarm.listeners().collect_vec();
trace!("All our listeners: {all_listeners:?}");
trace!("All our external addresses: {all_external_addresses:?}");
}

match self.waiting_for_reservation.remove(peer_id) {
Some(addr) => {
info!("Successfully made reservation with {peer_id:?} on {addr:?}. Adding the addr to external address.");
Expand Down
Loading