Skip to content

Commit 8808c06

Browse files
committed
splice: Update test for new reestablish behavior
New reestablish behvaior allows splices to resume on reestablish if only commit sigs were exchanged. Update the `test_commit_crash_splice` to reflect this (and turn it back on).
1 parent fa5dfb0 commit 8808c06

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/test_splicing.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ def test_invalid_splice(node_factory, bitcoind):
269269
assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0
270270

271271

272-
@unittest.skip("Test is flaky causing CI to be unusable.")
273272
@pytest.mark.openchannel('v1')
274273
@pytest.mark.openchannel('v2')
275274
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@@ -293,23 +292,18 @@ def test_commit_crash_splice(node_factory, bitcoind):
293292
# The splicing inflight should have been left pending in the DB
294293
assert l1.db_query("SELECT count(*) as c FROM channel_funding_inflights;")[0]['c'] == 1
295294

296-
l1.daemon.wait_for_log(r'Restarting channeld after tx_abort on CHANNELD_NORMAL channel')
295+
l1.daemon.wait_for_log(r'peer_out WIRE_CHANNEL_REESTABLISH')
296+
l1.daemon.wait_for_log(r'Got reestablish commit=1 revoke=0 inflights: 1, active splices: 1')
297+
l1.daemon.wait_for_log(r'Splice resume check with local_next_funding: sent, remote_next_funding: received, inflights: 1')
298+
l1.daemon.wait_for_log(r'Splice negotation, will not send commit, not recv commit, send signature, recv signature as initiator')
297299

298300
assert l1.db_query("SELECT count(*) as c FROM channel_funding_inflights;")[0]['c'] == 1
299301

300-
result = l1.rpc.splice_init(chan_id, -105000, l1.rpc.addpsbtoutput(100000)['psbt'])
301-
result = l1.rpc.splice_update(chan_id, result['psbt'])
302-
assert(result['commitments_secured'] is False)
303-
result = l1.rpc.splice_update(chan_id, result['psbt'])
304-
assert(result['commitments_secured'] is True)
305-
result = l1.rpc.splice_signed(chan_id, result['psbt'])
306-
307302
l2.daemon.wait_for_log(r'CHANNELD_NORMAL to CHANNELD_AWAITING_SPLICE')
308303
l1.daemon.wait_for_log(r'CHANNELD_NORMAL to CHANNELD_AWAITING_SPLICE')
309304

310305
mempool = bitcoind.rpc.getrawmempool(True)
311306
assert len(list(mempool.keys())) == 1
312-
assert result['txid'] in list(mempool.keys())
313307

314308
bitcoind.generate_block(6, wait_for_mempool=1)
315309

0 commit comments

Comments
 (0)