Skip to content

lnprototest: updating and patch lnprototest #5372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vincenzopalazzo
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo commented Jul 3, 2022

Build on top of #5367

The @niftynei patch finally fixed the lnprototest failure rustyrussell/lnprototest#31 and with the stress test that I added on lnprototest CI that ran lnprototest 20 times, I found another strange failure rustyrussell/lnprototest#56 that I'm no longer able to reproduce, so I added a couple of logging call.

In addition, I enable the CI lnprototest that run the test 2 time, in this way we can try to find the bug before we fall into the lucky case forever. if we fall in the lucky case 2 time? well, we are lucky no?

let's see what the full CI tells us now, and if we finally have the CI clean!

Fixes #5148

@vincenzopalazzo vincenzopalazzo changed the title Macros/lnprototest patch lnprototest: updating and patch lnprototest Jul 3, 2022
@vincenzopalazzo vincenzopalazzo marked this pull request as ready for review July 3, 2022 20:13
@vincenzopalazzo
Copy link
Collaborator Author

vincenzopalazzo commented Jul 4, 2022

@rustyrussell There is some failure related to the gossip test, but this looks like that we can cover in lnprototest? or maybe we did already https://github.com/rustyrussell/lnprototest/blob/master/tests/test_bolt7-01-channel_announcement-success.py

_____________________________ test_node_reannounce _____________________________
[gw3] linux -- Python 3.7.13 /opt/hostedtoolcache/Python/3.7.13/x64/bin/python3
node_factory = <pyln.testing.utils.NodeFactory object at 0x7feabd907c90>
bitcoind = <pyln.testing.utils.BitcoinD object at 0x7feabd3f5c90>
chainparams = {'bip173_prefix': 'bcrt', 'chain_hash': '06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f', 'elements': False, 'example_addr': 'bcrt1qeyyk6sl5pr49ycpqyckvmttus5ttj25pd0zpvg', ...}
@pytest.mark.developer("Needs fast gossip propagation")
@pytest.mark.openchannel('v1')
@pytest.mark.openchannel('v2')
deftest_node_reannounce(node_factory, bitcoind, chainparams):
"Test that we reannounce a node when parameters change"
        l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True,
'log-level': 'io'})
        bitcoind.generate_block(5)
        genesis_blockhash = chainparams['chain_hash']
# Wait for node_announcement for l1.
        l2.daemon.wait_for_log(r'\[IN\] 0101.*{}'.format(l1.info['id']))
# Wait for it to process it.
        wait_for(lambda: l2.rpc.listnodes(l1.info['id'])['nodes'] != [])
        wait_for(lambda: 'alias'in only_one(l2.rpc.listnodes(l1.info['id'])['nodes']))
assert only_one(l2.rpc.listnodes(l1.info['id'])['nodes'])['alias'].startswith('JUNIORBEAM')
        lfeatures = expected_node_features()
if l1.config('experimental-dual-fund'):
            lfeatures = expected_node_features(extra=[21, 29])
# Make sure it gets features correct.
assert only_one(l2.rpc.listnodes(l1.info['id'])['nodes'])['features'] == lfeatures
        l1.stop()
        l1.daemon.opts['alias'] = 'SENIORBEAM'
# It won't update within 5 seconds, so sleep.
        time.sleep(5)
        l1.start()
        wait_for(lambda: only_one(l2.rpc.listnodes(l1.info['id'])['nodes'])['alias'] == 'SENIORBEAM')
# Get node_announcements.
        msgs = l1.query_gossip('gossip_timestamp_filter',
                               genesis_blockhash,
'0', '0xFFFFFFFF',
# Filter out gossip_timestamp_filter,
# channel_announcement and channel_updates.
# And pings.
                               filters=['0109', '0107', '0102', '0100', '0012'])
# May send its own announcement *twice*, since it always spams us.
        msgs = list(set(msgs))
assertlen(msgs) == 2
assert (bytes("SENIORBEAM", encoding="utf8").hex() in msgs[0]
orbytes("SENIORBEAM", encoding="utf8").hex() in msgs[1])
# Restart should re-xmit exact same update on reconnect!
        l1.restart()
        msgs2 = l1.query_gossip('gossip_timestamp_filter',
                                genesis_blockhash,
'0', '0xFFFFFFFF',
# Filter out gossip_timestamp_filter,
# channel_announcement and channel_updates.
# And pings.
                                filters=['0109', '0107', '0102', '0100', '0012'])
# May send its own announcement *twice*, since it always spams us.
        msgs2 = list(set(msgs2))
>       assert msgs == msgs2
E       AssertionError: assert ['010152cddd8...000000000000'] == ['010152c2743...000000000000']
E         At index 0 diff: '010152cddd83318c370a74d2a4c411f09574b8a80fa1148267727b2dd9b5dcc4d4096415329507fb40de3cd679306d2720c696cd2b622c54fb756656e5baa8da38590007800000080269a262c1fd73022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59022d2253494c454e544152544953542d643061313932312d6d6f6464656[4000](https://github.com/ElementsProject/lightning/runs/7171067324?check_suite_focus=true#step:5:4001)00000000000' != '010152c2743c00693c0923c0cf6d2036dede2011489b73b8f10e94599987689953061cae9e64086f103b881ee9023e54a0b159f1e114d6b226668f609531bd7cd9110007800000080269a262c1fd7c0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c035180266e453454e494f524245414d000000000000000000000000000000000000000000000000'
E         Full diff:
E           [
E         +  '010152cddd83318c370a74d2a4c411f09574b8a80fa1148267727b2dd9b5dcc4d4096415329507fb40de3cd679306d2720c696cd2b622c54fb756656e5baa8da38590007800000080269a262c1fd73022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59022d2253494c454e544152544953542d643061313932312d6d6f6464656400000000000000',
E            '010152c2743c00693c0923c0cf6d2036dede2011489b73b8f10e94599987689953061cae9e64086f103b881ee9023e54a0b159f1e114d6b226668f609531bd7cd9110007800000080269a262c1fd7c0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c035180266e453454e494f524245414d000000000000000000000000000000000000000000000000',
E         -  '010152cddd83318c370a74d2a4c411f09574b8a80fa1148267727b2dd9b5dcc4d4096415329507fb40de3cd679306d2720c696cd2b622c54fb756656e5baa8da38590007800000080269a262c1fd73022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59022d2253494c454e544152544953542d643061313932312d6d6f6464656400000000000000',
E           ]
tests/test_gossip.py:1285: AssertionError

I'm pretty sure that if I restart it I will have the test happy, but maybe we can hide this failure

@rustyrussell
Copy link
Contributor

I have a separate fix for this, so restarting...

niftynei and others added 3 commits July 7, 2022 15:18

Verified

This commit was signed with the committer’s verified signature.
elprans Elvis Pranskevichus
If we can't broadcast the tx, confirm that it didn't end up in the
mempool or the utxo set before throwing an error.

Note that this doesn't protect us in the case where the funding
output has already been *spent*... but that's extremely rare, right?

Fixes ElementsProject#5296

Reported-By: @rustyrussell
Collab-With: @vincenzopalazzo
Changelog-None: patch lnprototest 

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Now that we're more broadcast failure aware, let's check that on
actual broadcast failure we still update UTXO set properly and the
channel opens.
@niftynei niftynei force-pushed the macros/lnprototest_patch branch from cdb6ad8 to 6becf47 Compare July 7, 2022 20:19
@niftynei
Copy link
Contributor

niftynei commented Jul 7, 2022

@vincenzopalazzo i removed your "run the lnprototests x2" patch in anticipation of getting this merged

Copy link
Collaborator Author

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 6becf47

CI failure looks like related to ssh failure!

@niftynei thanks to start and finish this

@rustyrussell rustyrussell merged commit 0374fc1 into ElementsProject:master Jul 8, 2022
@vincenzopalazzo vincenzopalazzo deleted the macros/lnprototest_patch branch July 8, 2022 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-enabling parallel execution on lnprototest
3 participants