-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add error handling for channels which fail to be created in funding_transaction_generated_intern
#3029
Add error handling for channels which fail to be created in funding_transaction_generated_intern
#3029
Conversation
0ffb568
to
0626f8e
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3029 +/- ##
=======================================
Coverage 89.14% 89.15%
=======================================
Files 118 118
Lines 97850 97889 +39
Branches 97850 97889 +39
=======================================
+ Hits 87230 87271 +41
+ Misses 8376 8372 -4
- Partials 2244 2246 +2 ☔ View full report in Codecov by Sentry. |
76d13e2
to
5231799
Compare
In `funding_transaction_generated_intern`, if `find_funding_output` fails (e.g. due to the require output not being present in the provided funding transaction) we'd previously not generated a `ChannelClosed` event which leaves users possibly in a confused state. Here we fix this, also fixing the relevant tests to check for the new event. Fixes lightningdevkit#2843.
If we fail to fund a batch open we'll force-close all channels in the batch, however would previously fail to send error messages to our peers for any channels we were due to test after the one that failed. This commit fixes that issue, sending the required error messages to allow our peers to clean up their state.
5231799
to
b811cba
Compare
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.
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.
We've had a couple of these mishandling cleanup issues lately, really wish we had a better abstraction to handle them.
get_event_msg!(nodes[0], MessageSendEvent::SendFundingCreated, nodes[1].node.get_our_node_id()); | ||
let msgs = nodes[0].node.get_and_clear_pending_msg_events(); | ||
assert_eq!(msgs.len(), 2); | ||
// We currently spuriously send `FundingCreated` for the first channel and then immediately |
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.
Is it too much trouble to hold back sending until we know the batch succeeds?
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 mean we could but I don't really want to add any more error handling than we need to....
Yea, we improved it a bit in a previous PR, but, yea, more would be good... |
…batch-funding-failures Add error handling for channels which fail to be created in `funding_transaction_generated_intern`
See individual commits for more details.