Skip to content
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

Don't attempt to resume channels if we already exchanged funding #3051

Merged
merged 1 commit into from
May 28, 2024

Conversation

TheBlueMatt
Copy link
Collaborator

ddf75af introduced the ability to re-exchange our ChannelOpen after a peer disconnects if we didn't complete funding on our end. It did not implement nor consider what would happen if we re-connected after we created our own funding transactions, and currently it panics (and even if it did not it would replay the FundingTransactionGenerated event to users).

While we'd very much like to replay the open_channel flow even if we have already received an accept_channel and funded the channel, we cannot as the peer will likely provide different key material in their accept_channel, causing us to need a different funding transaction.

Thus, here, we simply close channels which have been funded but not yet signed when our peer disconnects.

Replaces #2983 (comment)
Note that this is the same as the version we already landed for 0.0.123, but I was hoping we could do more, but sadly @shaavan pointed out we cannot.

@TheBlueMatt TheBlueMatt added this to the 0.0.124 milestone May 7, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.80%. Comparing base (1d421d3) to head (53cd31a).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3051      +/-   ##
==========================================
- Coverage   89.88%   89.80%   -0.08%     
==========================================
  Files         117      117              
  Lines       96958    96993      +35     
  Branches    96958    96993      +35     
==========================================
- Hits        87146    87106      -40     
- Misses       7268     7323      +55     
- Partials     2544     2564      +20     

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

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

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

LGTM!

I wish we could have done more!
But I am glad, that we were able to introduce at least some level of auto-retryablity for Outbound Channels.

@valentinewallace
Copy link
Contributor

Fuzz is failing. Otherwise this is the same as #3034 so should be able to Just Land.

ddf75af introduced the ability to re-exchange our `ChannelOpen`
after a peer disconnects if we didn't complete funding on our end.
It did not implement nor consider what would happen if we
re-connected after we created our own funding transactions, and
currently it panics (and even if it did not it would replay the
`FundingTransactionGenerated` event to users).

While we'd very much like to replay the `open_channel` flow even
if we have already received an `accept_channel` and funded the
channel, we cannot as the peer will likely provide different key
material in their `accept_channel`, causing us to need a different
funding transaction.

Thus, here, we simply close channels which have been funded but not
yet signed when our peer disconnects.
@TheBlueMatt
Copy link
Collaborator Author

Just needed a rebase.

@TheBlueMatt
Copy link
Collaborator Author

Its just one commit already in a release, merging.

@TheBlueMatt TheBlueMatt merged commit 5d9f3b4 into lightningdevkit:main May 28, 2024
15 of 16 checks passed
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.

None yet

4 participants