Skip to content

Test generated-route valididty in fuzzing #3728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TheBlueMatt
Copy link
Collaborator

While our router fuzzer is pretty good at hitting internal
assertions in our pathfinder, it doesn't actually do anything to
check that the returned route is valid (or meets the requirements
given to the pathfinder).

Here we add some initial checks covering the feerates of the hops
taken in the returned route.

Currently fails because of lightning/bolts#1249

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Apr 10, 2025

👋 Hi! This PR is now in draft status.
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!

@TheBlueMatt TheBlueMatt marked this pull request as draft April 10, 2025 15:54
@TheBlueMatt TheBlueMatt force-pushed the 2025-04-route-valid-fuzz branch 3 times, most recently from faa148e to a364073 Compare April 10, 2025 19:00
When routing, we have to assign a node counter for the recipient.
When searching for a path to a blinded recipient, we do this by
assigning a node counter to a NUMS pubkey. This should be fine as
there is no known private key corresponding to this NUMS point,
and thus no first-hop or network graph nodes can appear for the
same pubkey.

However, this can fail in fuzzing as the fuzzer can forge valid
signatures for the NUMS pubkey. Thus, here, we adapt the node
counter allocation to issue a node counter without a corresponding
public key when paying to a blinded path.
While our router fuzzer is pretty good at hitting internal
assertions in our pathfinder, it doesn't actually do anything to
check that the returned route is valid (or meets the requirements
given to the pathfinder).

Here we add some initial checks covering the feerates of the hops
taken in the returned route.
@TheBlueMatt TheBlueMatt force-pushed the 2025-04-route-valid-fuzz branch from a364073 to 908c5bc Compare April 28, 2025 18:24
Copy link

codecov bot commented Apr 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.13%. Comparing base (233aa39) to head (908c5bc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3728   +/-   ##
=======================================
  Coverage   89.13%   89.13%           
=======================================
  Files         157      157           
  Lines      123959   123968    +9     
  Branches   123959   123968    +9     
=======================================
+ Hits       110485   110497   +12     
- Misses      10791    10796    +5     
+ Partials     2683     2675    -8     

☔ 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