-
Notifications
You must be signed in to change notification settings - Fork 421
[Draft] Combine FundedChannel and PendingV2Channel through traits #3702
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
Conversation
|
👋 Thanks for assigning @jkczyz as a reviewer! |
|
🔔 1st Reminder Hey @jkczyz! This PR has been waiting for your review. |
|
🔔 2nd Reminder Hey @jkczyz! This PR has been waiting for your review. |
|
Simpler version created: #3720 |
|
🔔 3rd Reminder Hey @jkczyz! This PR has been waiting for your review. |
jkczyz
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.
Left a review on #3720. Let's discuss both alternatives today.
|
👋 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. |
|
Closing (in favor of simpler version #3720 ) |
The
RefundingChannel-- used by splicing and possibly dual funding -- can acts as both Funded and Pending (depending on the context). To achieve that, in this PR bothFundedChannelandPendingV2Channelare placed behind traits, so they can be combined easily.This PR is more of a proof-of-concept.
Notes:
FundedChannelmethods are substantial but mostly trivial, changing fields into accessorsself.context_mut().somemethod(&self.funded())), those cases were solved by extra local ref variables or obtaining both context and funding at the same timeWithContextAndFundingfromInitialRemoteCommitmentReceiver, with the original intention thatPendingV2ChannelTraitwould also include it. But this is not the case, asPendingV2ChannelTraitneeds its own funding! So this carve-out is not really needed.My conclusion is that this could be solved in other way:
RefundingChannelinclude a fullFundedChannel, as it is accessed mostly throughas_funded()methodsPendingV2ChannelTraitFundedChannelas it is, no need for trait there