feat(l1): decouple discv4 address from RLPx address#6375
feat(l1): decouple discv4 address from RLPx address#6375azteca1998 wants to merge 3 commits intofeat/p2p-bind-vs-external-addrfrom
Conversation
🤖 Kimi Code ReviewReview SummaryThe PR adds support for running discovery (UDP) on a different address/interface than RLPx (TCP), which is a useful feature for complex network setups. The implementation is generally solid, but there are a few issues to address. Issues Found1. Critical: Inconsistent Node Creation in Network Module (
|
Lines of code reportTotal lines added: Detailed view |
🤖 Codex Code Review
I could not run tests in this environment because Automated review by OpenAI Codex · custom prompt |
🤖 Claude Code ReviewHere is the review: PR Review: feat(p2p): decouple discv4 address from RLPx addressOverall: The structural change is clean and well-reasoned. The IPv6 ENR key fix ( Bug: ENR pair ordering regression in
|
Extend NetworkConfig to hold separate discovery (UDP) and RLPx (TCP) bind/external addresses, add --discovery.addr CLI flag, wire discv4 and discv5 servers to use discovery_external_addr, and implement tcp6/udp6 ENR fields with proper IPv6 encoding in NodeRecord::from_node().
52993c0 to
a9bce4d
Compare
Closes #5424
Summary
NetworkConfigwith four address fields instead of two:discovery_bind_addr,discovery_external_addr,rlpx_bind_addr,rlpx_external_addr--discovery.addrCLI flag (env:ETHREX_P2P_DISCOVERY_ADDR) to bind the UDP discovery socket independently of the RLPx TCP socketdiscv4anddiscv5servers now receive adiscovery_local_nodebuilt fromdiscovery_external_addr, so their Pingfromendpoints advertise the correct addresstcp6/udp6ENR field parsing inNodeRecordPairs(removes the TODO)NodeRecord::from_node()now emitsip6/tcp6/udp6for IPv6 node addresses instead of incorrectly encoding them under the IPv4ip/tcp/udpkeysAddress resolution logic
--discovery.addrset?discovery_bind_addr=rlpx_bind_addr;discovery_external_addr=rlpx_external_addrdiscovery_bind_addr= given IP;discovery_external_addr= given IP0.0.0.0/::discovery_bind_addr= given wildcard;discovery_external_addr=rlpx_external_addrPart of
This is PR 2 of 3 for IPv6 support (#5354):