go-ethereum/p2p
Felix Lange 0e093b2c9c
p2p/discover: refactor node and endpoint representation (#29844)
Here we clean up internal uses of type discover.node, converting most code to use
enode.Node instead. The discover.node type used to be the canonical representation of
network hosts before ENR was introduced. Most code worked with *node to avoid conversions
when interacting with Table methods. Since *node also contains internal state of Table and
is a mutable type, using *node outside of Table code is prone to data races. It's also
cleaner not having to wrap/unwrap *enode.Node all the time.

discover.node has been renamed to tableNode to clarify its purpose.

While here, we also change most uses of net.UDPAddr into netip.AddrPort. While this is
technically a separate refactoring from the *node -> *enode.Node change, it is more
convenient because *enode.Node handles IP addresses as netip.Addr. The switch to package
netip in discovery would've happened very soon anyway.

The change to netip.AddrPort stops at certain interface points. For example, since package
p2p/netutil has not been converted to use netip.Addr yet, we still have to convert to
net.IP/net.UDPAddr in a few places.
2024-06-11 15:53:50 +05:30
..
discover p2p/discover: refactor node and endpoint representation (#29844) 2024-06-11 15:53:50 +05:30
dnsdisc merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
enode p2p/enode: fix TCPEndpoint (#29827) 2024-06-11 15:17:53 +05:30
enr p2p/enode: fix endpoint determination for IPv6 (#29801) 2024-06-11 14:51:57 +05:30
msgrate Revert "Merge upstream_merge branch to develop (#1229)" 2024-05-28 14:10:49 +05:30
nat Revert "Merge upstream_merge branch to develop (#1229)" 2024-05-28 14:10:49 +05:30
netutil merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
nodestate merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
rlpx cherry pick to fix lints 2024-05-05 15:47:42 +05:30
simulations Revert "Merge upstream_merge branch to develop (#1229)" 2024-05-28 14:10:49 +05:30
tracker dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
dial.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
dial_test.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
message.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
message_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
metrics.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
peer.go fix tests 2023-09-22 15:03:24 +05:30
peer_error.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
peer_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
protocol.go fix linters 2023-09-21 10:50:01 +05:30
server.go p2p/discover: refactor node and endpoint representation (#29844) 2024-06-11 15:53:50 +05:30
server_nat.go cmd/bootnode, p2p: support for alternate mapped ports (#26359) 2023-07-14 14:58:27 +02:00
server_nat_test.go cmd/bootnode, p2p: support for alternate mapped ports (#26359) 2023-07-14 14:58:27 +02:00
server_test.go merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
transport.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
transport_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
util.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
util_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00