Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plugins/askrene/child/mcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,10 @@ linear_routes(const tal_t *ctx, struct route_query *rq,
{
/* Almost 1 to limit the dials' iterations. */
const double near_one = 1. - 1e-6;
/* A cut-off at 0.99 avoids excessive iterations in the
* diminishing-returns range above 0.95 where solver runs become
* slower and fee improvements stagnate or degrade (issue #9726). */
const double max_mu = 0.99;
const tal_t *working_ctx = tal(ctx, tal_t);
const char *error_message;
struct amount_msat amount_to_deliver = amount;
Expand Down Expand Up @@ -1710,7 +1714,7 @@ linear_routes(const tal_t *ctx, struct route_query *rq,
goto fail;
}
if (amount_msat_greater(all_fees, partial_feebudget)) {
if (mu < near_one) {
if (mu < max_mu) {
/* all_fees exceed the strong budget limit, try
* to fix it increasing mu. */
mu *= 2;
Expand Down
5 changes: 5 additions & 0 deletions tests/test_askrene.py
Original file line number Diff line number Diff line change
Expand Up @@ -2314,6 +2314,11 @@ def test_excessive_fee_cost(node_factory):
maxparts=1,
)

# Dial iterations cut off once mu >= 0.99, bounding solver runs (issue #9726)
l1.daemon.logs_catchup()
mu_retries = [l for l in l1.daemon.logs if "retrying with mu of" in l]
assert 0 < len(mu_retries) <= 15


def check_getroute_routes(
node,
Expand Down