core-lightning/plugins/renepay
Lagrang3 7056018b15 renepay: add const probability cost
The probability for a success forward of x amount on a channel is now
computed as:

	P_success(x) = b * P_rene(x)

where P_rene(x) is the probability distribution proposed by Rene
Pickhardt with a uniform distribution on the known liquidity of the
channel and 'b' is a new parameter we add in this PR, by the name of
"base probability". The "base probability" represents the probability
for a channel in the network choosen at random to be able to forward at
least 1msat, ie. of being alive, non-depleted and with at least one HTLC
slot. We don't know the value of 'b', but for the moment we assume that
it is 0.98 and use that as default.

As a consequence the probability cost becomes non-linear and non-convex
because of the additional constant term:

	Cost(x) = - log P_success(x)
	        = - log b  -  - log P_rene(x)
		= - log b  +  Cost_rene(x)

We currently don't handle well base fees and neither this additional
"base probability" but we can as a first approximation linearize the
cost function in this way:

	Cost_linear(x) = (- log b)*x  +  Cost_rene_linear(x)

Changelog-Added: renepay: Add a dev parameter to renepay that represents
a constant probability of availability for all channels in the network.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
2024-08-15 16:46:41 +09:30
..
test renepay: add const probability cost 2024-08-15 16:46:41 +09:30
chan_extra.c renepay: a bit more verbose information in logs 2024-05-08 22:32:13 -05:00
chan_extra.h common: promote useful routines from renepay. 2024-08-07 20:35:30 +09: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
disabledmap.c renepay: disabled channels in a map 2024-08-12 22:44:58 -07:00
disabledmap.h renepay: disabled channels in a map 2024-08-12 22:44:58 -07:00
errorcodes.c renepay: minor fixes 2024-05-08 22:32:13 -05:00
errorcodes.h renepay: minor fixes 2024-05-08 22:32:13 -05:00
flow.c renepay: add const probability cost 2024-08-15 16:46:41 +09:30
flow.h renepay: add const probability cost 2024-08-15 16:46:41 +09:30
json.c renepay: review routetracking 2024-08-12 13:27:34 -07:00
json.h renepay: review routetracking 2024-08-12 13:27:34 -07:00
main.c renepay: add const probability cost 2024-08-15 16:46:41 +09:30
Makefile renepay: put global variables into renepayconfig.h 2024-05-23 15:15:57 -05:00
mcf.c renepay: add const probability cost 2024-08-15 16:46:41 +09:30
mcf.h renepay: add const probability cost 2024-08-15 16:46:41 +09:30
mods.c renepay: add a channel filtering paymod 2024-08-12 22:44:58 -07:00
mods.h renepay: payment state machine (mods) 2024-05-08 22:32:13 -05:00
payment.c renepay: add const probability cost 2024-08-15 16:46:41 +09:30
payment.h renepay: add const probability cost 2024-08-15 16:46:41 +09:30
payment_info.h renepay: add const probability cost 2024-08-15 16:46:41 +09:30
payplugin.h renepay: remove unnecessary payment list 2024-08-12 13:27:34 -07:00
renepayconfig.h renepay: small tweak to decay time 2024-08-12 13:17:21 -07:00
route.c renepay: a bit more verbose information in logs 2024-05-08 22:32:13 -05:00
route.h renepay: remove payment from route 2024-05-08 22:32:13 -05:00
routebuilder.c renepay: add const probability cost 2024-08-15 16:46:41 +09:30
routebuilder.h renepay: fix sources 2024-05-08 22:32:13 -05:00
routefail.c renepay: disabled channels in a map 2024-08-12 22:44:58 -07:00
routefail.h renepay: add routefail.c 2024-05-08 22:32:13 -05:00
routetracker.c renepay: disabled channels in a map 2024-08-12 22:44:58 -07:00
routetracker.h renepay: rethink the computed routes storage 2024-08-12 13:27:34 -07:00
uncertainty.c renepay: relax knowledge mod 2024-05-23 15:15:57 -05:00
uncertainty.h renepay: relax knowledge mod 2024-05-23 15:15:57 -05:00