Skip to content

Conversation

@enaples
Copy link

@enaples enaples commented Jan 26, 2026

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

To run the test: EXPERIMENTAL_DUAL_FUND=0 uv run python -m pytest -vvvv tests/test_opening.py::test_opening_with_unknown_feerates

Note that in the same node configuration (dev-no-fake-fees=true):

  1. if the experimental-dual-fund is enabled, the channel will open only if feerate is specified in the fundchannel call (test at tests: test reproduce #8847 #8864 ), otherwise it will raise
{'code': 501, 'message': 'Cannot estimate fees (yet)'}
  1. if f the experimental-dual-fund is NOT enabled, the channel funding will fail both if the feerate is specified or not.

Comment on lines 38 to 39
with pytest.raises(RpcError) as e:
l1.rpc.fundchannel(id=l2.info['id'], amount=1000000, feerate='252perkw', minconf=0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the test case!

I would love you to enhance this a little:

  1. Use with pytest.raises(RpcError, match='xxxx') to check that the error is the one you expect.
  2. Test this with no feerate specified (should fail), then check that it does work with feerate=
  3. Mark the test with @pytest.mark.xfail(strict=True).

Then I can write the fix on top of this, and remove the xfail mark, as a separate commit!

'dev-no-fake-fees': True,
}

l1, l2 = node_factory.line_graph(2, opts=[opts, opts])
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, opts=opts means "use these options for all nodes". But I think the open will fail if l2 also doesn't know the fees, so you may want opts=[opts, {}] ?

Copy link
Author

Choose a reason for hiding this comment

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

Test logic

In a context in which fees can't be compute, the user needs to specify feerate on the fundchannel call.

  1. The RPC fundchannel call should fail if feerate is not specified
  2. The RPC fundchannel call should work fine if feerate is specified

Additional Info

I can't use line_graph since it automatically opens a channel which fails due to unknown feerate. That's why I wasn't able to capture the error with RpcError in the first version of the test. The error actually raised during line_graph call and not from the 'external' fundchannel call.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants