-
Notifications
You must be signed in to change notification settings - Fork 438
fuzz: add force-close support to chanmon_consistency #4381
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
base: main
Are you sure you want to change the base?
Conversation
|
👋 Hi! I see this is a draft PR. |
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]>
081de37 to
97e65bc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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:
|
| }, | ||
| events::Event::SplicePending { .. } => {}, | ||
| events::Event::SpliceFailed { .. } => {}, | ||
| events::Event::ChannelClosed { .. } => {}, |
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.
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()); |
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.
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.
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.