Remove dead string search in fuzz SearchingOutput
What changed, and why it matters
This commit is a cleanup of a fuzz-testing helper. It removes a wrapper that scanned every log line for a specific error message that no longer exists in the codebase. Because the searched message was already gone, the wrapper served no purpose and only wasted CPU. There is no change to production Lightning code, no user-facing behavior change, and no security fix.
No action required. This is a benign dead-code removal in test/fuzz infrastructure. Reviewers can verify that the removed log message is indeed absent from the production crate and that the fuzz harness still builds and runs.
Security signals we found
No security-relevant change: only fuzz-test infrastructure removed
No modification of consensus, cryptography, networking, or channel state machine logic
No new dependencies, unsafe code, or input handling introduced
Evidence from the diff
The patch deletes the SearchingOutput struct from fuzz/src/chanmon_consistency.rs. That struct wrapped an Output sink, ran std::str::from_utf8(data).unwrap().contains("Outbound update_fee HTLC buffer overflow ...") on every logged line, and set an AtomicBool flag. Several places in the fuzz test then checked out.may_fail.load(...) to decide whether to panic or silently return. The commit removes the wrapper and changes those sites to always panic on unhandled events. The searched log string no longer appears in the lightning crate, so the flag could never be set and the conditional returns were dead code.
Changed components
fuzz/src/chanmon_consistency.rsInspect captured patch +5 / −50
diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs
index 9716190..cdfcb0e 100644
--- a/fuzz/src/chanmon_consistency.rs
+++ b/fuzz/src/chanmon_consistency.rs
@@ -870,8 +870,7 @@ enum ChanType {
}
#[inline]
-pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], underlying_out: Out) {
- let out = SearchingOutput::new(underlying_out);
+pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
let broadcast_a = Arc::new(TestBroadcaster { txn_broadcasted: RefCell::new(Vec::new()) });
let broadcast_b = Arc::new(TestBroadcaster { txn_broadcasted: RefCell::new(Vec::new()) });
let broadcast_c = Arc::new(TestBroadcaster { txn_broadcasted: RefCell::new(Vec::new()) });
@@ -1859,11 +1858,7 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], underlying_out:
// Can be generated as a result of calling `timer_tick_occurred` enough
// times while peers are disconnected
},
- _ => if out.may_fail.load(atomic::Ordering::Acquire) {
- return;
- } else {
- panic!("Unhandled message event {:?}", event)
- },
+ _ => panic!("Unhandled message event {:?}", event),
}
if $limit_events != ProcessMessages::AllMessages {
break;
@@ -1903,13 +1898,7 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], underlying_out:
MessageSendEvent::HandleError { ref action, .. } => {
assert_action_timeout_awaiting_response(action);
},
- _ => {
- if out.may_fail.load(atomic::Ordering::Acquire) {
- return;
- } else {
- panic!("Unhandled message event")
- }
- },
+ _ => panic!("Unhandled message event"),
}
}
push_excess_b_events!(
@@ -1931,13 +1920,7 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], underlying_out:
MessageSendEvent::HandleError { ref action, .. } => {
assert_action_timeout_awaiting_response(action);
},
- _ => {
- if out.may_fail.load(atomic::Ordering::Acquire) {
- return;
- } else {
- panic!("Unhandled message event")
- }
- },
+ _ => panic!("Unhandled message event"),
}
}
push_excess_b_events!(
@@ -2050,13 +2033,7 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], underlying_out:
..
} => {},
- _ => {
- if out.may_fail.load(atomic::Ordering::Acquire) {
- return;
- } else {
- panic!("Unhandled event")
- }
- },
+ _ => panic!("Unhandled event"),
}
}
while nodes[$node].needs_pending_htlc_processing() {
@@ -2879,28 +2856,6 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], underlying_out:
}
}
-/// We actually have different behavior based on if a certain log string has been seen, so we have
-/// to do a bit more tracking.
-#[derive(Clone)]
-struct SearchingOutput<O: Output> {
- output: O,
- may_fail: Arc<atomic::AtomicBool>,
-}
-impl<O: Output> Output for SearchingOutput<O> {
- fn locked_write(&self, data: &[u8]) {
- // We hit a design limitation of LN state machine (see CONCURRENT_INBOUND_HTLC_FEE_BUFFER)
- if std::str::from_utf8(data).unwrap().contains("Outbound update_fee HTLC buffer overflow - counterparty should force-close this channel") {
- self.may_fail.store(true, atomic::Ordering::Release);
- }
- self.output.locked_write(data)
- }
-}
-impl<O: Output> SearchingOutput<O> {
- pub fn new(output: O) -> Self {
- Self { output, may_fail: Arc::new(atomic::AtomicBool::new(false)) }
- }
-}
-
pub fn chanmon_consistency_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
do_test(data, out);
}
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.