Open optout21 opened 5 days ago
Preferably we should get this in before further substantial dual funding or splicing changes
Thanks!
Discussed this @jkczyz in some calls, makes sense and agree with moving the enum inward effectively. Happy to prioritise this as it will reduce match
ing hell in ChannelManager
where this phase stuff never really belonged, but just need to review implementation first. At first glance it seems to create even more indirection. That's fine if it's temporary and cleans up ChannelManager
now already. I'll do some more in-depth review.
At first glance it seems to create even more indirection. That's fine if it's temporary and cleans up
ChannelManager
now already. I'll do some more in-depth review.
Please note that this is not complete, but only the basic change to the map, further steps are possible (as noted in description). Various handling logic in ChannelManager
(of type match channel.phase()
) can be moved into Channel
, where it can inspect its own phase.
Yes, more encapsulation sometimes goes with more indirection.
Please note that this is not complete, but only the basic change to the map, further steps are possible (as noted in description). Various handling logic in
ChannelManager
(of typematch channel.phase()
) can be moved intoChannel
, where it can inspect its own phase. Yes, more encapsulation sometimes goes with more indirection.
Sounds good! :) I wasn't too worried about the extra wrapper, just wanted to get the bigger picture of its specific use.
Attention: Patch coverage is 71.03275%
with 115 lines
in your changes missing coverage. Please review.
Project coverage is 89.21%. Comparing base (
0c31021
) to head (a8f83dc
).
Files with missing lines | Patch % | Lines |
---|---|---|
lightning/src/ln/channelmanager.rs | 68.22% | 91 Missing and 18 partials :warning: |
lightning/src/ln/channel.rs | 86.36% | 5 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
We may as well do this now. At very least the rename.
The rename of Channel
would create a rather large diff, that's why I was a bit hesitant to do it right away. Considering.
The rename of
Channel
would create a rather large diff, that's why I was a bit hesitant to do it right away. Considering.
I don't think Channel
is used in that many places. Definitely fewer than ChannelPhase
, which you are already changing to ChannelWrapper
here. Would be less churn that way.
Rationale:
Changes in this PR:
ChannelWrapper
struct to wrap aChannelPhase
ChannelManager.channel_by_id
map holdsChannelWrapper
structs, as opposed toChannelPhase
enumsNext steps:
Channel
->FundedChannel
andChannelWrapper
->Channel
Channel
(channel wrapper), that dispatch into different phases.