-
Notifications
You must be signed in to change notification settings - Fork 977
Closed
Description
Currently, riskfactor is intended to provide variations on the route returned by the routing algorithm. However, as riskfactor is applied to all nodes uniformly during routing algorithm, and so I suspect does not give significant route randomization.
Instead, we can do better route randomization by the below:
- Accept a randomization seed (which we hash) and an inefficiency parameter (0.0 -> 1.0).
- For each node connection, concatenate the short channel ID and the randomization seed, and hash the concatenation, then seed an RNG. The RNG computes a single double (
rand_double) in the range (0.0 -> 1.0). - When computing
risk_fee, multiply the current return value by(1.0 - inefficiency + (2.0 * inefficiency * rand_double)).
The effects are:
- If
inefficiencyis 0.0, same behavior as current algorithm. - Higher
inefficiencyleads to potentially higher fees as we are distorting the weight by larger amount, potentially treating exorbitant hops as cheap hops. - If no routing failure reports and new gossip messages, then the same seed and inefficiency parameters will return the same route.
This is also potentially useful for AMP; if we decide to split a payment to a destination supporting AMP we can generate some acceptable inefficiency, then generate some random seeds and try getting multiple routes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels