giovannizotta / circular

Core Lightning plugin that helps routing nodes rebalance their channels
MIT License
32 stars 7 forks source link

CLN v24: Does this work for anyone? #20

Open ghost opened 4 months ago

ghost commented 4 months ago

I have circular running for a week now on 3 nodes with CLN 24.x.

Log output looks normal, but I cannot rebalance any channels.

Does circular work for anyone?

ctrlbreak- commented 4 months ago

No. I've tried hundreds, if not thousands of manual circular payments with it, and it simply fails. The closest it ever gets is finding a candidate route and apparently initiating payment, but every.single.one. times out after 120seconds. I haven't had the opportunity to dig in further.

giovannizotta commented 4 months ago

The reason why circular often takes a long time to find a path is that it tries all possible paths, starting from the cheapest ones. The issue with that is that those paths are the most likely to be drained already, resulting in a lot of failures. Over time, circular learns which channels are depleted and doesn't try to go through them anymore, resulting in better success.

Doing manual circular rebalances is not recommended, rather the idea is to wrap circular-pull and circular-push in some kind of automation that aims to maintain the desired balance on the channels. That is not offered by the plugin and since I'm not actively maintaining it, I don't plan to work on it, but I know users who have been pretty successful in rebalancing with circular after setting up some automation and turning some knobs.

I recommend to take a look at the commands circular-pull and circular-push instead of using circular directly, since that already has some automation and tries multiple routes in parallel.

If you notice circular tries the same route every time like reported by #19 , that would be a bug. If that's the case, I may take a look to try and fix it.

Impa10r commented 3 days ago

I fixed manual rebalancing in this PR. But push and pull don't seem to do anything:

~$
lcli circular-pull -k inscid=2821409x111x0 amount=2000 splits=2 splitamount=1000 maxppm=100 minoutppm=50 attempts=1 maxhops=8 filluptopercent=0.60 filluptoamount=120000
{
   "rebalance_target": 2000,
   "rebalanced_amount": 0,
   "attempts": 0,
   "time": "0.000s",
   "successes": {}
}

It also fails pytest:

=========================================================================== short test summary info ============================================================================
FAILED tests/test_circular.py::test_circular - pyln.client.lightning.RpcError: RPC call failed: method: circular-push, payload: {'outscid': '105x3x0', 'minoutppm': 0, 'amount': 100000, 'splitamount': 25000, 'maxppm': 1...
ERROR tests/test_circular.py::test_circular - ValueError:

I don't use CLN in production, so don't have motivation to dig deeper. Hope @giovannizotta will find some time.