Skip to content

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

@enaples

Description

@enaples

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    QABlockstream QA team have reproduced, or a test has been created! Look for the linked PR/Issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions