Skip to content
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

rebalance overhaul: internal pathfinding, economic counterparties #109

Merged
merged 15 commits into from
Feb 22, 2022

Conversation

bitromortac
Copy link
Owner

@bitromortac bitromortac commented Feb 4, 2022

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:

  • persist liquidity hints
  • all counterparty channels should get a chance to be tried, by gradually removing already tried counterparty channels from the process
  • reasonable initial pathfinding heuristics
  • reflect channel reserve and ctx fees correctly
  • automatic direction setting and amount sanity check
  • track elapsed time until fail/success
  • pubkey-based channel selection
  • response-time penalty
  • think about negative gain
  • update readme
  • forget hints after some time

* we now rely on internal pathfinding
* liquidity hints: we add hints to know which channels have enough
  capacity
* rebalancing is restructured, the largest change is that we now select
  the route with the lowest weight, among all counterparty channels
* counterparty rebalance channels are selected for resulting a in a
  future expected gain
* the circle command is removed
* tests are added for liquidity hints and the new rebalance command
@bitromortac bitromortac merged commit 50a8997 into master Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant