55from pyln .client import RpcError , Millisatoshi
66from utils import (
77 DEVELOPER , wait_for , TIMEOUT , only_one , sync_blockheight ,
8- expected_node_features ,
8+ expected_node_features , COMPAT , EXPERIMENTAL_FEATURES ,
99 mine_funding_to_announce , default_ln_port
1010)
1111
@@ -124,6 +124,13 @@ 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 }
127134 l1 , l2 = node_factory .get_nodes (2 , opts = [opts , {}])
128135
129136 l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -133,6 +140,14 @@ def test_announce_address(node_factory, bitcoind):
133140 l1 .wait_channel_active (scid )
134141 l2 .wait_channel_active (scid )
135142
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+
136151 # We should see it send node announce with all addresses (257 = 0x0101)
137152 # Note: local ephemeral port is masked out.
138153 # Note: Since we `disable-dns` it should not announce a resolved IPv4
@@ -158,6 +173,7 @@ def test_announce_address(node_factory, bitcoind):
158173 assert addresses_dns [0 ]['port' ] == 1236
159174
160175
176+ @unittest .skipIf (not EXPERIMENTAL_FEATURES , "BOLT7 DNS RFC #911" )
161177@pytest .mark .developer ("gossip without DEVELOPER=1 is slow" )
162178def test_announce_and_connect_via_dns (node_factory , bitcoind ):
163179 """ Test that DNS annoucements propagate and can be used when connecting.
@@ -222,6 +238,7 @@ def test_announce_and_connect_via_dns(node_factory, bitcoind):
222238 l4 .rpc .connect (l1 .info ['id' ])
223239
224240
241+ @unittest .skipIf (not EXPERIMENTAL_FEATURES , "BOLT7 DNS RFC #911" )
225242def test_only_announce_one_dns (node_factory , bitcoind ):
226243 # and test that we can't announce more than one DNS address
227244 l1 = node_factory .get_node (expect_fail = True , start = False ,
@@ -230,6 +247,7 @@ def test_only_announce_one_dns(node_factory, bitcoind):
230247 wait_for (lambda : l1 .daemon .is_in_stderr ("Only one DNS can be announced" ))
231248
232249
250+ @unittest .skipIf (not EXPERIMENTAL_FEATURES , "BOLT7 DNS RFC #911" )
233251def test_announce_dns_without_port (node_factory , bitcoind ):
234252 """ Checks that the port of a DNS announcement is set to the corresponding
235253 network port. In this case regtest 19846
0 commit comments