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

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.
@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 2 times, most recently from 6a0c9b6 to faa148e Compare April 10, 2025 18:27
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 faa148e to a364073 Compare April 10, 2025 19:00
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