Open sr-gi opened 1 year ago
It should be noted that this is not cln-plugin
-related, rather it is the lightning-cli
misidentifying the IP address as a float, thus omitting the "
quotes and therefore producing invalid JSON.
We need to update the type-inference in lightning-cli
to fix this, and it should already work correctly when called via anything else that returns valid JSON messages.
Looks like IP addresses passed to
lightning-cli
throughcln-plugin
are interpreted as numbers instead of strings, making the plugin manager fail to parse them and, therefore, crashing the plugin.This applies to all possible ways to pass the argument as long it is passed by itself, that is, by position and by key, but not formatted in a string with other values such as
"id@ip:port"
.Notice this does not only apply to IPs, but also to any value formatted like
x.y.z
where {x, y, z} $\in N$. The reason seems to be that the backend interpretsx.
as a number, no matter what comes after.How to reproduce
This can be easily tested by passing an IP to
lightning-cli
using a plugin that uses the rustlang plugin library. You can find a minimal reproducible example at: https://github.com/sr-gi/cln-passip.In order to reproduce this you simply need to add
cln-passip
as a plugin and call:Or any other combination of dotted values provided the expression has more than one dot.