[WIP] Askrene: add activation cost to channels #8543
Draft
+49
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this PR we change the topology of the MCF problem to be able to add activation costs to channels.Use cases:- base fees,- constant probability of failure for channels,- reduction in the number of routes as well as their length,With this PR we add a simple approximation to channel activation cost by including a parameter
base_prob
(in the range [0,1])that represents the probability of a channel being online and accepting forward requests.
The activation cost of the channel is linearized by simply assuming an extra cost per arc like:
where T is the total payment amount.
The smaller the value of
base_prob
the less likely our solver will produce long paths or many routes solutions.Hence the caller can tune it to satisfy desired maxparts or maxlength constraints.
For this PR we borrowed the same methodology from renepay #7540.
It addresses one of the points raised in issue #8486.
base_prob
values