rgb-cln/tests
Rusty Russell cfa33ce362 lightningd: fix incorrect reuse of dualopend, leading to dev_queryfeerates race
CI hit this issue where it would get a tx_abort in fundchannel.  This
happens when the dualopend we use to query the feerates has not exited
yet (it waits for the tx_abort reply), and we mistakenly reuse it.

With multi-channel support, this is wrong: just run another one and it
all Just Works.

This means we need to rework our dual_open_control.c logic, since it
would previously create an unsaved channel then not clean up if
something went wrong.

Most people will never try to negotiate opening multiple channels to
the same peer at the same time (vs. having an established channel and
opening a new one), so this case is a bit weird.

```
         rates = l1.rpc.dev_queryrates(l2.info['id'], amount, amount)
     
         # l1 leases a channel from l2
         l1.rpc.fundchannel(l2.info['id'], amount, request_amt=amount,
                            feerate='{}perkw'.format(feerate),
 >                          compact_lease=rates['compact_lease'])
 
 tests/test_opening.py:1611: 
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 contrib/pyln-client/pyln/client/lightning.py:833: in fundchannel
     return self.call("fundchannel", payload)
 contrib/pyln-testing/pyln/testing/utils.py:721: in call
     res = LightningRpc.call(self, method, payload, cmdprefix, filter)

 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 
 self = <pyln.testing.utils.PrettyPrintingLightningRpc object at 0x7f6cbcd97950>
 method = 'fundchannel'
 payload = {'amount': 500000, 'announce': True, 'compact_lease': '029a00640064000000644c4b40', 'feerate': '2000perkw', ...}
 cmdprefix = None, filter = None
 
     def call(self, method, payload=None, cmdprefix=None, filter=None):
         """Generic call API: you can set cmdprefix here, or set self.cmdprefix
...
         if not isinstance(resp, dict):
             raise ValueError("Malformed response, response is not a dictionary %s." % resp)
         elif "error" in resp:
 >           raise RpcError(method, payload, resp['error'])
 E           pyln.client.lightning.RpcError: RPC call failed: method: fundchannel, payload: {'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', 'amount': 500000, 'feerate': '2000perkw', 'announce': True, 'request_amt': 500000, 'compact_lease': '029a00640064000000644c4b40'}, error: {'code': -1, 'message': 'Abort requested', 'data': {'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', 'method': 'openchannel_init'}}
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-05-29 13:46:21 +09:30
..
data pytest: add blackbox tests for reckless 2023-04-09 12:41:11 +09:30
fuzz fuzz: new fuzz-bech32 seeds 2023-05-27 15:06:31 +09:30
plugins libplugin: don't spew datastore errors to LOG_DEBUG. 2023-02-11 12:22:40 -06:00
vectors pytest: Remove onion test vectors containing legacy onions. 2022-03-18 09:20:11 +10:30
benchmark.py pytest: always provide payment_secret when making payments. 2021-07-14 14:38:00 -05:00
conftest.py tests: add marker for v1/v2 channel opens 2021-05-12 11:25:41 +09:30
db.py test-db-provider: if postgres in tests, startup a bookkeeper db 2022-07-28 12:08:18 +09:30
fixtures.py pyln.testing: remove Throttler. 2023-04-06 09:10:53 +09:30
rkls_github_canned_server.py pytest: add blackbox tests for reckless 2023-04-09 12:41:11 +09:30
test_bookkeeper.py pytest: clean up wait_for_onchaind_tx interface, remove wait_for_onchaind_broadcast 2023-04-07 11:49:09 +09:30
test_cln_rs.py pytest: fix tests/test_cln_rs.py to avoid race. 2023-05-19 14:17:44 +02:00
test_closing.py pytest: slow down for bitcoind. 2023-05-29 13:46:21 +09:30
test_connection.py lightningd: fix incorrect reuse of dualopend, leading to dev_queryfeerates race 2023-05-29 13:46:21 +09:30
test_db.py wallet: fix up PSBTs as a migration. 2023-03-31 09:16:25 +10:30
test_gossip.py gossipd: send our own gossip aggressively when a new peer connects. 2023-04-13 08:48:50 -07:00
test_invoices.py lightningd: Add `signinvoice` to sign a BOLT11 invoice. 2023-02-06 15:54:32 -06:00
test_misc.py pytest: remove EXPERIMENTAL_FEATURES as a consideration. 2023-05-23 09:34:08 +09:30
test_mkfunding.py pytest: add tests for devtools/mkfunding 2023-01-09 14:50:30 -06:00
test_onion.py lightningd: remove support for legacy onion format. 2022-03-18 09:20:11 +10:30
test_opening.py pytest: update test_v2_fail_second for listpeers changes. 2023-05-29 13:46:21 +09:30
test_pay.py pytest: remove EXPERIMENTAL_FEATURES as a consideration. 2023-05-23 09:34:08 +09:30
test_plugin.py listtransactions: remove annotations, which were only in EXPERIMENTAL_FEATURES. 2023-05-23 09:34:08 +09:30
test_reckless.py pytest: ignore pip warning 2023-04-24 13:08:15 -07:00
test_wallet.py test_withdraw_bech32m: test that expected outputs exist for bech32(m) withdrawals 2023-05-25 11:07:45 +09:30
utils.py pytest: remove EXPERIMENTAL_FEATURES as a consideration. 2023-05-23 09:34:08 +09:30
valgrind-suppressions.txt pytest: Use valgrind target suppressions instead of skipping tests 2022-03-10 10:21:41 +10:30