Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

#4138 split the monitor updating logic macro and cleaned it up a bit, but it missed that we can actually move the whole _internal macro into an fn, which we do here.

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.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Oct 24, 2025

👋 Thanks for assigning @valentinewallace as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

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.
@TheBlueMatt TheBlueMatt force-pushed the 2025-10-less-monitor-update-macro branch from a43b073 to faf7238 Compare October 24, 2025 14:35
@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.78%. Comparing base (4c1aa13) to head (faf7238).
⚠️ Report is 2004 commits behind head on main.

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     
Flag Coverage Δ
fuzzing 20.99% <66.66%> (?)
tests 88.63% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! 💯

@ldk-reviews-bot
Copy link

👋 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.

@TheBlueMatt
Copy link
Collaborator Author

Just gonna land this as trivial, its all super mechanical changes.

@TheBlueMatt TheBlueMatt merged commit 81ae784 into lightningdevkit:main Oct 24, 2025
22 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants