-
Notifications
You must be signed in to change notification settings - Fork 421
Always emit bump events, even when fees are sufficient #4001
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
Always emit bump events, even when fees are sufficient #4001
Conversation
Currently, the anchor commitment bump events are bypassed when the commitment transaction has sufficient fees. However, this makes it difficult for users to defer force-closures to a trusted party (such as an LSP) while not maintaining reserves. Broadcasting a commitment transaction without maintaining reserves would make HTLCs unclaimable against that commitment transaction. In this change, anchor commitment bump events will always be emitted so users can capture and choose not to process them.
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
|
Basically LGTM, any reason why it's draft? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4001 +/- ##
=======================================
Coverage 88.93% 88.94%
=======================================
Files 174 174
Lines 124593 124642 +49
Branches 124593 124642 +49
=======================================
+ Hits 110813 110861 +48
- Misses 11283 11287 +4
+ Partials 2497 2494 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Ah, I was mainly waiting for CI to complete successfully, marked ready for review now. |
|
🔔 1st Reminder Hey @joostjager! 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. |
TheBlueMatt
left a comment
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.
Ah! This actually seems like a bugfix. I was curious why the tests were changing at all, it looks like if we do the event-bypass we won't properly bump the commitment-broadcast feerate after every few blocks like we should, at least in some cases.
In update_claims_view_from_requests (and update_claims_view_from_matched_txn) we set_feerate on the package to the feerate returned by generate_claim. In the bypass code removed here, we return a selected feerate of 0, rather than the actually-used feerate (or the target feerate, which I think we should really be using). Then, if the feerate is 0, we'll consider it "no previous feerate" in the bump logic and just use the new fee estimator rather than bumping 25% if we don't see confirmation. This isn't that critical as we'll still increase fee if the fee estimator goes up, and in any case where the fee estimator goes up enough to jump beyond the by pass case we'll immediately start the regular 25%-ever-few-blocks bumping we want anyway, but it does make us rely on the user's fee estimator more than we want to.
Currently, the anchor commitment bump events are bypassed when the commitment transaction has sufficient fees. However, this makes it difficult for users to defer force-closures to a trusted party (such as an LSP) while not maintaining reserves. Broadcasting a commitment transaction without maintaining reserves would make HTLCs unclaimable against that commitment transaction.
In this change, anchor commitment bump events will always be emitted so users can capture and choose not to process them.
Fixes #3496.