Skip to content

fuzz: Add upgrade/downgrade simulation to chanmon_consistency and fix chacha20 build#4499

Open
Atishyy27 wants to merge 1 commit intolightningdevkit:mainfrom
Atishyy27:feature/fuzzer-upgrade-downgrade
Open

fuzz: Add upgrade/downgrade simulation to chanmon_consistency and fix chacha20 build#4499
Atishyy27 wants to merge 1 commit intolightningdevkit:mainfrom
Atishyy27:feature/fuzzer-upgrade-downgrade

Conversation

@Atishyy27
Copy link
Contributor

Closes #4452

This PR introduces upgrade/downgrade serialization coverage to the chanmon_consistency fuzzer as discussed.

Changes:

  1. Fuzzer Logic: Modified the reload_node closure in chanmon_consistency.rs. Based on a fuzzer input byte, it randomly appends a dummy/unknown odd-type TLV record (0xBADF00D1) to the serialized ChannelManager byte stream before reloading. This simulates loading data written by a newer version, ensuring we don't drop channels on unknown odd TLVs.
  2. Build Fix: Added the missing seek_to_block dummy method to the #[cfg(fuzzing)] block of ChaCha20 in lightning/src/crypto/chacha20.rs. Without this, the fuzzer binaries currently fail to compile on main (Exit Code 1).

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Mar 19, 2026

I've assigned @valentinewallace as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@Atishyy27 Atishyy27 marked this pull request as ready for review March 19, 2026 22:56
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.21%. Comparing base (cb951b4) to head (2358ca7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4499      +/-   ##
==========================================
+ Coverage   86.18%   86.21%   +0.03%     
==========================================
  Files         160      160              
  Lines      107441   107441              
  Branches   107441   107441              
==========================================
+ Hits        92593    92634      +41     
+ Misses      12229    12189      -40     
+ Partials     2619     2618       -1     
Flag Coverage Δ
tests 86.21% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

upgrade/downgrade in chanmon_consistency fuzzer during node reload

2 participants