Skip to content

Commit e0d6f3c

Browse files
m-schmoockrustyrussell
authored andcommitted
connectd: DNS Bolt7 #911 no longer EXPERIMENTAL
Changelog-Changed: Bolt7 #911 DNS annoucenent support is no longer EXPERIMENTAL
1 parent 375215a commit e0d6f3c

File tree

3 files changed

+8
-35
lines changed

3 files changed

+8
-35
lines changed

connectd/connectd.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -766,14 +766,12 @@ static void try_connect_one_addr(struct connecting *connect)
766766
bool use_proxy = connect->daemon->always_use_proxy;
767767
const struct wireaddr_internal *addr = &connect->addrs[connect->addrnum];
768768
struct io_conn *conn;
769-
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
770769
bool use_dns = connect->daemon->use_dns;
771770
struct addrinfo hints, *ais, *aii;
772771
struct wireaddr_internal addrhint;
773772
int gai_err;
774773
struct sockaddr_in *sa4;
775774
struct sockaddr_in6 *sa6;
776-
#endif
777775

778776
assert(!connect->conn);
779777

@@ -823,7 +821,6 @@ static void try_connect_one_addr(struct connecting *connect)
823821
af = AF_INET6;
824822
break;
825823
case ADDR_TYPE_DNS:
826-
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
827824
if (use_proxy) /* hand it to the proxy */
828825
break;
829826
if (!use_dns) { /* ignore DNS when we can't use it */
@@ -875,12 +872,6 @@ static void try_connect_one_addr(struct connecting *connect)
875872
addr = &connect->addrs[connect->addrnum];
876873
}
877874
freeaddrinfo(ais);
878-
#endif
879-
tal_append_fmt(&connect->errors,
880-
"%s: EXPERIMENTAL_FEATURES needed. ",
881-
type_to_string(tmpctx,
882-
struct wireaddr_internal,
883-
addr));
884875
goto next;
885876
case ADDR_TYPE_WEBSOCKET:
886877
af = -1;
@@ -1636,10 +1627,8 @@ static void add_seed_addrs(struct wireaddr_internal **addrs,
16361627
NULL, broken_reply, NULL);
16371628
if (new_addrs) {
16381629
for (size_t j = 0; j < tal_count(new_addrs); j++) {
1639-
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
16401630
if (new_addrs[j].type == ADDR_TYPE_DNS)
16411631
continue;
1642-
#endif
16431632
struct wireaddr_internal a;
16441633
a.itype = ADDR_INTERNAL_WIREADDR;
16451634
a.u.wireaddr = new_addrs[j];

lightningd/options.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ static char *opt_set_accept_extra_tlv_types(const char *arg,
195195
}
196196
#endif
197197

198-
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
199198
/* Returns the number of wireaddr types already announced */
200199
static size_t num_announced_types(enum wire_addr_type type, struct lightningd *ld)
201200
{
@@ -210,7 +209,6 @@ static size_t num_announced_types(enum wire_addr_type type, struct lightningd *l
210209
}
211210
return num;
212211
}
213-
#endif
214212

215213
static char *opt_add_addr_withtype(const char *arg,
216214
struct lightningd *ld,
@@ -257,7 +255,6 @@ static char *opt_add_addr_withtype(const char *arg,
257255
tal_arr_expand(&ld->proposed_wireaddr, wi);
258256
}
259257

260-
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
261258
/* Add ADDR_TYPE_DNS to announce DNS hostnames */
262259
if (is_dnsaddr(address) && ala & ADDR_ANNOUNCE) {
263260
/* BOLT-hostnames #7:
@@ -282,7 +279,6 @@ static char *opt_add_addr_withtype(const char *arg,
282279
tal_arr_expand(&ld->proposed_listen_announce, ADDR_ANNOUNCE);
283280
tal_arr_expand(&ld->proposed_wireaddr, wi);
284281
}
285-
#endif
286282

287283
return NULL;
288284

tests/test_gossip.py

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pyln.client import RpcError, Millisatoshi
66
from utils import (
77
DEVELOPER, wait_for, TIMEOUT, only_one, sync_blockheight,
8-
expected_node_features, COMPAT, EXPERIMENTAL_FEATURES,
8+
expected_node_features, COMPAT,
99
mine_funding_to_announce, default_ln_port
1010
)
1111

@@ -124,13 +124,6 @@ def test_announce_address(node_factory, bitcoind):
124124
'::'],
125125
'log-level': 'io',
126126
'dev-allow-localhost': None}
127-
if not EXPERIMENTAL_FEATURES: # BOLT7 DNS RFC #911
128-
opts = {'disable-dns': None, 'announce-addr':
129-
['4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad.onion',
130-
'1.2.3.4:1234',
131-
'::'],
132-
'log-level': 'io',
133-
'dev-allow-localhost': None}
134127
l1, l2 = node_factory.get_nodes(2, opts=[opts, {}])
135128

136129
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
@@ -140,14 +133,6 @@ def test_announce_address(node_factory, bitcoind):
140133
l1.wait_channel_active(scid)
141134
l2.wait_channel_active(scid)
142135

143-
if not EXPERIMENTAL_FEATURES: # BOLT7 DNS RFC #911
144-
l1.daemon.wait_for_log(r"\[OUT\] 0101.*47"
145-
"010102030404d2"
146-
"017f000001...."
147-
"0200000000000000000000000000000000...."
148-
"04e00533f3e8f2aedaa8969b3d0fa03a96e857bbb28064dca5e147e934244b9ba5023003....")
149-
return
150-
151136
# We should see it send node announce with all addresses (257 = 0x0101)
152137
# Note: local ephemeral port is masked out.
153138
# Note: Since we `disable-dns` it should not announce a resolved IPv4
@@ -173,7 +158,6 @@ def test_announce_address(node_factory, bitcoind):
173158
assert addresses_dns[0]['port'] == 1236
174159

175160

176-
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "BOLT7 DNS RFC #911")
177161
@pytest.mark.developer("gossip without DEVELOPER=1 is slow")
178162
def test_announce_and_connect_via_dns(node_factory, bitcoind):
179163
""" Test that DNS annoucements propagate and can be used when connecting.
@@ -238,7 +222,6 @@ def test_announce_and_connect_via_dns(node_factory, bitcoind):
238222
l4.rpc.connect(l1.info['id'])
239223

240224

241-
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "BOLT7 DNS RFC #911")
242225
def test_only_announce_one_dns(node_factory, bitcoind):
243226
# and test that we can't announce more than one DNS address
244227
l1 = node_factory.get_node(expect_fail=True, start=False,
@@ -247,7 +230,6 @@ def test_only_announce_one_dns(node_factory, bitcoind):
247230
wait_for(lambda: l1.daemon.is_in_stderr("Only one DNS can be announced"))
248231

249232

250-
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "BOLT7 DNS RFC #911")
251233
def test_announce_dns_without_port(node_factory, bitcoind):
252234
""" Checks that the port of a DNS announcement is set to the corresponding
253235
network port. In this case regtest 19846
@@ -259,7 +241,13 @@ def test_announce_dns_without_port(node_factory, bitcoind):
259241
info = l1.rpc.getinfo()
260242
assert info['address'][0]['type'] == 'dns'
261243
assert info['address'][0]['address'] == 'example.com'
262-
assert info['address'][0]['port'] == 19846
244+
245+
if TEST_NETWORK == 'regtest':
246+
default_port = 19846
247+
else:
248+
assert TEST_NETWORK == 'liquid-regtest'
249+
default_port = 20735
250+
assert info['address'][0]['port'] == default_port
263251

264252

265253
@pytest.mark.developer("needs DEVELOPER=1")

0 commit comments

Comments
 (0)