Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
routing: probability based path finding #2802
In this PR, several improvements to path finding and mission control are made with the goal to improve the reliability of Lightning payments.
Probability based routing
The previously used edge and node ignore lists in path finding are replaced by a probability based system. It modifies path finding so that it not only compares routes on fee and time lock, but also takes route success probability into account.
Allowing routes to be compared based on success probability is achieved by introducing a 'virtual' cost of a payment attempt and using that to translate probability into an extra cost factor.
Failed route decay time
This PR also extends the decay time of mission control data. It used to be very short which hardly allowed a payment to benefit from outcomes of previous payment attempts. With this PR, the decay time becomes configurable.
Minimum route probability
The payment process stop condition has been adapted to probability based routing. Previously the payment processed stopped when no more routes could be found. This typically happened when all tried edges had been added to the ignore list. With probabilities, every route will always have a non-zero success probability. That probability can be small, but the payment may still succeed via this route.
To prevent the payment process ending up in a loop trying routes that are highly unlikely to succeed until it times out, a minimum required success probability is introduced. Only routes with a probability above this threshold are considered and if there are none, the payment process is stopped.
Query mission control state
A new rpc call has been added to query the internal mission control state. This should give advanced users a tool to better understand why certain routes are chosen.
The main parameters influencing the payment process within
Minimum required route success probability to attempt the payment (default: 0.01)
Assumed success probability of a hop in a route when no other information is available. (default: 0.95)
Defines the duration in minutes after which a penalized node or channel is back at 50% probability (default: 60)
The (virtual) cost in sats of a failed payment attempt (default: 100)
Querying mission control is available through