fuzz: assert no stuck payments in chanmon_consistency
What changed, and why it matters
This commit adds a new safety check inside a fuzz test, not a fix to production code. After simulating many random payment scenarios, the test now verifies that no simulated payments remain unresolved. It does not change how real Lightning payments are handled, nor does it patch any known bug. It is a test-hardening change that makes the fuzzer more likely to catch future bugs.
No action required for deployment. Treat as normal test/quality improvement. If the project runs continuous fuzzing, monitor for new assertion failures that could reveal latent payment-resolution bugs.
Security signals we found
Adds assertion in fuzz test for payment resolution completeness
No production code or cryptographic logic changed
No memory safety, input validation, or authorization changes
Co-authored by an AI assistant (Claude Opus 4.5)
Evidence from the diff
The change adds an assertion in fuzz/src/chanmon_consistency.rs after all pending events have been processed at the end of a fuzz run. It iterates over pending_payments for every simulated node and fails the test if any entries remain. This is purely an instrumentation improvement to the chanmon_consistency fuzz target; no runtime, protocol, or cryptographic logic is modified.
Changed components
fuzz/src/chanmon_consistency.rsInspect captured patch +10 / −0
diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs
index 95e7506..c8aaf12 100644
--- a/fuzz/src/chanmon_consistency.rs
+++ b/fuzz/src/chanmon_consistency.rs
@@ -2548,6 +2548,16 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
process_all_events!();
+ // Verify no payments are stuck - all should have resolved
+ for (idx, pending) in pending_payments.borrow().iter().enumerate() {
+ assert!(
+ pending.is_empty(),
+ "Node {} has {} stuck pending payments after settling all state",
+ idx,
+ pending.len()
+ );
+ }
+
// Finally, make sure that at least one end of each channel can make a substantial payment
for &scid in &chan_ab_scids {
assert!(
Why this scored 12/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.