-
Notifications
You must be signed in to change notification settings - Fork 403
[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. |
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 bothFundedChannel
andPendingV2Channel
are placed behind traits, so they can be combined easily.This PR is more of a proof-of-concept.
Notes:
FundedChannel
methods 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 timeWithContextAndFunding
fromInitialRemoteCommitmentReceiver
, with the original intention thatPendingV2ChannelTrait
would also include it. But this is not the case, asPendingV2ChannelTrait
needs its own funding! So this carve-out is not really needed.My conclusion is that this could be solved in other way:
RefundingChannel
include a fullFundedChannel
, as it is accessed mostly throughas_funded()
methodsPendingV2ChannelTrait
FundedChannel
as it is, no need for trait there