Skip to content

Replace hashes_fuzz with local fuzz gates#4551

Draft
joostjager wants to merge 2 commits intolightningdevkit:mainfrom
joostjager:fuzz-real-hash
Draft

Replace hashes_fuzz with local fuzz gates#4551
joostjager wants to merge 2 commits intolightningdevkit:mainfrom
joostjager:fuzz-real-hash

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

@joostjager joostjager commented Apr 10, 2026

Removes the global hashes_fuzz mode and replaces it with small local cfg(fuzzing) exceptions at the specific hash/MAC verification gates that matter for fuzz coverage.

This keeps hashing real by default, updates the few harnesses that depended on fake hashes, and removes the extra hashes_fuzz target/config/CI plumbing. A quick profiling session showed that for chanmon_consistency, real hash usage increases runtime by about 15%, which seems acceptable.

We don’t toggle hashes_fuzz per target because it is a build-time cfg on the whole fuzz crate. Doing that cleanly would require target-specific generator/build logic or splitting targets into separate packages, while local gate exceptions give us the same coverage benefit with much less complexity and a smaller blast radius.

@ldk-reviews-bot
Copy link
Copy Markdown

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 91.11111% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.85%. Comparing base (5704e8e) to head (b386316).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
lightning-liquidity/src/lsps2/utils.rs 66.66% 3 Missing ⚠️
lightning/src/util/fuzz_wrappers.rs 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4551      +/-   ##
==========================================
- Coverage   86.99%   86.85%   -0.15%     
==========================================
  Files         163      163              
  Lines      108635   108703      +68     
  Branches   108635   108703      +68     
==========================================
- Hits        94511    94417      -94     
- Misses      11647    11778     +131     
- Partials     2477     2508      +31     
Flag Coverage Δ
fuzzing 39.28% <37.20%> (-1.03%) ⬇️
tests 86.07% <95.12%> (-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.

2 participants