Skip to content

Log which hop in a path was the most limiting in capacity #3729

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

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

Conversation

TheBlueMatt
Copy link
Collaborator

Its generally rather difficult to debug the pathfinding logic from
a log, and sadly because we cannot feasibly log each step in a
pathfinding search there's relatively few options we have for
improving this.

However, one specific question we occasionally get is "why did the
pathfinder decide to use MPP"? While we similarly cannot
practically log every possible path the pathfinder could have taken
to explain why a specific path which required MPP was taken, we can
at least explain which hop in the path was the most limited, which
we do here.

Based on #3707

This bug was recently surfaced to us by a user who wrote a test where the
sender is attempting to route an MPP payment split across the two channels that
it has with its LSP, where the LSP has a single large channel to the recipient.

Previously this led to a pathfinding failure because our router was not sending
the maximum possible value over the first MPP path it found due to
overestimating the fees needed to cover the following hops. Because the path
that had just been found was not maxxed out, our router assumed that we had
already found enough paths to cover the full payment amount and that we were
finding additional paths for the purpose of redundant path selection. This
caused the router to mark the recipient's only channel as exhausted, with the
intention of choosing more unique paths in future iterations. In reality, this
ended up with the recipient's only channel being disabled and subsequently
failing to find a route entirely.

Update the router to fully utilize the capacity of any paths it finds in this
situation, preventing the "redundant path selection" behavior from kicking in.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Apr 10, 2025

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.

@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @valentinewallace! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Its generally rather difficult to debug the pathfinding logic from
a log, and sadly because we cannot feasibly log each step in a
pathfinding search there's relatively few options we have for
improving this.

However, one specific question we occasionally get is "why did the
pathfinder decide to use MPP"? While we similarly cannot
practically log every possible path the pathfinder could have taken
to explain why a specific path which required MPP was taken, we can
at least explain which hop in the path was the most limited, which
we do here.
@TheBlueMatt TheBlueMatt force-pushed the 2025-04-log-limited-hop branch from 2d41456 to 056d5da Compare April 14, 2025 13:41
Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I assume we'll want to land #3707 first

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.

4 participants