mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
If we mine too fast, gossip can reach a node which considers it too far in the guture. Break it up. ``` @pytest.mark.developer("Too slow without --dev-fast-gossip") def test_routing_gossip(node_factory, bitcoind): nodes = node_factory.get_nodes(5) for i in range(len(nodes) - 1): src, dst = nodes[i], nodes[i + 1] src.rpc.connect(dst.info['id'], 'localhost', dst.port) src.openchannel(dst, CHANNEL_SIZE, confirm=False, wait_for_announce=False) # openchannel calls fundwallet which mines a block; so first channel # is 4 deep, last is unconfirmed. # Allow announce messages. mine_funding_to_announce(bitcoind, nodes, num_blocks=6, wait_for_mempool=1) # Deep check that all channels are in there comb = [] for i in range(len(nodes) - 1): comb.append((nodes[i].info['id'], nodes[i + 1].info['id'])) comb.append((nodes[i + 1].info['id'], nodes[i].info['id'])) def check_gossip(n): seen = [] channels = n.rpc.listchannels()['channels'] for c in channels: seen.append((c['source'], c['destination'])) missing = set(comb) - set(seen) logging.debug("Node {id} is missing channels {chans}".format( id=n.info['id'], chans=missing) ) return len(missing) == 0 for n in nodes: > wait_for(lambda: check_gossip(n)) tests/test_gossip.py:721: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ success = <function test_routing_gossip.<locals>.<lambda> at 0x7f3200534ef0> timeout = 180 def wait_for(success, timeout=TIMEOUT): start_time = time.time() interval = 0.25 while not success(): time_left = start_time + timeout - time.time() if time_left <= 0: > raise ValueError("Timeout while waiting for {}".format(success)) E ValueError: Timeout while waiting for <function test_routing_gossip.<locals>.<lambda> at 0x7f3200534ef0> |
||
---|---|---|
.. | ||
data | ||
fuzz | ||
plugins | ||
vectors | ||
benchmark.py | ||
conftest.py | ||
db.py | ||
fixtures.py | ||
rkls_github_canned_server.py | ||
test_bookkeeper.py | ||
test_cln_rs.py | ||
test_closing.py | ||
test_connection.py | ||
test_db.py | ||
test_gossip.py | ||
test_invoices.py | ||
test_misc.py | ||
test_mkfunding.py | ||
test_onion.py | ||
test_opening.py | ||
test_pay.py | ||
test_plugin.py | ||
test_reckless.py | ||
test_wallet.py | ||
utils.py | ||
valgrind-suppressions.txt |