Skip to content

Don't generate a commitment if we cannot afford a holding cell feerate #3828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tankyleo
Copy link
Contributor

@tankyleo tankyleo commented Jun 4, 2025

While an update_fee is in the holding cell, it is possible for HTLCs to get added to the commitment transaction such that when we release the holding cell, we can no longer afford this new feerate.

In that case, we previously would drop the fee update, but still send a commitment (at the old feerate), which is a break of the specification.

We now stop generating this lonely commitment when the fee update gets dropped upon release from the holding cell.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jun 4, 2025

👋 Thanks for assigning @wpaulino as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tankyleo tankyleo requested a review from wpaulino June 4, 2025 16:59
@tankyleo tankyleo force-pushed the lonely-commitment branch from 184efad to 413e895 Compare June 5, 2025 05:34
@tankyleo tankyleo removed the request for review from wpaulino June 5, 2025 05:36
@tankyleo tankyleo marked this pull request as draft June 5, 2025 05:36
@tankyleo tankyleo force-pushed the lonely-commitment branch 3 times, most recently from d0a4441 to b2a166c Compare June 5, 2025 06:00
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 97.84173% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.36%. Comparing base (6133a6c) to head (cc03f48).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/update_fee_tests.rs 97.77% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3828      +/-   ##
==========================================
+ Coverage   89.90%   90.36%   +0.46%     
==========================================
  Files         160      160              
  Lines      129272   133275    +4003     
  Branches   129272   133275    +4003     
==========================================
+ Hits       116218   120432    +4214     
+ Misses      10360    10142     -218     
- Partials     2694     2701       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tankyleo tankyleo force-pushed the lonely-commitment branch 2 times, most recently from e4f2142 to cc03f48 Compare June 6, 2025 00:28
@tankyleo tankyleo marked this pull request as ready for review June 6, 2025 00:34
@tankyleo tankyleo requested a review from wpaulino June 6, 2025 00:35
While an `update_fee` is in the holding cell, it is possible for HTLCs
to get added to the commitment transaction such that when we release the
holding cell, we can no longer afford this new feerate.

In that case, we previously would drop the fee update, but still send a
commitment (at the old feerate), which is a break of the specification.

We now stop generating this lonely commitment when the fee update gets
dropped upon release from the holding cell.
@tankyleo tankyleo force-pushed the lonely-commitment branch from cc03f48 to d94822c Compare June 6, 2025 21:31
@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @wpaulino! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

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