This is quite a large redesign of the rebalance functionality (related #98). The main changes are:
we now rely on internal pathfinding: this gives more freedom in testing other pathfinding heuristics
we add hints to know which channels have enough capacity, by tracking successful and failed parts of routes
failed nodes are penalized by closeness to the failing hop
the time to forward an HTLC is measured and taken into account for route construction
rebalancing is restructured, the largest change is that we now select the route with the lowest weight (liquidity hints + fees), among all counterparty channels instead of rebalancing counterparty channels one-by-one
the rebalance amount is gradually reduced (split into half) and upon payment success we continue with the amount left to increase rebalance success
counterparty rebalance channels are selected in such a way that a positive future gain is expected (disregarding rebalance costs -- it's possible that it's slightly negative) (can be turned off with the --force flag)
the circle command is removed (there is lncli functionality for this)
tests are added for liquidity hints and the new rebalance command
Steps for completion:
[x] persist liquidity hints
[x] all counterparty channels should get a chance to be tried, by gradually removing already tried counterparty channels from the process
[x] reasonable initial pathfinding heuristics
[x] reflect channel reserve and ctx fees correctly
[x] automatic direction setting and amount sanity check
This is quite a large redesign of the rebalance functionality (related #98). The main changes are:
--force
flag)lncli
functionality for this)Steps for completion: