erigon-pulse/p2p
Mark Holt 509a7af26a
Discovery zero refresh timer (#8661)
This fixes an issue where the mumbai testnet node struggle to find
peers. Before this fix in general test peer numbers are typically around
20 in total between eth66, eth67 and eth68. For new peers some can
struggle to find even a single peer after days of operation.

These are the numbers after 12 hours or running on a node which
previously could not find any peers: eth66=13, eth67=76, eth68=91.

The root cause of this issue is the following:

- A significant number of mumbai peers around the boot node return
network ids which are different from those currently available in the
DHT
- The available nodes are all consequently busy and return 'too many
peers' for long periods

These issues case a significant number of discovery timeouts, some of
the queries will never receive a response.

This causes the discovery read loop to enter a channel deadlock - which
means that no responses are processed, nor timeouts fired. This causes
the discovery process in the node to stop. From then on it just
re-requests handshakes from a relatively small number of peers.

This check in fixes this situation with the following changes:

- Remove the deadlock by running the timer in a separate go-routine so
it can run independently of the main request processing.
- Allow the discovery process matcher to match on port if no id match
can be established on initial ping. This allows subsequent node
validation to proceed and if the node proves to be valid via the
remainder of the look-up and handshake process it us used as a valid
peer.
- Completely unsolicited responses, i.e. those which come from a
completely unknown ip:port combination continue to be ignored.
-
2023-11-07 08:48:58 +00:00
..
discover Discovery zero refresh timer (#8661) 2023-11-07 08:48:58 +00:00
dnsdisc Sentinel refactor (#8296) 2023-10-22 01:17:18 +02:00
enode Sentinel refactor (#8296) 2023-10-22 01:17:18 +02: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 Sentinel refactor (#8296) 2023-10-22 01:17:18 +02:00
sentry p2p: silkworm sentry (#8527) 2023-11-02 08:35:13 +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 Discovery zero refresh timer (#8661) 2023-11-07 08:48:58 +00: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 Sentinel refactor (#8296) 2023-10-22 01:17:18 +02:00
node_key_config.go go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
peer_error.go p2p: limit ping requests from a single peer (#8113) 2023-09-06 17:56:03 +02:00
peer_test.go Discovery zero refresh timer (#8661) 2023-11-07 08:48:58 +00:00
peer.go Discovery zero refresh timer (#8661) 2023-11-07 08:48:58 +00: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 Discovery zero refresh timer (#8661) 2023-11-07 08:48:58 +00:00
transport_test.go moved metrics sub packages types to metrics (#8119) 2023-09-03 08:09:27 +07:00
transport.go Sentinel refactor (#8296) 2023-10-22 01:17:18 +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