mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(discv5): change default discv5 port (#11051)
Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
4
book/cli/reth/debug/execution.md
vendored
4
book/cli/reth/debug/execution.md
vendored
@ -101,12 +101,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
4
book/cli/reth/debug/in-memory-merkle.md
vendored
4
book/cli/reth/debug/in-memory-merkle.md
vendored
@ -101,12 +101,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
4
book/cli/reth/debug/merkle.md
vendored
4
book/cli/reth/debug/merkle.md
vendored
@ -101,12 +101,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
4
book/cli/reth/debug/replay-engine.md
vendored
4
book/cli/reth/debug/replay-engine.md
vendored
@ -101,12 +101,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
4
book/cli/reth/node.md
vendored
4
book/cli/reth/node.md
vendored
@ -93,12 +93,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
4
book/cli/reth/p2p.md
vendored
4
book/cli/reth/p2p.md
vendored
@ -78,12 +78,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
4
book/cli/reth/stage/run.md
vendored
4
book/cli/reth/stage/run.md
vendored
@ -144,12 +144,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
4
book/cli/reth/stage/unwind.md
vendored
4
book/cli/reth/stage/unwind.md
vendored
@ -106,12 +106,12 @@ Networking:
|
||||
--discovery.v5.port <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 <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 <DISCOVERY_V5_LOOKUP_INTERVAL>
|
||||
The interval in seconds at which to carry out periodic lookup queries, for the whole run of the program
|
||||
|
||||
@ -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());
|
||||
|
||||
|
||||
@ -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(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user