daywalker90 / sling

A core lightning plugin to automatically rebalance multiple channels.
MIT License
15 stars 3 forks source link

Should the plugin work between channels that are not announced? #6

Open 21M4TW opened 1 week ago

21M4TW commented 1 week ago

Hi,

I am trying to rebalance between some of my channels that are not announced ("private") and status_str says "1:NoRoutes". In the log I see "channel not found in graph!" and "could not find a route. Sleeping...". Should this worked between this type of channels, or not? Thanks!

daywalker90 commented 1 week ago

I've actually found a bug preventing rebalances after the first in this scenario, fix will be in next version.

21M4TW commented 1 week ago

I've actually found a bug preventing rebalances after the first in this scenario, fix will be in next version.

Hmm, I just tried v2.1.1 and I get the same error...

21M4TW commented 1 week ago

2024-10-21T11:57:36.800Z DEBUG plugin-sling: 000000x0000x0/1: Spawning job. 2024-10-21T11:57:36.800Z DEBUG plugin-sling: 000000x0000x0: target: 00000 sats 2024-10-21T11:57:36.800Z DEBUG plugin-sling: 000000x0000x0/1: Candidates: 11111x1111x0, 22222x2222x0 2024-10-21T11:57:36.800Z UNUSUAL plugin-sling: 000000x0000x0/1: channel not found in graph! 2024-10-21T11:57:36.800Z INFO plugin-sling: 000000x0000x0/1: could not find a route. Sleeping... 2024-10-21T11:57:36.800Z DEBUG plugin-sling: 000000x0000x0/1: Starting sleeper for 600s

daywalker90 commented 1 week ago

Can you show me the exact command you used to create this job?

21M4TW commented 1 week ago

Can you show me the exact command you used to create this job?

lightning-cli --conf etc/lightningd.conf sling-job -k scid=00000x0000x0 direction=pull amount=1***** maxppm=250 target=1 candidates='["11111x1111x0", "22222x2222x0"]' maxhops=20

(Obviously using my own channel's short IDs. The amount is 25% of the maximum receivable for channel 00000x0000x0). All involved channels are not announced and I don't have any announced channel on my node. I am basically trying to pull all the liquidity for channel 00000x0000x0 on my side. Initially I tried with the default value for maxhops with the same result. Thanks!

21M4TW commented 1 week ago

Just tried the same thing with the rebalance.py plugin. With that other plugin it is able to find a route (I guess it uses a different routing mechanism that does not rely on the presence of remote aliases) and it tries executing the rebalancing. However it fails with the error: htlc 3 failed from 2th node with code 0x400a (WIRE_UNKNOWN_NEXT_PEER)

Edit: Hmm: I just tried using another incoming peer and it went through with the rebalance.py plugin... So there is possibly a peer-related issue on top of this

daywalker90 commented 1 week ago

Every plugin must have the alias for private channels, either local or remote to send or receive. Since you have some remote aliases missing there will be certain rebalances not working. So this makes total sense.

21M4TW commented 1 week ago

Every plugin must have the alias for private channels, either local or remote to send or receive. Since you have some remote aliases missing there will be certain rebalances not working. So this makes total sense.

I am not sure since with rebalance.py, the rebalancing that fails is when the incoming scid is for the only peer that has a remote alias? And it did not prevent rebalance.py from finding a route (it shows me the exact route that will be attempted), it is the actual transaction that failed.

daywalker90 commented 1 week ago

Yes you need the remote alias for receiving so this makes sense. It finds a route with the normal scid but then fails the transaction because its using the scid and not the alias (im guessing).

21M4TW commented 1 week ago

Yes you need the remote alias for receiving so this makes sense. It finds a route with the normal scid but then fails the transaction because its using the scid and not the alias (im guessing).

But what I am saying is that it is the other way around, the transaction that failed with rebalance.py is when I tried a receiving node that had a remote alias. It succeeded when I tried to rebalance between two channels that did not have any remote alias.