Skip to content

Conversation

@joostjager
Copy link
Contributor

@joostjager joostjager commented Feb 4, 2026

Add force-close fuzzing support to chanmon_consistency. Two new actions (0xc0, 0xc1) allow force-closing one channel on each peer pair (A-B and B-C), testing channel monitor consistency when channels are intentionally closed.

🚧 Work in progress - More checks need to be added to verify channel state consistency after force-close, particularly around monitor update handling and interaction with pending HTLCs.

@ldk-reviews-bot
Copy link

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@joostjager joostjager self-assigned this Feb 5, 2026
Add two new fuzzer actions (0xc0, 0xc1) to force-close one channel
on each peer pair (A-B and B-C). This tests channel monitor
consistency when channels are intentionally closed.

Changes:
- Add fc_ab/fc_bc bools to track force-closed channels
- Handle HandleError, BroadcastChannelUpdate, and ChannelClosed
  events generated by force-close
- Update test_return! macro to account for closed channels
- Skip force-closed channels in 0xff validation

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.04%. Comparing base (4deb2f7) to head (97e65bc).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4381   +/-   ##
=======================================
  Coverage   86.03%   86.04%           
=======================================
  Files         156      156           
  Lines      103141   103141           
  Branches   103141   103141           
=======================================
+ Hits        88739    88748    +9     
+ Misses      11890    11879   -11     
- Partials     2512     2514    +2     
Flag Coverage Δ
tests 86.04% <ø> (+<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.

},
events::Event::SplicePending { .. } => {},
events::Event::SpliceFailed { .. } => {},
events::Event::ChannelClosed { .. } => {},
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably open a new channel to replace the force closed one?


// Only check for no broadcasts if no force-closes happened.
if !fc_ab && !fc_bc {
assert!(broadcast.txn_broadcasted.borrow().is_empty());
Copy link
Contributor

Choose a reason for hiding this comment

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

I have some changes that will be going up soon that rework this, you may want to wait until then. Each node will have its own broadcaster, and there's also a concept of a "chain" now so we can mine transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants