-
Notifications
You must be signed in to change notification settings - Fork 412
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
base: main
Are you sure you want to change the base?
Conversation
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
184efad
to
413e895
Compare
d0a4441
to
b2a166c
Compare
Codecov ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
e4f2142
to
cc03f48
Compare
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.
cc03f48
to
d94822c
Compare
🔔 1st Reminder Hey @wpaulino! This PR has been waiting for your review. |
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, why does this "violate the specification"? Our peer has no idea we had this update_fee queued, we never sent it to them AFAIU. It makes sense to me that we should want to send the commitment even if we can't update the fee, we definitely shouldn't sit on HTLCs!
The problem is that currently the code makes it possible to send a commitment with zero updates, in the case we cannot afford the new feerate and there are no pending HTLC updates. |
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.