mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-23 23:06:44 +01:00
The "path_score" callback was supposed to evaluate the *entire path*, but that was counter-intuitive and opened the door to a cost function bug which caused this path cost to be less than the closer path. In particular, the capacity bias code didn't understand this at all. 1. Rename the function to `channel_score` and remove the "distance" parameter (always "1" since you're supposed to be evaluating a single hop). 2. Rename "cost" to the more specific "fee": "score" is our actual cost function result (we avoid the word "cost" as it may get confused with satoshi amounts). 3. For capacity biassing, we do want to know the amount, but explicitly hand that as a separate parameter "total". 4. Fix a minor bug where total handed to scoring function previously included channel fee (this is wrong: fee is paid before sending into channel). 5. Remove the now-unused total_delay member from the dijkstra struct. Here are the results of our test now (routing 4194303 msat, which didn't crash the old code, so we could compare). In both cases we could find routes to 615 nodes: Linear success probability (when found): min-max(mean +/- stddev) Before: 0.484764-0.999750(0.9781+/-0.049) After: 0.487040-0.999543(0.952548+/-0.075) Hops: Before: 1-5(2.13821+/-0.66) After: 1-5(2.98374+/-0.77) Fees: Before: 0-50041(2173.75+/-5.3e+03) After: 0-50848(922.457+/-2.7e+03) Delay (blocks): Before: 0-294(83.1642+/-68) After: 0-196(65.8081+/-60) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Fixes: https://github.com/ElementsProject/lightning/issues/7092 Changelog-Fixed: Plugins: `pay` would occasionally crash on routing. Changelog-Fixed: Plugins: `pay` route algorithm fixed and refined to balance fees and capacity far better. |
||
---|---|---|
.. | ||
bkpr | ||
clnrest | ||
examples | ||
grpc-plugin | ||
renepay | ||
spender | ||
src | ||
test | ||
.gitignore | ||
autoclean.c | ||
bcli.c | ||
Cargo.toml | ||
chanbackup.c | ||
commando.c | ||
fetchinvoice.c | ||
funder.c | ||
funder_policy.c | ||
funder_policy.h | ||
keysend.c | ||
libplugin-pay.c | ||
libplugin-pay.h | ||
libplugin.c | ||
libplugin.h | ||
Makefile | ||
offers.c | ||
offers.h | ||
offers_inv_hook.c | ||
offers_inv_hook.h | ||
offers_invreq_hook.c | ||
offers_invreq_hook.h | ||
offers_offer.c | ||
offers_offer.h | ||
pay.c | ||
README.md | ||
recover.c | ||
sql.c | ||
topology.c | ||
txprepare.c |
Plugin Directory
Any file in this directory which is executable and whose name only consists of alphanumeric characters, space, '.', '-' or '_' will be automatically loaded when lightningd starts (unless suppressed with commandline options).