diff --git a/book/cli/reth/debug/execution.md b/book/cli/reth/debug/execution.md index 93864e2d20dc..76755a1121e1 100644 --- a/book/cli/reth/debug/execution.md +++ b/book/cli/reth/debug/execution.md @@ -101,12 +101,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/book/cli/reth/debug/in-memory-merkle.md b/book/cli/reth/debug/in-memory-merkle.md index 333048bde6d5..19061826da5d 100644 --- a/book/cli/reth/debug/in-memory-merkle.md +++ b/book/cli/reth/debug/in-memory-merkle.md @@ -101,12 +101,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/book/cli/reth/debug/merkle.md b/book/cli/reth/debug/merkle.md index 4249d3d08cb4..bdcbc820f623 100644 --- a/book/cli/reth/debug/merkle.md +++ b/book/cli/reth/debug/merkle.md @@ -101,12 +101,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/book/cli/reth/debug/replay-engine.md b/book/cli/reth/debug/replay-engine.md index 6fe2434af091..3d3ae85d72a1 100644 --- a/book/cli/reth/debug/replay-engine.md +++ b/book/cli/reth/debug/replay-engine.md @@ -101,12 +101,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/book/cli/reth/node.md b/book/cli/reth/node.md index 3ae086d38fe2..0e8966764463 100644 --- a/book/cli/reth/node.md +++ b/book/cli/reth/node.md @@ -93,12 +93,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/book/cli/reth/p2p.md b/book/cli/reth/p2p.md index c3ab3f103fb7..475e6bdbbb2c 100644 --- a/book/cli/reth/p2p.md +++ b/book/cli/reth/p2p.md @@ -78,12 +78,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/book/cli/reth/stage/run.md b/book/cli/reth/stage/run.md index 3a5589e36ea6..5a7a13d37ed4 100644 --- a/book/cli/reth/stage/run.md +++ b/book/cli/reth/stage/run.md @@ -144,12 +144,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/book/cli/reth/stage/unwind.md b/book/cli/reth/stage/unwind.md index 122b8dc48c3c..2ca3303648c7 100644 --- a/book/cli/reth/stage/unwind.md +++ b/book/cli/reth/stage/unwind.md @@ -106,12 +106,12 @@ Networking: --discovery.v5.port The UDP IPv4 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv4, or `--discovery.v5.addr` is set - [default: 9000] + [default: 9200] --discovery.v5.port.ipv6 The UDP IPv6 port to use for devp2p peer discovery version 5. Not used unless `--addr` is IPv6, or `--discovery.addr.ipv6` is set - [default: 9000] + [default: 9200] --discovery.v5.lookup-interval The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program diff --git a/crates/net/discv5/src/config.rs b/crates/net/discv5/src/config.rs index 39c73f02a739..4713fb8225bd 100644 --- a/crates/net/discv5/src/config.rs +++ b/crates/net/discv5/src/config.rs @@ -30,8 +30,14 @@ pub const DEFAULT_DISCOVERY_V5_ADDR_IPV6: Ipv6Addr = Ipv6Addr::UNSPECIFIED; /// The default port for discv5 via UDP. /// -/// Default is port 9000. See [`discv5::ListenConfig`] default. -pub const DEFAULT_DISCOVERY_V5_PORT: u16 = 9000; +/// Default is port 9200. +pub const DEFAULT_DISCOVERY_V5_PORT: u16 = 9200; + +/// The default [`discv5::ListenConfig`]. +/// +/// This is different from the upstream default. +pub const DEFAULT_DISCOVERY_V5_LISTEN_CONFIG: ListenConfig = + ListenConfig::Ipv4 { ip: DEFAULT_DISCOVERY_V5_ADDR, port: DEFAULT_DISCOVERY_V5_PORT }; /// Default interval in seconds at which to run a lookup up query. /// @@ -222,8 +228,9 @@ impl ConfigBuilder { discovered_peer_filter, } = self; - let mut discv5_config = discv5_config - .unwrap_or_else(|| discv5::ConfigBuilder::new(ListenConfig::default()).build()); + let mut discv5_config = discv5_config.unwrap_or_else(|| { + discv5::ConfigBuilder::new(DEFAULT_DISCOVERY_V5_LISTEN_CONFIG).build() + }); discv5_config.listen_config = amend_listen_config_wrt_rlpx(&discv5_config.listen_config, tcp_socket.ip()); @@ -528,7 +535,7 @@ mod test { fn overwrite_ipv4_addr() { let rlpx_addr: Ipv4Addr = "192.168.0.1".parse().unwrap(); - let listen_config = ListenConfig::default(); + let listen_config = DEFAULT_DISCOVERY_V5_LISTEN_CONFIG; let amended_config = amend_listen_config_wrt_rlpx(&listen_config, rlpx_addr.into()); @@ -543,7 +550,7 @@ mod test { fn overwrite_ipv6_addr() { let rlpx_addr: Ipv6Addr = "fe80::1".parse().unwrap(); - let listen_config = ListenConfig::default(); + let listen_config = DEFAULT_DISCOVERY_V5_LISTEN_CONFIG; let amended_config = amend_listen_config_wrt_rlpx(&listen_config, rlpx_addr.into()); diff --git a/crates/net/discv5/src/lib.rs b/crates/net/discv5/src/lib.rs index f231603f40ee..d4e8e928fda0 100644 --- a/crates/net/discv5/src/lib.rs +++ b/crates/net/discv5/src/lib.rs @@ -40,7 +40,7 @@ pub use discv5::{self, IpMode}; pub use config::{ BootNode, Config, ConfigBuilder, DEFAULT_COUNT_BOOTSTRAP_LOOKUPS, DEFAULT_DISCOVERY_V5_ADDR, - DEFAULT_DISCOVERY_V5_ADDR_IPV6, DEFAULT_DISCOVERY_V5_PORT, + DEFAULT_DISCOVERY_V5_ADDR_IPV6, DEFAULT_DISCOVERY_V5_LISTEN_CONFIG, DEFAULT_DISCOVERY_V5_PORT, DEFAULT_SECONDS_BOOTSTRAP_LOOKUP_INTERVAL, DEFAULT_SECONDS_LOOKUP_INTERVAL, }; pub use enr::enr_to_discv4_id; @@ -666,7 +666,7 @@ mod test { discv5::Discv5::new( Enr::empty(&sk).unwrap(), sk, - discv5::ConfigBuilder::new(ListenConfig::default()).build(), + discv5::ConfigBuilder::new(DEFAULT_DISCOVERY_V5_LISTEN_CONFIG).build(), ) .unwrap(), ),