Skip to content

Commit 6cd37f7

Browse files
authored
reduce log level on unexpected errors in network (#5822)
1 parent d08e558 commit 6cd37f7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

beacon_chain/networking/eth2_network.nim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ proc openStream(node: Eth2Node,
352352
raise exc
353353
except CatchableError as exc:
354354
# TODO remove once libp2p supports `raises`
355-
warn "Unknown error when opening stream", exc = exc.msg
355+
debug "Unexpected error when opening stream", exc = exc.msg
356356
neterr UnknownError
357357

358358
proc init(T: type Peer, network: Eth2Node, peerId: PeerId): Peer {.gcsafe.}
@@ -679,7 +679,7 @@ proc sendNotificationMsg(peer: Peer, protocolId: string, requestBytes: seq[byte]
679679
try:
680680
await noCancel stream.close()
681681
except CatchableError as exc:
682-
warn "Unexpected error while closing notification stream",
682+
debug "Unexpected error while closing notification stream",
683683
peer, protocolId, exc = exc.msg
684684

685685
proc sendResponseChunkBytesSZ(
@@ -860,7 +860,7 @@ proc readVarint2(conn: Connection): Future[NetRes[uint64]] {.
860860
except CancelledError as exc:
861861
raise exc
862862
except CatchableError as exc:
863-
warn "Unexpected error", exc = exc.msg
863+
debug "Unexpected error", exc = exc.msg
864864
neterr UnknownError
865865

866866
proc readChunkPayload*(conn: Connection, peer: Peer,
@@ -1002,7 +1002,7 @@ proc makeEth2Request(peer: Peer, protocolId: string, requestBytes: seq[byte],
10021002
try:
10031003
await noCancel stream.closeWithEOF()
10041004
except CatchableError as exc:
1005-
warn "Unexpected error while closing stream",
1005+
debug "Unexpected error while closing stream",
10061006
peer, protocolId, exc = exc.msg
10071007

10081008
proc init*(T: type MultipleChunksResponse, peer: Peer, conn: Connection): T =
@@ -1258,7 +1258,7 @@ proc handleIncomingStream(network: Eth2Node,
12581258
try:
12591259
await noCancel conn.closeWithEOF()
12601260
except CatchableError as exc:
1261-
warn "Unexpected error while closing incoming connection", exc = exc.msg
1261+
debug "Unexpected error while closing incoming connection", exc = exc.msg
12621262
releasePeer(peer)
12631263

12641264
proc toPeerAddr*(r: enr.TypedRecord,
@@ -1695,7 +1695,7 @@ proc onConnEvent(
16951695
except CancelledError as exc:
16961696
raise exc
16971697
except CatchableError as exc:
1698-
warn "Unexpected error while disconnecting peer", exc = exc.msg
1698+
debug "Unexpected error while disconnecting peer", exc = exc.msg
16991699
return
17001700
of None:
17011701
# We have established a connection with the new peer.
@@ -2456,7 +2456,7 @@ proc broadcast(node: Eth2Node, topic: string, msg: seq[byte]):
24562456
except CancelledError as exc:
24572457
raise exc
24582458
except CatchableError as exc:
2459-
warn "Unknown error during broadcast", exc = exc.msg
2459+
debug "Unexpected error during broadcast", exc = exc.msg
24602460
return err("Broadcast failed")
24612461

24622462
# TODO remove workaround for sync committee BN/VC log spam

0 commit comments

Comments
 (0)