erigon-pulse/rlp
battlmonstr 340b9811b0
p2p: refactor peer errors to propagate with a DiscReason (#8089)
Improve p2p error handling to propagate errors
from the origin up the call chain the Server peer removal code
using a new PeerError type containing a DiscReason and a more detailed
description.

The origin can be tracked down using PeerErrorCode (code) and DiscReason
(reason)
which looks like this in the log:

> [TRACE] [08-28|16:33:40.205] Removing p2p peer peercount=0
url=enode://d399f4b...@1.2.3.4:30303 duration=6.901ms
err="PeerError(code=remote disconnect reason, reason=too many peers,
err=<nil>, message=Peer.run got a remote DiscReason)"
2023-08-31 16:45:23 +01:00
..
decode_tail_test.go
decode_test.go
decode.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
doc.go
encode_test.go
encode.go Use BitLenToByteLen from erigon-lib (#7735) 2023-06-14 14:48:16 +02:00
encoder_example_test.go
iterator_test.go
iterator.go
raw_test.go
raw.go
typecache.go rlp: add support for optional struct fields (#22832) (#3977) 2022-04-26 18:24:23 +07:00