Skip to content

Commit e234c03

Browse files
committed
askrene: don't *completely* ignore fees to start.
I noticed that increasing mu a little bit sometimes made a big difference, because by completely ignoring fees we were choosing the worst of two channels in some cases. Start at 1% fees; this saves a lot on initial fees in this test! Here's the new stats on mu levels: 96 mu=1 90 mu=10 41 mu=20 30 mu=30 24 mu=40 19 mu=50 22 mu=60 8 mu=70 95 mu=80 19 mu=90 Signed-off-by: Rusty Russell <[email protected]> Changelog-EXPERIMENTAL: `askrene` is now better at finding low-fee paths.
1 parent 6d2455e commit e234c03

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

plugins/askrene/askrene.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ static const char *get_routes(const tal_t *ctx,
399399

400400
delay_feefactor = 1.0/1000000;
401401

402-
/* First up, don't care about fees. */
403-
mu = 0;
402+
/* First up, don't care about fees (well, just enough to tiebreak!) */
403+
mu = 1;
404404
flows = minflow(rq, rq, srcnode, dstnode, amount,
405405
mu, delay_feefactor);
406406
if (!flows) {
@@ -435,7 +435,10 @@ static const char *get_routes(const tal_t *ctx,
435435
while (amount_msat_greater(flowset_fee(rq->plugin, flows), maxfee)) {
436436
struct flow **new_flows;
437437

438-
mu += 10;
438+
if (mu == 1)
439+
mu = 10;
440+
else
441+
mu += 10;
439442
rq_log(tmpctx, rq, LOG_UNUSUAL,
440443
"The flows had a fee of %s, greater than max of %s, retrying with mu of %u%%...",
441444
fmt_amount_msat(tmpctx, flowset_fee(rq->plugin, flows)),

tests/test_askrene.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,4 +992,4 @@ def test_real_data(node_factory, bitcoind):
992992
if len(fees[n]) > len(fees[best]):
993993
best = n
994994

995-
assert (len(fees[best]), len(improved), total_first_fee, total_final_fee, percent_fee_reduction) == (9, 96, 19961361, 650099, 97)
995+
assert (len(fees[best]), len(improved), total_first_fee, total_final_fee, percent_fee_reduction) == (9, 96, 9451780, 650099, 94)

0 commit comments

Comments
 (0)