core-lightning/plugins/renepay
Rusty Russell e50539d852 pay: ignore fees on our own channels when determining routing.
I noticed that run-route-infloop chose some worse-looking paths after
routing was fixed, eg the second node:

Before:
	Destination node, success, probability, hops, fees, cltv, scid...
	02b3aa1e4ed31be83cca4bd367b2c01e39502cb25e282a9b4520ad376a1ba0a01a,1,0.991856,2,1004,40,2572260x39x0/1,2131897x45x0/0

After:
	Destination node, success, probability, hops, fees, cltv, scid...
	02b3aa1e4ed31be83cca4bd367b2c01e39502cb25e282a9b4520ad376a1ba0a01a,1,0.954540,3,1046,46,2570715x21x0/1,2346882x26x14/1,2131897x45x0/0

This is because although the final costs don't reflect it, routing was taking
into account local channels, and 2572260x39x0/1 has a base fee of 2970.

There's an easy fix: when we the pay plugin creates localmods for our
gossip graph, add all local channels with delay and fees equal to 0.
We do the same thing in our unit test.  This improves things across
the board:

Linear success probability (when found): min-max(mean +/- stddev)
	Before: 0.487040-0.999543(0.952548+/-0.075)
	After:  0.486985-0.999750(0.975978+/-0.053)

Hops:
	Before: 1-5(2.98374+/-0.77)
	After:  1-5(2.09593+/-0.63)

Fees:
	Before: 0-50848(922.457+/-2.7e+03)
	After:  0-50041(861.621+/-2.7e+03)

Delay (blocks):
	Before: 0-196(65.8081+/-60)
	After:  0-190(60.3285+/-60)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Plugins: `pay` route algorithm doesn't bias against our own "expensive" channels any more.
2024-03-07 14:09:14 +01:00
..
test renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
dijkstra.c plugins/renepay/dijkstra: improve API to remove global. 2023-07-31 12:58:56 +09:30
dijkstra.h plugins/renepay/dijkstra: improve API to remove global. 2023-07-31 12:58:56 +09:30
flow.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
flow.h renepay: flow routes limited by htlc_max/min 2024-02-02 11:28:47 +01:00
Makefile plugins/renepay: use gossmods_from_listpeerchannels instead of private gossip_store records. 2023-12-14 09:16:56 +10:30
mcf.c fixed source (using raw millisatohis) 2024-02-02 11:28:47 +01:00
mcf.h error handling in mcf.c 2024-01-22 15:10:08 +10:30
pay.c pay: ignore fees on our own channels when determining routing. 2024-03-07 14:09:14 +01:00
pay.h remove amount_accumulate and amount_reduce 2024-01-22 15:10:08 +10:30
pay_flow.c renepay bug fix: list previous sendpays 2024-02-16 14:51:14 +01:00
pay_flow.h renepay: remove custom debug, in favor of normal operations. 2023-09-25 13:59:13 +09:30
payment.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
payment.h renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
uncertainty_network.c renepay: accomodate fees in the payment flow 2024-01-29 10:48:24 +10:30
uncertainty_network.h plugins/renepay: use gossmods_from_listpeerchannels instead of private gossip_store records. 2023-12-14 09:16:56 +10:30