Skip to content

Commit 7073242

Browse files
authored
Suppress RPC Error disconnect log (#5802)
* Suppress RPC Error disconnect log
1 parent 61b29fa commit 7073242

File tree

1 file changed

+10
-3
lines changed
  • beacon_node/lighthouse_network/src/service

1 file changed

+10
-3
lines changed

beacon_node/lighthouse_network/src/service/mod.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,14 +1383,21 @@ impl<AppReqId: ReqId, E: EthSpec> Network<AppReqId, E> {
13831383
// Silencing this event breaks the API contract with RPC where every request ends with
13841384
// - A stream termination event, or
13851385
// - An RPCError event
1386-
if !matches!(event.event, HandlerEvent::Err(HandlerErr::Outbound { .. })) {
1386+
return if let HandlerEvent::Err(HandlerErr::Outbound {
1387+
id: RequestId::Application(id),
1388+
error,
1389+
..
1390+
}) = event.event
1391+
{
1392+
Some(NetworkEvent::RPCFailed { peer_id, id, error })
1393+
} else {
13871394
debug!(
13881395
self.log,
13891396
"Ignoring rpc message of disconnecting peer";
13901397
event
13911398
);
1392-
return None;
1393-
}
1399+
None
1400+
};
13941401
}
13951402

13961403
let handler_id = event.conn_id;

0 commit comments

Comments
 (0)