-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renepay const prob cost #7540
Renepay const prob cost #7540
Conversation
9fd2d3e
to
da4be80
Compare
@renepickhardt this sounds a lot like the discussion with a multiplicative factor from Monday :-) Could you recap that discussion briefly here? |
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>
I've seen great improvements in the reliability of the payments after adding this and #7548. As a disclaimer, I have not tools to quantify this improvement, that judgement is only based on my tests on mainnet. |
1d19f84
to
67ffd8d
Compare
Rebased to fix conflicts, head is 67ffd8d. |
The probability for a success forward of
x
amount on a channel is nowcomputed as:
where
P_rene(x)
is the probability distribution proposed by @renepickhardtwith 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 chosen 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:
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: