Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

I noted in review for an unrelated PR that adding more per-channel logic in ChannelManager::get_and_clear_pending_msg_events really sucks for our performance, especially if it ends up hitting a sync monitor persistence. This made me wonder how far we actually are from not needing the holding check_free_holding_cells call that's currently there.

Turns out, at least according to our functional test coverage, the answer is "not very far".

Thus, here we drop it in favor of consistently calling a new util method on channels that might have the ability to release holding cell updates in the same lock where they change state, rather than waiting until get_and_clear_pending_msg_events.

We still process async monitor events in
get_and_clear_pending_msg_events, which can lead to channel (and monitor) updates, but that should only be the case for async persist applications, which then are likely to have fast ChannelMonitorUpdate in-line handling logic (cause its async).

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 17, 2026

I've assigned @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.

I noted in review for an unrelated PR that adding more per-channel
logic in `ChannelManager::get_and_clear_pending_msg_events` really
sucks for our performance, especially if it ends up hitting a sync
monitor persistence. This made me wonder how far we actually are
from not needing the holding `check_free_holding_cells` call that's
currently there.

Turns out, at least according to our functional test coverage, the
answer is "not very far".

Thus, here we drop it in favor of consistently calling a new util
method on channels that might have the ability to release holding
cell updates in the same lock where they change state, rather than
waiting until `get_and_clear_pending_msg_events`.

We still process async monitor events in
`get_and_clear_pending_msg_events`, which can lead to channel (and
monitor) updates, but that should only be the case for async
persist applications, which then are likely to have fast
`ChannelMonitorUpdate` in-line handling logic (cause its async).
@TheBlueMatt TheBlueMatt force-pushed the 2026-01-live-holding-cells branch from d6c4618 to cad88af Compare January 17, 2026 13:27
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 84.78261% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.62%. Comparing base (4281e49) to head (cad88af).

Files with missing lines Patch % Lines
lightning/src/ln/channelmanager.rs 84.78% 14 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4320   +/-   ##
=======================================
  Coverage   86.61%   86.62%           
=======================================
  Files         158      158           
  Lines      102730   102752   +22     
  Branches   102730   102752   +22     
=======================================
+ Hits        88977    89006   +29     
+ Misses      11335    11332    -3     
+ Partials     2418     2414    -4     
Flag Coverage Δ
fuzzing 36.11% <64.04%> (-0.98%) ⬇️
tests 85.91% <84.78%> (+<0.01%) ⬆️

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.

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.

2 participants