-
Couldn't load subscription status.
- Fork 421
Extend #4138 removing one more macro #4170
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
Extend #4138 removing one more macro #4170
Conversation
In 99df17e we moved the "call style" argument out of `handle_new_monitor_update`, making each an individual macro instead. For the `REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER` call style, we renamed the macro `handle_new_monitor_update_actions_deferred`. That name doesn't really capture the requirements of that incredibly-awkward macro - namely that the actions need to be processed by the caller (rather than just being "deferred" and handled in some automated way later) and that the macro really should only be used when the callsite needs the peer state locks to remain locked, rather than being able to drop them to handle post-update actions. Here we rename it to the (mouthful) `handle_new_monitor_update_locked_actions_handled_by_caller`. Luckily its only used in two places.
It turns out the arguments to track the pushed update index and map weren't necessary, so are removed here.
|
👋 Thanks for assigning @valentinewallace as a reviewer! |
Due to lifetime limitations, our `ChanelMonitorUpdate` handling logic mostly lives in macros. The bulk of the code, though, can easily be moved into an fn, which we do here, reducing the expanded size of the `lightning` crate from 256,061 lines to 253,536 lines.
a43b073 to
faf7238
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4170 +/- ##
==========================================
+ Coverage 87.48% 88.78% +1.30%
==========================================
Files 149 180 +31
Lines 101834 137103 +35269
Branches 101834 137103 +35269
==========================================
+ Hits 89092 121732 +32640
- Misses 10479 12553 +2074
- Partials 2263 2818 +555
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 stuff! 💯
|
👋 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. |
|
Just gonna land this as trivial, its all super mechanical changes. |
#4138 split the monitor updating logic macro and cleaned it up a bit, but it missed that we can actually move the whole
_internalmacro into an fn, which we do here.