ElementsProject / ElementsProject/lightning

Opening node stuck trying to RBF `DELAYED_OUTPUT_TO_US` transaction after being offline for a while

Open
#8,882 0 comments 0 reactions 0 assignees View on GitHub
QA
Dominant language
C
Stars
3.1k
Forks
1k
Avg merge
4d 10h
Merged PRs (30d)
13

Description

### Scenario
Same as reported in #8881. The difference is that if the node that goes offline is the opening one, once restarted, it crushes trying RBF the DELAYED_OUTPUT_TO_US transaction (min relays fee not met).
I've tryed with different feerates (253/253/253/253 or 1000/1000/1000/1000) but the test continue to fail.

To reproduce the issue:

```
def test_ch_life_with_opening_node_up_after_a_while(node_factory, bitcoind):
"""
Test channel lifecycle with opening node restart after a while.
"""
l1, l2 = node_factory.get_nodes(2)
l1.fundwallet(10000000)
l2.fundwallet(10000000)

l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.rpc.fundchannel(l2.info['id'], 500000, minconf=0)

bitcoind.generate_block(1, wait_for_mempool=1)

l1.daemon.wait_for_log(' to CHANNELD_NORMAL')

chan12 = l1.get_channel_scid(l2)

dust_limit = only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['dust_limit_msat']

inv = l2.rpc.invoice(dust_limit + 1000, 'test1', 'description1')
l1.rpc.pay(inv['bolt11'])

wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['htlcs'] == [])
wait_for(lambda: only_one(l2.rpc.listpeerchannels()['channels'])['htlcs'] == [])

l1.stop()

l2.rpc.close(chan12, 1)

bitcoind.generate_block(1, wait_for_mempool=1)
sync_blockheight(bitcoind, [l2])

l2_channel = only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels'])
assert all('ONCHAIN' in status for status in l2_channel['status'])

sync_blockheight(bitcoind, [l2])

l2_addr = l2.rpc.newaddr()['p2tr']

assert len(l2.rpc.listfunds()['outputs']) > 0, "l2 has no outputs to withdraw"

l2.rpc.withdraw(l2_addr, 'all')
bitcoind.generate_block(210, wait_for_mempool=1)
sync_blockheight(bitcoind, [l2])

l1.start()

funds_l1 = l1.rpc.listfunds()
total_funds_l1 = sum([output['amount_msat'] for output in funds_l1['outputs']])
assert 950000000 <= total_funds_l1 < 10000000000, f"Total funds {total_funds_l1} not in expected range"

funds_l2 = l2.rpc.listfunds()
total_funds_l2 = sum([output['amount_msat'] for output in funds_l2['outputs']])
assert total_funds_l2 > 10000000000, f"Total funds {total_funds_l2} not in expected range"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.