@@ -324,7 +324,7 @@ impl Service {
324
324
ip_mode,
325
325
} ;
326
326
327
- info ! ( "Discv5 Service started" ) ;
327
+ info ! ( mode = ?service . ip_mode , "Discv5 Service started" ) ;
328
328
service. start ( ) . await ;
329
329
} ) ) ;
330
330
@@ -333,7 +333,6 @@ impl Service {
333
333
334
334
/// The main execution loop of the discv5 serviced.
335
335
async fn start ( & mut self ) {
336
- info ! ( "{:?}" , self . ip_mode) ;
337
336
loop {
338
337
tokio:: select! {
339
338
_ = & mut self . exit => {
@@ -722,10 +721,9 @@ impl Service {
722
721
723
722
if nodes. len ( ) < before_len {
724
723
// Peer sent invalid ENRs. Blacklist the Node
725
- warn ! (
726
- "Peer sent invalid ENR. Blacklisting {}" ,
727
- active_request. contact
728
- ) ;
724
+ let node_id = active_request. contact . node_id ( ) ;
725
+ let addr = active_request. contact . socket_addr ( ) ;
726
+ warn ! ( %node_id, %addr, "ENRs received of unsolicited distances. Blacklisting" ) ;
729
727
let ban_timeout = self . config . ban_duration . map ( |v| Instant :: now ( ) + v) ;
730
728
PERMIT_BAN_LIST . write ( ) . ban ( node_address, ban_timeout) ;
731
729
}
@@ -1449,13 +1447,14 @@ impl Service {
1449
1447
match active_request. request_body {
1450
1448
// if a failed FindNodes request, ensure we haven't partially received packets. If
1451
1449
// so, process the partially found nodes
1452
- RequestBody :: FindNode { .. } => {
1450
+ RequestBody :: FindNode { ref distances } => {
1453
1451
if let Some ( nodes_response) = self . active_nodes_responses . remove ( & id) {
1454
1452
if !nodes_response. received_nodes . is_empty ( ) {
1455
- warn ! (
1456
- "NODES Response failed, but was partially processed from: {}" ,
1457
- active_request. contact
1458
- ) ;
1453
+ let node_id = active_request. contact . node_id ( ) ;
1454
+ let addr = active_request. contact . socket_addr ( ) ;
1455
+ let received = nodes_response. received_nodes . len ( ) ;
1456
+ let expected = distances. len ( ) ;
1457
+ warn ! ( %node_id, %addr, %error, %received, %expected, "FINDNODE request failed with partial results" ) ;
1459
1458
// if it's a query mark it as success, to process the partial
1460
1459
// collection of peers
1461
1460
self . discovered (
@@ -1529,10 +1528,8 @@ impl Service {
1529
1528
let request_body = query. target ( ) . rpc_request ( return_peer) ;
1530
1529
Poll :: Ready ( QueryEvent :: Waiting ( query. id ( ) , node_id, request_body) )
1531
1530
}
1532
- QueryPoolState :: Timeout ( query) => {
1533
- warn ! ( "Query id: {:?} timed out" , query. id( ) ) ;
1534
- Poll :: Ready ( QueryEvent :: TimedOut ( Box :: new ( query) ) )
1535
- }
1531
+
1532
+ QueryPoolState :: Timeout ( query) => Poll :: Ready ( QueryEvent :: TimedOut ( Box :: new ( query) ) ) ,
1536
1533
QueryPoolState :: Waiting ( None ) | QueryPoolState :: Idle => Poll :: Pending ,
1537
1534
} )
1538
1535
. await
0 commit comments