Add explicit chanmon manager persistence commands
What changed, and why it matters
This change only modifies a fuzz-testing harness (a tool used to automatically find bugs). It adds new test commands that let the fuzzer decide when to save each simulated node's ChannelManager state, instead of automatically saving after every command. There is no change to the actual Lightning Dev Kit library code that real users run, so this commit does not introduce or fix a security issue in production software.
No security action required. This is a test-infrastructure change. Reviewers may optionally verify that the fuzz harness still exercises persistence sufficiently and that the new opcodes are wired correctly.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates fuzz/src/chanmon_consistency.rs. It adds explicit 0x90/0x91/0x92 fuzzer opcodes that call checkpoint_manager_persistence() for individual nodes, and it removes the blanket harness.checkpoint_manager_persistences() call at the end of every fuzz loop iteration. A checkpoint_manager_persistence() call is also added at the start of restart_node. These changes give the fuzz target finer control over persistence timing so it can test delayed-persistence scenarios. No production code paths are altered.
Changed components
fuzz/src/chanmon_consistency.rsInspect captured patch +11 / −2
diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs
index ce14815..95874c3 100644
--- a/fuzz/src/chanmon_consistency.rs
+++ b/fuzz/src/chanmon_consistency.rs
@@ -2860,6 +2860,7 @@ impl<'a, Out: Output + MaybeSend + MaybeSync> Harness<'a, Out> {
}
fn restart_node(&mut self, node_idx: usize, v: u8, router: &'a FuzzRouter) {
+ self.nodes[node_idx].checkpoint_manager_persistence();
match node_idx {
0 => {
self.ab_link.disconnect_for_reload(0, &self.nodes, &mut self.queues);
@@ -3116,6 +3117,16 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
0x88 => harness.nodes[2].bump_fee_estimate(harness.chan_type),
0x89 => harness.nodes[2].reset_fee_estimate(),
+ 0x90 => {
+ harness.nodes[0].checkpoint_manager_persistence();
+ },
+ 0x91 => {
+ harness.nodes[1].checkpoint_manager_persistence();
+ },
+ 0x92 => {
+ harness.nodes[2].checkpoint_manager_persistence();
+ },
+
0xa0 => {
if !cfg!(splicing) {
break 'fuzz_loop;
@@ -3370,8 +3381,6 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
},
_ => break 'fuzz_loop,
}
-
- harness.checkpoint_manager_persistences();
}
harness.finish();
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.