fuzz: add explicit chanmon manager persistence commands#4631
fuzz: add explicit chanmon manager persistence commands#4631joostjager wants to merge 3 commits into
Conversation
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
Add chanmon_consistency commands to persist each node's ChannelManager state explicitly. This lets the fuzz target exercise delayed manager persistence instead of checkpointing it after every command.
9bb46a0 to
b33526e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4631 +/- ##
===========================================
+ Coverage 28.02% 86.67% +58.65%
===========================================
Files 126 159 +33
Lines 69960 110568 +40608
Branches 69960 110568 +40608
===========================================
+ Hits 19606 95836 +76230
+ Misses 49020 12213 -36807
- Partials 1334 2519 +1185
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:
|
| } | ||
|
|
||
| fn restart_node(&mut self, node_idx: usize, v: u8, router: &'a FuzzRouter) { | ||
| self.nodes[node_idx].checkpoint_manager_persistence(); |
There was a problem hiding this comment.
Is this a bit fake? Perhaps we should just restart from the latest persisted state, but that also means that payment tracking may be off a bit.
There was a problem hiding this comment.
Yea, I mean this is kinda emulating the behavior we had before where we persist on every iteration, except now we only make sure we persist every time before we read it...Indeed, we'd have to handle the payment tracking parts, though :/.
There was a problem hiding this comment.
I don't think it was quite the same, because we were potentially stacking up monitor writes a bit more. But I added code to handle the payment tracking to make it more realistic.
I really hope we can improve the current persistence model situation soon. Keeping the separate monitor and manager persistence model coherent is such a time sink.
|
No issues found. I reviewed every hunk in the diff, tracing through:
|
Move node-local payment tracking mutations onto NodePayments. Pending and resolved payment state are updated the same way. The owner of that state now owns the helper methods.
Stamp pending payments with the first manager generation. On deferred reload, drop payments born after the loaded snapshot. This keeps tracker state aligned with explicit persistence.
Add chanmon_consistency commands to persist each node's ChannelManager state explicitly. This lets the fuzz target exercise delayed manager persistence instead of checkpointing it after every command.