diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index 57e51beac..cc13e097e 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -1133,6 +1133,7 @@ class LightningNode(object): timeout=TIMEOUT, stdout=subprocess.PIPE).stdout.strip() out = subprocess.run(['devtools/gossipwith', + '--features=40', # OPT_GOSSIP_QUERIES '--timeout-after={}'.format(int(math.sqrt(TIMEOUT) + 1)), '{}@localhost:{}'.format(self.info['id'], self.port), diff --git a/tests/test_gossip.py b/tests/test_gossip.py index acbeeba94..041b8188d 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -278,7 +278,7 @@ def test_gossip_timestamp_filter(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('gossip_timestamp_filter', genesis_blockhash, '0', '0xFFFFFFFF', - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # 0x0100 = channel_announcement # 0x0102 = channel_update @@ -291,7 +291,7 @@ def test_gossip_timestamp_filter(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('gossip_timestamp_filter', genesis_blockhash, '0', before_anything - backdate, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) assert msgs == [] # Now choose range which will only give first update. @@ -299,7 +299,7 @@ def test_gossip_timestamp_filter(node_factory, bitcoind, chainparams): genesis_blockhash, before_anything - backdate, after_12 - before_anything + 1, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # 0x0100 = channel_announcement # 0x0102 = channel_update @@ -313,7 +313,7 @@ def test_gossip_timestamp_filter(node_factory, bitcoind, chainparams): genesis_blockhash, before_23 - backdate, after_23 - before_23 + 1, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # 0x0100 = channel_announcement # 0x0102 = channel_update @@ -633,14 +633,14 @@ def test_gossip_no_empty_announcements(node_factory, bitcoind, chainparams): assert l1.query_gossip('query_channel_range', chainparams['chain_hash'], 0, 1000000, - filters=['0109', '0012']) == ['0108' - # blockhash - + chainparams['chain_hash'] - # first_blocknum, number_of_blocks, complete - + format(0, '08x') + format(1000000, '08x') + '01' - # encoded_short_ids - + format(len(encoded) // 2, '04x') - + encoded] + filters=['0109', '0107', '0012']) == ['0108' + # blockhash + + chainparams['chain_hash'] + # first_blocknum, number_of_blocks, complete + + format(0, '08x') + format(1000000, '08x') + '01' + # encoded_short_ids + + format(len(encoded) // 2, '04x') + + encoded] # If we reconnect, gossip will now flow. l1.rpc.connect(l2.info['id'], 'localhost', l2.port) @@ -718,7 +718,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', chainparams['chain_hash'], 0, 1000000, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) encoded = subprocess.run(['devtools/mkencoded', '--scids', '00', scid12, scid23], check=True, timeout=TIMEOUT, @@ -737,7 +737,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, 0, block12, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # reply_channel_range == 264 assert msgs == ['0108' # blockhash @@ -751,7 +751,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, 0, block12 + 1, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) encoded = subprocess.run(['devtools/mkencoded', '--scids', '00', scid12], check=True, timeout=TIMEOUT, @@ -770,7 +770,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, 0, block23, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) encoded = subprocess.run(['devtools/mkencoded', '--scids', '00', scid12], check=True, timeout=TIMEOUT, @@ -789,7 +789,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, block12, block23 - block12 + 1, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) encoded = subprocess.run(['devtools/mkencoded', '--scids', '00', scid12, scid23], check=True, timeout=TIMEOUT, @@ -808,7 +808,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, block23, 1, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) encoded = subprocess.run(['devtools/mkencoded', '--scids', '00', scid23], check=True, timeout=TIMEOUT, @@ -827,7 +827,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, block23 + 1, 1000000, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # reply_channel_range == 264 assert msgs == ['0108' # blockhash @@ -844,7 +844,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, 0, 1000000, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # It should definitely have split l4.daemon.wait_for_log('reply_channel_range: splitting 0-1 of 2') @@ -869,7 +869,7 @@ def test_gossip_query_channel_range(node_factory, bitcoind, chainparams): msgs = l4.query_gossip('query_channel_range', genesis_blockhash, 1, 429496000, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) assert len(msgs) == 2 @@ -938,7 +938,7 @@ def test_query_short_channel_id(node_factory, bitcoind, chainparams): msgs = l1.query_gossip('query_short_channel_ids', chain_hash, encoded, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # Should just get the WIRE_REPLY_SHORT_CHANNEL_IDS_END = 262 # (with chainhash and completeflag = 1) @@ -961,7 +961,7 @@ def test_query_short_channel_id(node_factory, bitcoind, chainparams): msgs = l1.query_gossip('query_short_channel_ids', chain_hash, encoded, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) assert len(msgs) == 6 # 0x0100 = channel_announcement @@ -981,7 +981,7 @@ def test_query_short_channel_id(node_factory, bitcoind, chainparams): msgs = l1.query_gossip('query_short_channel_ids', chain_hash, encoded, - filters=['0109', '0012']) + filters=['0109', '0107', '0012']) # Technically, this order could be different, but this matches code. assert len(msgs) == 10 @@ -1255,7 +1255,7 @@ def test_node_reannounce(node_factory, bitcoind, chainparams): # Filter out gossip_timestamp_filter, # channel_announcement and channel_updates. # And pings. - filters=['0109', '0102', '0100', '0012']) + filters=['0109', '0107', '0102', '0100', '0012']) assert len(msgs) == 2 assert (bytes("SENIORBEAM", encoding="utf8").hex() in msgs[0] @@ -1270,7 +1270,7 @@ def test_node_reannounce(node_factory, bitcoind, chainparams): # Filter out gossip_timestamp_filter, # channel_announcement and channel_updates. # And pings. - filters=['0109', '0102', '0100', '0012']) + filters=['0109', '0107', '0102', '0100', '0012']) assert msgs == msgs2 # Won't have queued up another one, either. assert not l1.daemon.is_in_log('node_announcement: delaying') @@ -1295,7 +1295,7 @@ def test_node_reannounce(node_factory, bitcoind, chainparams): # Filter out gossip_timestamp_filter, # channel_announcement and channel_updates. # And pings. - filters=['0109', '0102', '0100', '0012']) + filters=['0109', '0107', '0102', '0100', '0012']) assert msgs != msgs2