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 all: update license information 2016-04-15 09:48:05 +02:00
decode_test.go Replace strings.Replace with strings.ReplaceAll (#5128) 2022-08-21 21:21:09 +07:00
decode.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
doc.go go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
encode_test.go rlp: add support for optional struct fields (#22832) (#3977) 2022-04-26 18:24:23 +07:00
encode.go Use BitLenToByteLen from erigon-lib (#7735) 2023-06-14 14:48:16 +02:00
encoder_example_test.go rlp: improve nil pointer handling (#20064) 2019-09-13 11:10:57 +02:00
iterator_test.go rename (#1978) 2021-05-20 19:25:53 +01:00
iterator.go cmd, core, eth: background transaction indexing (#20302) 2020-05-20 15:26:22 +03:00
raw_test.go Try to solve sentry hanging problem + p2p impovement from geth (#2191) 2021-06-18 12:47:46 +01:00
raw.go Try to solve sentry hanging problem + p2p impovement from geth (#2191) 2021-06-18 12:47:46 +01:00
typecache.go rlp: add support for optional struct fields (#22832) (#3977) 2022-04-26 18:24:23 +07:00