prusnak / suez

Tool for pretty printing and optimizing Lightning Network channels.
GNU General Public License v3.0
78 stars 20 forks source link

corelightning + suez #46

Closed TTK-199837 closed 1 year ago

TTK-199837 commented 1 year ago

Suez was working great for me until recently. I appears to not be able to modify fee rates anymore. I was running an outdated version, and did a git pull to update. Now, I get these errors when running any operation from suez, any idea how to fix it?

Traceback (most recent call last): File "/home/operator/suez/./suez", line 5, in suez(auto_envvar_prefix="SUEZ") File "/home/operator/.cache/pypoetry/virtualenvs/suez-sxIGIty5-py3.10/lib/python3.10/site-packages/click/core.py", line 1137, in call return self.main(args, kwargs) File "/home/operator/.cache/pypoetry/virtualenvs/suez-sxIGIty5-py3.10/lib/python3.10/site-packages/click/core.py", line 1062, in main rv = self.invoke(ctx) File "/home/operator/.cache/pypoetry/virtualenvs/suez-sxIGIty5-py3.10/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/operator/.cache/pypoetry/virtualenvs/suez-sxIGIty5-py3.10/lib/python3.10/site-packages/click/core.py", line 763, in invoke return __callback(args, **kwargs) File "/home/operator/suez/suez.py", line 311, in suez ln = clientsclient File "/home/operator/suez/clnclient.py", line 10, in init self.refresh() File "/home/operator/suez/clnclient.py", line 59, in refresh int(info[0]["htlc_minimum_msat"]), ValueError: invalid literal for int() with base 10: '1000msat'

prusnak commented 1 year ago

What version of CLN are you running? Is it the latest?

TTK-199837 commented 1 year ago

Yes, the latest!

On Wed, Mar 22, 2023, at 10:20 AM, Pavol Rusnak wrote:

What version of CLN are you running? Is it the latest?

— Reply to this email directly, view it on GitHub https://github.com/prusnak/suez/issues/46#issuecomment-1479970121, or unsubscribe https://github.com/notifications/unsubscribe-auth/AND3BCWNG4WB752DQAQFW2LW5MYFNANCNFSM6AAAAAAWD6Q3RQ. You are receiving this because you authored the thread.Message ID: @.***>

prusnak commented 1 year ago

Can you try using "git bisect" to find which commit broke this?

https://git-scm.com/docs/git-bisect

TTK-199837 commented 1 year ago

Hi! I believe the version I was running was before this update:

https://github.com/prusnak/suez/commit/45e16bf1d4b0c77d1d0f42349f1e82c958866711

TTK-199837 commented 1 year ago

I am running suez on nix-bitcoin / nixOS btw

prusnak commented 1 year ago

Can you try "git bisect" like instructed above?

prusnak commented 1 year ago

@lirre8 which version of CLN did you use to test your commit?

TTK-199837 commented 1 year ago

I am going through the bisect process again. I think I might have messed up something, please bear with me.

Removed old messages as to not confuse everyone. Thanks!

TTK-199837 commented 1 year ago

[operator@nixos:~/suez]$ git bisect good bd90bb3a40a3d2592c5b9a5c9602af62fbae75ea is the first bad commit commit bd90bb3a40a3d2592c5b9a5c9602af62fbae75ea Author: Sebastian Andersson sebastianandersson@zoho.eu Date: Sat Mar 4 11:33:34 2023 +0100

Add option to show min and max htlc

clnclient.py | 18 ++++++++++++++++++ lndclient.py | 26 ++++++++++++++++++++++---- suez.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 95 insertions(+), 6 deletions(-)

lirre8 commented 1 year ago

@lirre8 which version of CLN did you use to test your commit?

I've been using v22.11.1, which is not the latest anymore but pretty much up to date. But as I mentioned in https://github.com/prusnak/suez/issues/42#issuecomment-1424497926, it seems like the cln implementation is using fields that have been removed a while ago, so the latest version of cln doesn't work at all..

I should probably have checked that the htlc_minimum_msat was returning the expected value even for older version, sorry for that. So it seems now that neither an old or newer version will work..

I guess we could fix so that htlc_minimum_msat and htlc_maximum_msat works with the older version of cln that was working before that commit. But shouldn't we update it so it works with the latest version?

Note: So what I'm saying here is the you are probably not using the latest version of cln @TTK-199837, can you check the exact version by running lightning-cli --version?

prusnak commented 1 year ago

My goal is to support only the most recent version of CLN. If it's easy to support previous versions, let's do it, but if it's a problem, then let's skip it.

lirre8 commented 1 year ago

I guess it shouldn't be too much problem to add some checks on what fields are available, to support both old and new versions of cln. I can work on a fix for that

TTK-199837 commented 1 year ago

Hi! running lightning-cli --version outputs: v23.02.2

lirre8 commented 1 year ago

OK, so you are on the latest version, I guess I was wrong. But weird that my CLN node has different outputs than yours then, I have to look into that

TTK-199837 commented 1 year ago

Please let me know if there is anything I can help with! Thanks a lot!

I would like to mention again that fee adjustments seem broken... I am using:

poetry run ./suez --client=c-lightning --base-fee 0 --fee-rate 500 --fee-spread 1.8

lirre8 commented 1 year ago

I can't make any sense on why our CLN nodes would return different data. As far as I can tell, my node does it according to the latest docs: https://lightning.readthedocs.io/lightning-listpeers.7.html. If anyone could explain why your node differs in some field names and values I'd be very happy :)

Anyway, it's an easy problem to solve to just add some checks on the fields that differs and handle them accordingly. I have created a PR that works fine for me: https://github.com/prusnak/suez/pull/47

Regarding the issue with fee adjustment, I'm seeing this error after adding some debug logs: Command "setchannelfee" is deprecated. But this is a completely different problem, lets open a separate issue for that: https://github.com/prusnak/suez/issues/48

lirre8 commented 1 year ago

@TTK-199837 The PR was merged, can you pull the latest code from master and check if it's working when you have a chance?

TTK-199837 commented 1 year ago

Working! Thanks a lot!