From 5f9625f332569ee4f4de25e34d3130df0e0f4c92 Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:37:02 +0200 Subject: [PATCH] fix: Completely clean dns-discovery-name-server references (#3477) --- apps/chat2/chat2.nim | 2 +- apps/chat2/config_chat2.nim | 7 ++++--- apps/networkmonitor/networkmonitor.nim | 4 ++-- docs/operators/how-to/configure-dns-disc.md | 3 --- docs/tutorial/dns-disc.md | 6 ++---- waku/README.md | 4 +--- waku/discovery/waku_dnsdisc.nim | 4 ++-- 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/apps/chat2/chat2.nim b/apps/chat2/chat2.nim index 1ba599d78..7a66a8b90 100644 --- a/apps/chat2/chat2.nim +++ b/apps/chat2/chat2.nim @@ -428,7 +428,7 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} = if dnsDiscoveryUrl.isSome: var nameServers: seq[TransportAddress] - for ip in conf.dnsDiscoveryNameServers: + for ip in conf.dnsAddrsNameServers: nameServers.add(initTAddress(ip, Port(53))) # Assume all servers use port 53 let dnsResolver = DnsResolver.new(nameServers) diff --git a/apps/chat2/config_chat2.nim b/apps/chat2/config_chat2.nim index 8cc525208..bd7a4499f 100644 --- a/apps/chat2/config_chat2.nim +++ b/apps/chat2/config_chat2.nim @@ -170,10 +170,11 @@ type name: "dns-discovery-url" .}: string - dnsDiscoveryNameServers* {. - desc: "DNS name server IPs to query. Argument may be repeated.", + dnsAddrsNameServers* {. + desc: + "DNS name server IPs to query for DNS multiaddrs resolution. Argument may be repeated.", defaultValue: @[parseIpAddress("1.1.1.1"), parseIpAddress("1.0.0.1")], - name: "dns-discovery-name-server" + name: "dns-addrs-name-server" .}: seq[IpAddress] ## Chat2 configuration diff --git a/apps/networkmonitor/networkmonitor.nim b/apps/networkmonitor/networkmonitor.nim index f8cde5281..c5c4ea50b 100644 --- a/apps/networkmonitor/networkmonitor.nim +++ b/apps/networkmonitor/networkmonitor.nim @@ -354,7 +354,7 @@ proc crawlNetwork( await sleepAsync(crawlInterval.millis - elapsed.millis) proc retrieveDynamicBootstrapNodes( - dnsDiscoveryUrl: string, dnsDiscoveryNameServers: seq[IpAddress] + dnsDiscoveryUrl: string, dnsAddrsNameServers: seq[IpAddress] ): Future[Result[seq[RemotePeerInfo], string]] {.async.} = ## Retrieve dynamic bootstrap nodes (DNS discovery) @@ -363,7 +363,7 @@ proc retrieveDynamicBootstrapNodes( debug "Discovering nodes using Waku DNS discovery", url = dnsDiscoveryUrl var nameServers: seq[TransportAddress] - for ip in dnsDiscoveryNameServers: + for ip in dnsAddrsNameServers: nameServers.add(initTAddress(ip, Port(53))) # Assume all servers use port 53 let dnsResolver = DnsResolver.new(nameServers) diff --git a/docs/operators/how-to/configure-dns-disc.md b/docs/operators/how-to/configure-dns-disc.md index fc0ee5cb1..f003c61a4 100644 --- a/docs/operators/how-to/configure-dns-disc.md +++ b/docs/operators/how-to/configure-dns-disc.md @@ -9,7 +9,6 @@ The following command line options are available: ``` --dns-discovery Enable DNS Discovery --dns-discovery-url URL for DNS node list in format 'enrtree://@' ---dns-discovery-name-server DNS name server IPs to query. Argument may be repeated. ``` - `--dns-discovery` is used to enable DNS discovery on the node. @@ -17,8 +16,6 @@ Waku DNS discovery is disabled by default. - `--dns-discovery-url` is mandatory if DNS discovery is enabled. It contains the URL for the node list. The URL must be in the format `enrtree://@` where `` is the fully qualified domain name and `` is the base32 encoding of the compressed 32-byte public key that signed the list at that location. -- `--dns-discovery-name-server` is optional and contains the IP(s) of the DNS name servers to query. -If left unspecified, the Cloudflare servers `1.1.1.1` and `1.0.0.1` will be used by default. A node will attempt connection to all discovered nodes. diff --git a/docs/tutorial/dns-disc.md b/docs/tutorial/dns-disc.md index b30716b65..c9cc24e15 100644 --- a/docs/tutorial/dns-disc.md +++ b/docs/tutorial/dns-disc.md @@ -33,12 +33,10 @@ The following command line options are available for both `wakunode2` or `chat2` ``` --dns-discovery Enable DNS Discovery --dns-discovery-url URL for DNS node list in format 'enrtree://@' ---dns-discovery-name-server DNS name server IPs to query. Argument may be repeated. ``` - `--dns-discovery` is used to enable DNS discovery on the node. Waku DNS discovery is disabled by default. - `--dns-discovery-url` is mandatory if DNS discovery is enabled. It contains the URL for the node list. The URL must be in the format `enrtree://@` where `` is the fully qualified domain name and `` is the base32 encoding of the compressed 32-byte public key that signed the list at that location. See [EIP-1459](https://eips.ethereum.org/EIPS/eip-1459#specification) or the example below to illustrate. -- `--dns-discovery-name-server` is optional and contains the IP(s) of the DNS name servers to query. If left unspecified, the Cloudflare servers `1.1.1.1` and `1.0.0.1` will be used by default. A node will attempt connection to all discovered nodes. @@ -63,9 +61,9 @@ Similarly, for `chat2`: The node will discover and attempt connection to all `waku.test` nodes during setup procedures. -To use specific DNS name servers, one or more `--dns-discovery-name-server` arguments can be added: +To use specific DNS name servers, one or more `--dns-addrs-name-server` arguments can be added: ``` ./build/wakunode2 --dns-discovery:true --dns-discovery-url:enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im --dns-dis -covery-name-server:8.8.8.8 --dns-discovery-name-server:8.8.4.4 +covery-name-server:8.8.8.8 --dns-addrs-name-server:8.8.4.4 ``` diff --git a/waku/README.md b/waku/README.md index 5b9462775..ed3887a09 100644 --- a/waku/README.md +++ b/waku/README.md @@ -179,7 +179,7 @@ The following command line options are available: ``` --dns-discovery Enable DNS Discovery --dns-discovery-url URL for DNS node list in format 'enrtree://@' ---dns-discovery-name-server DNS name server IPs to query. Argument may be repeated. +--dns-addrs-name-server DNS name server IPs to query. Argument may be repeated. ``` - `--dns-discovery` is used to enable DNS discovery on the node. @@ -187,8 +187,6 @@ Waku DNS discovery is disabled by default. - `--dns-discovery-url` is mandatory if DNS discovery is enabled. It contains the URL for the node list. The URL must be in the format `enrtree://@` where `` is the fully qualified domain name and `` is the base32 encoding of the compressed 32-byte public key that signed the list at that location. -- `--dns-discovery-name-server` is optional and contains the IP(s) of the DNS name servers to query. -If left unspecified, the Cloudflare servers `1.1.1.1` and `1.0.0.1` will be used by default. A node will attempt connection to all discovered nodes. diff --git a/waku/discovery/waku_dnsdisc.nim b/waku/discovery/waku_dnsdisc.nim index 10af99b4c..3115e6cd0 100644 --- a/waku/discovery/waku_dnsdisc.nim +++ b/waku/discovery/waku_dnsdisc.nim @@ -97,7 +97,7 @@ proc init*( return ok(wakuDnsDisc) proc retrieveDynamicBootstrapNodes*( - dnsDiscoveryUrl: string, dnsDiscoveryNameServers: seq[IpAddress] + dnsDiscoveryUrl: string, dnsAddrsNameServers: seq[IpAddress] ): Future[Result[seq[RemotePeerInfo], string]] {.async.} = ## Retrieve dynamic bootstrap nodes (DNS discovery) @@ -106,7 +106,7 @@ proc retrieveDynamicBootstrapNodes*( debug "Discovering nodes using Waku DNS discovery", url = dnsDiscoveryUrl var nameServers: seq[TransportAddress] - for ip in dnsDiscoveryNameServers: + for ip in dnsAddrsNameServers: nameServers.add(initTAddress(ip, Port(53))) # Assume all servers use port 53 let dnsResolver = DnsResolver.new(nameServers)