Skip to content

tests: test unilateral closing with unknown fees + cpfp with withdraw#8879

Open
enaples wants to merge 3 commits into
ElementsProject:masterfrom
enaples:test-closing-unknown-fees
Open

tests: test unilateral closing with unknown fees + cpfp with withdraw#8879
enaples wants to merge 3 commits into
ElementsProject:masterfrom
enaples:test-closing-unknown-fees

Conversation

@enaples

@enaples enaples commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

Important

26.04 FREEZE March 11th: Non-bugfix PRs not ready by this date will wait for 26.06.

RC1 is scheduled on March 23rd

The final release is scheduled for April 15th.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

Additional Info

The test is meant to test the ability to perform a Child Pays For Parent on an unilateral channel close with custom feerate.

Steps

  1. Fund two nodes, only one with the ability to compute fees
  2. Verify that one is not able to compute fees.
  3. The node that is able to compute fees open a channel to the other
  4. Send some sats while mine some block
  5. The node which opened the channel is shut down
  6. The other node (unable to compute fees) unilateral close the channel by manually setting the feerate
  7. Verify that the closing transaction is stuck on mempool because ferate is too low
  8. Perform a withdraw manually specifying fees
  9. Verify a new onchain output on wallet
  10. Startup the other node and verify that the channel state is updated

Changelog-None

@enaples enaples added this to the v26.04 milestone Mar 13, 2026
@sangbida sangbida modified the milestones: v26.04, 26.06 Mar 16, 2026
@madelinevibes madelinevibes added the QA Blockstream QA team have reproduced, or a test has been created! Look for the linked PR/Issue label May 4, 2026
@cdecker cdecker force-pushed the test-closing-unknown-fees branch from ad509ff to 9e68027 Compare May 4, 2026 10:23
@cdecker

cdecker commented May 4, 2026

Copy link
Copy Markdown
Member

Rebased on top of master to see if it passes.

@cdecker

cdecker commented May 4, 2026

Copy link
Copy Markdown
Member

The linter is not happy about the coding standards, @enaples please address the warnings and push again.

@cdecker cdecker removed this from the v26.06 milestone May 4, 2026
Comment thread tests/test_closing.py
close_feerate = close_fees * 10**8 / (close_vsize * 4 / 1000)

# Create 1 block but exclude the closing tx (feerate too low).
bitcoind.generate_block(1, needfeerate=close_feerate + 1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cool trick, didn't know this one yet 👍

@cdecker cdecker force-pushed the test-closing-unknown-fees branch from c0dc1e6 to 9e68027 Compare July 9, 2026 15:38
@enaples enaples force-pushed the test-closing-unknown-fees branch from f6da09e to 881d537 Compare July 10, 2026 09:09
@daywalker90

Copy link
Copy Markdown
Collaborator

Not sure how i'm getting added as a reviewer because of code ownership here but ok.

The test is not passing and the commits need to be squashed into one please.

FAILED tests/test_closing.py::test_close_unknownfees_cpfp - pyln.client.lightning.RpcError: RPC call failed: method: fundchannel, payload: {'id': '038194b5f32bdf0aa59812c86c4ef7ad2f294104fa027d1ace9b469bb6f88cf37b', 'amount': 1000000, 'announce': True, 'minconf': 0}, error: {'code': -1, 'message': 'They sent ERROR channel 900d50ecdee7c84dea1f5416dc1d5815916d9359a2f224ae11c2ca75141d1747: You gave bad parameters: Cannot accept channel: feerates unknown', 'data': {'id': '038194b5f32bdf0aa59812c86c4ef7ad2f294104fa027d1ace9b469bb6f88cf37b', 'method': 'fundchannel_start'}}

And the error is correct i think. l1 can not accept a channel without being able to estimate fees?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants