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

reduce log level on unexpected errors in network #5822

Merged
merged 1 commit into from
Jan 24, 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
14 changes: 7 additions & 7 deletions beacon_chain/networking/eth2_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ proc openStream(node: Eth2Node,
raise exc
except CatchableError as exc:
# TODO remove once libp2p supports `raises`
warn "Unknown error when opening stream", exc = exc.msg
debug "Unexpected error when opening stream", exc = exc.msg
neterr UnknownError

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

proc sendResponseChunkBytesSZ(
Expand Down Expand Up @@ -860,7 +860,7 @@ proc readVarint2(conn: Connection): Future[NetRes[uint64]] {.
except CancelledError as exc:
raise exc
except CatchableError as exc:
warn "Unexpected error", exc = exc.msg
debug "Unexpected error", exc = exc.msg
neterr UnknownError

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

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

proc toPeerAddr*(r: enr.TypedRecord,
Expand Down Expand Up @@ -1695,7 +1695,7 @@ proc onConnEvent(
except CancelledError as exc:
raise exc
except CatchableError as exc:
warn "Unexpected error while disconnecting peer", exc = exc.msg
debug "Unexpected error while disconnecting peer", exc = exc.msg
return
of None:
# We have established a connection with the new peer.
Expand Down Expand Up @@ -2456,7 +2456,7 @@ proc broadcast(node: Eth2Node, topic: string, msg: seq[byte]):
except CancelledError as exc:
raise exc
except CatchableError as exc:
warn "Unknown error during broadcast", exc = exc.msg
debug "Unexpected error during broadcast", exc = exc.msg
return err("Broadcast failed")

# TODO remove workaround for sync committee BN/VC log spam
Expand Down
Loading