fuzz: reload monitors with the configured status
What changed, and why it matters
This is a small fix to a fuzzing test harness (a tool used to automatically find bugs), not a fix to the main Lightning library. It changes how a test simulates restarting a node so that the simulated restart matches the configured persistence behavior. There is no indication this affects real users or production code.
No action needed for end users or operators. This is an internal test-harness maintenance change. Reviewers can treat it as a fuzzing correctness improvement.
Security signals we found
Fuzz harness correction only
No changes to cryptographic, networking, or consensus code
No privilege boundary or input validation changes
No vendor security disclosure or advisory present
Evidence from the diff
The commit modifies fuzz/src/chanmon_consistency.rs, a fuzzing harness for channel monitor consistency. Previously, when reloading monitors during a simulated node restart, the harness always used ChannelMonitorUpdateStatus::Completed and then forced the persister to the configured style afterward. The patch makes the replacement persister use self.persistence_style from the start and removes the hardcoded Completed expectation and the subsequent override. This aligns the restart path with the active persistence-style matrix used elsewhere in the fuzzer. No production code paths are changed.
Changed components
fuzz/src/chanmon_consistency.rsInspect captured patch +2 / −10
diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs
index eb89321..85fee5d 100644
--- a/fuzz/src/chanmon_consistency.rs
+++ b/fuzz/src/chanmon_consistency.rs
@@ -1079,9 +1079,7 @@ impl<'a> HarnessNode<'a> {
&mut self, use_old_mons: u8, out: &Out, router: &'a FuzzRouter, chan_type: ChanType,
) {
let logger = Self::build_logger(self.node_id, out);
- // Re-registering monitors during reload reflects data that was already selected from
- // simulated storage, so these startup watch_channel calls should complete immediately.
- let persister = Self::build_persister(ChannelMonitorUpdateStatus::Completed);
+ let persister = Self::build_persister(self.persistence_style);
let chain_monitor = Self::build_chain_monitor(
&self.broadcaster,
&self.fee_estimator,
@@ -1135,14 +1133,8 @@ impl<'a> HarnessNode<'a> {
let manager = <(BlockLocator, ChanMan)>::read(&mut &self.serialized_manager[..], read_args)
.expect("Failed to read manager");
for (channel_id, mon) in monitors.drain() {
- assert_eq!(
- chain_monitor.watch_channel(channel_id, mon),
- Ok(ChannelMonitorUpdateStatus::Completed)
- );
+ assert_eq!(chain_monitor.watch_channel(channel_id, mon), Ok(self.persistence_style));
}
- // Future monitor writes should follow the node's configured persistence style; only the
- // startup watch_channel registration above is forced to Completed.
- *persister.update_ret.lock().unwrap() = self.persistence_style;
self.node = manager.1;
self.monitor = chain_monitor;
self.persister = persister;
Why this scored 14/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.