erigon-pulse/p2p
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
..
discover Bor span testing (#7897) 2023-07-18 09:47:04 +01:00
dnsdisc dnsdisc: backport geth latest version and fixes for go1.20 (#6925) 2023-02-22 08:29:34 +00:00
enode move mdbx to new org (#8061) 2023-08-24 18:00:24 +07:00
enr go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
nat [devnet] separate logging p2p (#7549) 2023-05-19 23:08:45 +01:00
netutil Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
rlpx Enable gocritic linter (#5173) 2022-08-25 09:08:56 +07:00
simulations p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
dial_integration_test.go Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
dial_test.go move all packages from "internal" folder - to simplify users live (#5857) 2022-10-25 09:58:25 +07:00
dial.go Enable gosec linter (#5083) 2022-08-17 12:18:19 +07:00
message_test.go p2p: move rlpx into separate package (#21464) 2020-10-06 14:12:09 +02:00
message.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
metrics.go Heimdall metrics + Metrics HTTP server rationalization (#8094) 2023-08-31 09:04:27 +01:00
node_key_config.go go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
peer_error.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
peer_test.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
peer.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
protocol.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
server_test.go [devnet] separate logging - p2p (#7547) 2023-05-19 18:41:53 +01:00
server.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
transport_test.go p2p: refactor peer errors to propagate with a DiscReason (#8089) 2023-08-31 16:45:23 +01:00
transport.go p2p: fix RLPx disconnect message decoding (#8056) 2023-08-24 13:49:19 +02:00
util_test.go rename (#1978) 2021-05-20 19:25:53 +01:00
util.go Avoiding leaking the popped item (#6193) 2022-12-04 11:17:02 +07:00