-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[MILLI]: Introduce and use ChannelParty #8951
[MILLI]: Introduce and use ChannelParty #8951
Conversation
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
e0bd5d3
to
7a7e833
Compare
01c3cb9
to
fe1ec1d
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.
Great refactor, can already feel the boolean-related anxiety draining away 🤩
Thanks for splitting up into subsystems, well worth the few additional temporary LOC to stitch the boundaries together for the improved readability (imo, at least)!
Linter still unhappy (looks like something needs a format?). Looks like there's a nasty rebase in your future, will take a final look once that's done.
fe1ec1d
to
85fd82c
Compare
This commit introduces a ChannelParty type to LND. It is useful for consolidating all references to the duality between the local and remote nodes. This is currently handled by having named struct rows or named boolean parameters, named either "local" or "remote". This change alleviates the programmer from having to decide which node should be bound to `true` or `false`. In an upcoming commit we will change callsites to use this.
Also in this commit is a small adjustment to the call-sites to get the boundaries stitched back together.
We also include changes to contractcourt, htlcswitch and peer to stitch the boundaries together.
85fd82c
to
1f9cac5
Compare
Should be good now. 🫡 |
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.
LGTM 🎗️
Change Description
This PR introduces a new fundamental type ChannelParty for the purposes of disambiguating all of the Local/Remote/Incoming/Outgoing stuff found throughout the codebase. This will reduce incidence of boolean blindness and will compose well with other additions later on.
Steps to Test
make unit pkg=lnwallet
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.