Skip to content
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

Don't over-penalize channels with inflight HTLCs #3356

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

Conversation

jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Oct 10, 2024

Commit df52da7 modified ProbabilisticScorer to apply some penalty amount multipliers (e.g., liquidity_penalty_amount_multiplier_msat) to the total amount flowing over the channel (i.e., including inflight HTLCs), not just the payment in question. This led to over-penalizing in-use channels. Instead, only apply the total amount when calculating success probability.

Fixes #3271

Commit df52da7 modified
ProbabilisticScorer to apply some penalty amount multipliers (e.g.,
liquidity_penalty_amount_multiplier_msat) to the total amount flowing
over the channel (i.e., including inflight HTLCs), not just the payment
in question. This led to over-penalizing in-use channels. Instead, only
apply the total amount when calculating success probability.
@jkczyz
Copy link
Contributor Author

jkczyz commented Oct 10, 2024

Unclear why this change causes routing::router::tests::avoids_saturating_channels to fail.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Code changes lgtm except the one comment.

lightning/src/routing/scoring.rs Show resolved Hide resolved
Commit df52da7 modified
ProbabilisticScorer to apply some penalty amount multipliers to the
total amount flowing over the channel. However, the commit updated the
docs for base_penalty_amount_multiplier_msat even though that behavior
didn't change. This commit reverts those docs.
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.

In-flight amounts get calculated as a part of the per-hop-per-amount penalty when scoring a channel
2 participants