1
0
Fork 0
forked from forks/go-ethereum
go-ethereum-modded-tocallarg/p2p
Csaba Kiraly 6928ec5d92
p2p: fix dial metrics not picking up the right error (#31621)
Our metrics related to dial errors were off. The original error was not
wrapped, so the caller function had no chance of picking it up.
Therefore the most common error, which is "TooManyPeers", was not
correctly counted.

The metrics were originally introduced in
https://github.com/ethereum/go-ethereum/pull/27621

I was thinking of various possible solutions.
- the one proposed here wraps both the new error and the origial error.
It is not a pattern we use in other parts of the code, but works. This
is maybe the smallest possible change.
- as an alternate, I could write a proper `errProtoHandshakeError` with
it's own wrapped error
- finally, I'm not even sure we need `errProtoHandshakeError`, maybe we
could just pass up the original error.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-15 20:40:30 +02:00
..
discover p2p/discover: pass node instead of node ID to TALKREQ handler (#31075) 2025-04-02 14:56:21 +02:00
dnsdisc eth: report error from setupDiscovery at startup (#31233) 2025-02-23 17:38:32 +01:00
enode p2p: DNS resolution for static nodes (#30822) 2024-12-13 12:46:12 +01:00
enr p2p/enode: add quic ENR entry (#30283) 2024-09-13 23:47:18 +02:00
msgrate log: remove lazy, remove unused interfaces, unexport methods (#28622) 2023-12-05 11:54:44 +01:00
nat p2p/nat: fix UPnP port reset (#31566) 2025-04-09 11:28:29 +02:00
netutil all: drop x/exp direct dependency (#30558) 2025-02-27 15:53:52 +01:00
pipes all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
rlpx p2p/simulations: remove packages (#30250) 2024-08-12 10:36:48 +02:00
tracker metrics, cmd/geth: change init-process of metrics (#30814) 2024-12-10 13:27:29 +01:00
config.go p2p: fix marshaling of NAT in TOML (#31192) 2025-02-17 09:47:12 +01:00
config_toml.go p2p: support configuring NAT in TOML file (#31041) 2025-01-22 09:29:34 +01:00
dial.go p2p: DNS resolution for static nodes (#30822) 2024-12-13 12:46:12 +01:00
dial_test.go p2p: DNS resolution for static nodes (#30822) 2024-12-13 12:46:12 +01:00
message.go p2p: use atomic types (#27764) 2023-08-01 23:20:52 +02:00
message_test.go p2p: move rlpx into separate package (#21464) 2020-09-22 10:17:39 +02:00
metrics.go p2p: fix dial metrics not picking up the right error (#31621) 2025-04-15 20:40:30 +02:00
peer.go eth: add logic to drop peers randomly when saturated (#31476) 2025-04-14 12:45:27 +02:00
peer_error.go p2p: fix DiscReason encoding/decoding (#30855) 2024-12-12 12:33:42 +01:00
peer_test.go p2p: DNS resolution for static nodes (#30822) 2024-12-13 12:46:12 +01:00
protocol.go all: use cmp.Compare (#30958) 2025-01-02 14:06:47 +01:00
server.go p2p: fix dial metrics not picking up the right error (#31621) 2025-04-15 20:40:30 +02:00
server_nat.go p2p/nat: fix UPnP port reset (#31566) 2025-04-09 11:28:29 +02:00
server_nat_test.go p2p: fix flaky test TestServerPortMapping (#30241) 2024-07-30 07:31:27 -06:00
server_test.go p2p: fix dial metrics not picking up the right error (#31621) 2025-04-15 20:40:30 +02:00
transport.go p2p: fix DiscReason encoding/decoding (#30855) 2024-12-12 12:33:42 +01:00
transport_test.go p2p: fix DiscReason encoding/decoding (#30855) 2024-12-12 12:33:42 +01:00
util.go all: assign zero after resize in implementations of heap.Interface (#26296) 2022-12-05 13:49:54 +01:00
util_test.go p2p: new dial scheduler (#20592) 2020-02-13 11:10:03 +01:00