Repository navigation
plugin-askrene: cap dial iterations to avoid redundant solver runs - #9735
Open
aryarathoree wants to merge 1 commit into
Open
aryarathoree wants to merge 1 commit into
aryarathoree wants to merge 1 commit into
Conversation
Andezion
requested changes
Nov 13, 2026
The retry loop around the solver in linear_routes() repeatedly doubles the odds mu / (1 - mu) when the route fee exceeds maxfee. Previously, the cut-off was set to `near_one = 1. - 1e-6`, requiring 27 retries (28 solver runs) before failing. As reported in ElementsProject#9726: "The 17 added runs are at mu above 0.95, where a run is slower and the fee found changes little or rises... Effect on a mainnet node that rebalances with a tight fee budget, v26.06.10 against v26.06.9: the median rebalance request takes 26 s against 5 s, and 12.8% of them end in the timeout (askrene-timeout 30); none did before." Introduce `max_mu = 0.99` to cap mu iterations while keeping `near_one = 1. - 1e-6` for delay/hop dials and the flow_fee_adjustment fallback. This bounds the maximum number of solver attempts to 15, avoiding the diminishing-returns iterations above mu=0.95 where fee priority is already ~99% and MCF solver passes become significantly more expensive without improving found fees. Fixes ElementsProject#9726 Changelog-Fixed: askrene: bound dial iterations to avoid redundant solver runs when fee exceeds budget.
aryarathoree
force-pushed
the
fix-askrene-mu-cutoff
branch
from
November 13, 2026 16:09
4f03416 to
70226f7
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
As reported in #9726 by @ksedgwic, when no route fits
maxfee,linear_routes()inplugins/askrene/child/mcf.cexecutes 28 solver runs before failing.The 17 runs above (\mu = 0.95) (up to
near_one = 1. - 1e-6) can take up to 10× longer on mainnet nodes without improving the found fees. This frequently causes callers with tight fee budgets (e.g. rebalancers) to hitaskrene-timeout.Solution
Cap
near_oneat0.99. This limits the solver loop to at most 15 runs, cutting off the slow iterations with diminishing returns above (\mu = 0.95) and avoiding unnecessary timeouts.Fixes #9726
Checklist
Changelog-Fixed:).#9726).tools/lightning-downgrade(N/A, internal heuristic).