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: change net::discv5 log target to discv5 #12045

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
24 changes: 12 additions & 12 deletions crates/net/discv5/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Discv5 {
//
let (enr, bc_enr, fork_key, rlpx_ip_mode) = build_local_enr(sk, &discv5_config);

trace!(target: "net::discv5",
trace!(target: "discv5",
?enr,
"local ENR"
);
Expand Down Expand Up @@ -271,7 +271,7 @@ impl Discv5 {
// to them over RLPx, to be compatible with EL discv5 implementations that don't
// enforce this security measure.

trace!(target: "net::discv5",
trace!(target: "discv5",
?enr,
%socket,
"discovered unverifiable enr, source socket doesn't match socket advertised in ENR"
Expand All @@ -296,7 +296,7 @@ impl Discv5 {
let node_record = match self.try_into_reachable(enr, socket) {
Ok(enr_bc) => enr_bc,
Err(err) => {
trace!(target: "net::discv5",
trace!(target: "discv5",
%err,
?enr,
"discovered peer is unreachable"
Expand All @@ -308,7 +308,7 @@ impl Discv5 {
}
};
if let FilterOutcome::Ignore { reason } = self.filter_discovered_peer(enr) {
trace!(target: "net::discv5",
trace!(target: "discv5",
?enr,
reason,
"filtered out discovered peer"
Expand All @@ -324,7 +324,7 @@ impl Discv5 {
.then(|| self.get_fork_id(enr).ok())
.flatten();

trace!(target: "net::discv5",
trace!(target: "discv5",
?fork_id,
?enr,
"discovered peer"
Expand Down Expand Up @@ -491,7 +491,7 @@ pub async fn bootstrap(
bootstrap_nodes: HashSet<BootNode>,
discv5: &Arc<discv5::Discv5>,
) -> Result<(), Error> {
trace!(target: "net::discv5",
trace!(target: "discv5",
?bootstrap_nodes,
"adding bootstrap nodes .."
);
Expand All @@ -508,7 +508,7 @@ pub async fn bootstrap(
let discv5 = discv5.clone();
enr_requests.push(async move {
if let Err(err) = discv5.request_enr(enode.to_string()).await {
debug!(target: "net::discv5",
debug!(target: "discv5",
?enode,
%err,
"failed adding boot node"
Expand Down Expand Up @@ -545,7 +545,7 @@ pub fn spawn_populate_kbuckets_bg(
for i in (0..bootstrap_lookup_countdown).rev() {
let target = discv5::enr::NodeId::random();

trace!(target: "net::discv5",
trace!(target: "discv5",
%target,
bootstrap_boost_runs_countdown=i,
lookup_interval=format!("{:#?}", pulse_lookup_interval),
Expand All @@ -563,7 +563,7 @@ pub fn spawn_populate_kbuckets_bg(
// selection (ref kademlia)
let target = get_lookup_target(kbucket_index, local_node_id);

trace!(target: "net::discv5",
trace!(target: "discv5",
%target,
lookup_interval=format!("{:#?}", lookup_interval),
"starting periodic lookup query"
Expand Down Expand Up @@ -628,11 +628,11 @@ pub async fn lookup(
);

match discv5.find_node(target).await {
Err(err) => trace!(target: "net::discv5",
Err(err) => trace!(target: "discv5",
%err,
"lookup query failed"
),
Ok(peers) => trace!(target: "net::discv5",
Ok(peers) => trace!(target: "discv5",
target=format!("{:#?}", target),
peers_count=peers.len(),
peers=format!("[{:#}]", peers.iter()
Expand All @@ -645,7 +645,7 @@ pub async fn lookup(
// `Discv5::connected_peers` can be subset of sessions, not all peers make it
// into kbuckets, e.g. incoming sessions from peers with
// unreachable enrs
debug!(target: "net::discv5",
debug!(target: "discv5",
connected_peers=discv5.connected_peers(),
"connected peers in routing table"
);
Expand Down
Loading