lightningd / plugins

Community curated plugins for core-lightning
BSD 3-Clause "New" or "Revised" License
269 stars 129 forks source link

feeadjuster not adjusting fees #456

Closed carboncls closed 1 month ago

carboncls commented 1 year ago
"name": "/home/user/plugins/feeadjuster/feeadjuster.py",
"active": true,
"dynamic": true

The plugin is up and running, but isn't doing anything. On CLN 23.05

cdecker commented 1 year ago

Any log lines you can share with us? It is using channel changes as its signal, so if there are no changes it won't adjust the fees.

sturles commented 1 year ago

I have the same problem. Here is a log from starting up:

2023-08-31T14:01:47.876Z INFO    plugin-feeadjuster.py: Traceback (most recent call last):
2023-08-31T14:01:47.876Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/plugin.py\", line 639, in _dispatch_request
2023-08-31T14:01:47.876Z INFO    plugin-feeadjuster.py:     result = self._exec_func(method.func, request)
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/plugin.py\", line 619, in _exec_func
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:     ret = func(*ba.args, **ba.kwargs)
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/clientplugin.py\", line 961, in _init
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:     return self._exec_func(self.child_init, request)
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/clientplugin.py\", line 619, in _exec_func
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:     ret = func(*ba.args, **ba.kwargs)
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:   File \"/home/s/src/plugins/feeadjuster/feeadjuster.py\", line 329, in init
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:     config = plugin.rpc.listconfigs()
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/lightning.py\", line 922, in listconfigs
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:     return self.call(\"listconfigs\", payload)
2023-08-31T14:01:47.877Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/lightning.py\", line 384, in call
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     resp, buf = self._readobj(sock, buf)
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/lightning.py\", line 312, in _readobj
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     obj, _ = self.decoder.raw_decode(parts[0].decode(\"UTF-8\"))
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:   File \"/usr/lib/python3.7/json/decoder.py\", line 353, in raw_decode
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     obj, end = self.scan_once(s, idx)
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/lightning.py\", line 494, in millisatoshi_hook
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     obj = LightningRpc.LightningJSONDecoder.replace_amounts(obj)
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/lightning.py\", line 485, in replace_amounts
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     obj[k] = Millisatoshi(v)
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/lightning.py\", line 60, in __init__
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     \"Millisatoshi must be string with msat/sat/btc suffix or\"
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py: TypeError: Millisatoshi must be string with msat/sat/btc suffix or int
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py: 
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     obj[k] = Millisatoshi(v)
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:   File \"/home/s/.local/lib/python3.7/site-packages/pyln/client/lightning.py\", line 60, in __init__
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py:     \"Millisatoshi must be string with msat/sat/btc suffix or\"
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py: TypeError: Millisatoshi must be string with msat/sat/btc suffix or int
2023-08-31T14:01:47.878Z INFO    plugin-feeadjuster.py: 

The command "lightning-cli feeadjust" hangs doing nothing. strace shows it hanging here:

connect(3, {sa_family=AF_UNIX, sun_path="lightning-rpc"}, 110) = 0
getpid()                                = 40337
getpid()                                = 40337
write(3, "{\"jsonrpc\":\"2.0\",\"method\":\"notifications\",\"id\":\"cli:notifications#40337\",\"params\":{\"enable\":true}}", 98) = 98
read(3, "{\"jsonrpc\":\"2.0\",\"id\":\"cli:notifications#40337\",\"result\":{}}\n\n", 100) = 62
write(3, "{ \"jsonrpc\" : \"2.0\", \"method\" : \"feeadjust\", \"id\" : \"cli:feeadjust#40337\", \"params\" :[ ] }", 90) = 90
read(3, 
chrisguida commented 1 month ago

Fixed in

https://github.com/lightningd/plugins/pull/525