lnd
lnd copied to clipboard
lnd updatechanpolicy has confusing --help
Background
lncli updatechanpolicy
states that the default --time_lock_delta
is 0
:
--time_lock_delta value the CLTV delta that will be applied to all forwarded HTLCs (default: 0)
However:
lncli updatechanpolicy --fee_rate 0.001 --base_fee_msat 100000 --time_lock_delta 0```
results in
[lncli] rpc error: code = Unknown desc = time lock delta of 0 is too small, minimum supported is 4
### Your environment
lncli version 0.4.2 commit=a0b2fadea35fa4642daf4e9f56e6ecfe31d22ce1
### Steps to reproduce
lncli updatechanpolicy --fee_rate 0.001 --base_fee_msat 100000 --time_lock_delta 0```
Expected behaviour
Unsure
Actual behaviour
Error. See above.
You can't have a value of 0 for the CLTV delta. If you did, then you'd be exposed to losing funds on each HTLC you forward, as a race condition is introduced if you ever need to go to the chain for an outgoing HTLC.
That's the default value for the cli, not lnd
default values. You can see the default values for those fields at lnd -h
:
--bitcoin.minhtlc= The smallest HTLC we are willing to forward on our channels, in millisatoshi (default: 1000)
--bitcoin.basefee= The base fee in millisatoshi we will charge for forwarding payments on our channels (default: 1000)
--bitcoin.feerate= The fee rate used when forwarding payments on our channels. The total fee charged is basefee + (amount * feerate / 1000000), where amount is the forwarded amount. (default: 1)
--bitcoin.timelockdelta= The CLTV delta we will subtract from a forwarded HTLC's timelock value (default: 144)
We don't display these values there as it would require lncli
to read the config for lnd
to see if they user has modified these values.
You don't need to set a value, if you aren't actually modifying it.
Came here to report the following. Unfortunately, I don't believe you can actually omit the argument:
lnd@LNDMainnet:~$ lncli updatechanpolicy --base_fee_msat=1999 --fee_rate=0.000042
[lncli] time_lock_delta argument missing
... if you refer to the lncli help and try to specify the stated default, it won't let you. Perhaps simply update the lncli help to refer to a sane default value of 144?
agree with ctrlbreak, you can't leave it blank and it tries to prompt you to 0... As an aside, a fee rate of 0.000042 is actually 0.000000000042 satoshis per satoshi sent correct? Am I understanding this correctly? I have mine at 1000, which if I'm correct means I earn 1 satoshi for every 1000 satoshi relayed (ignoring base fee).
Reopen to properly set the default value.
I'd like to add that better documentation around time_lock_delta is sorely needed. I've been running a node for a few months and done a bunch of reading on LN (although I haven't gotten to the BOLTs yet). I still have almost no clue what time_lock_delta does and I am totally lost at how to decide on a good value for it. The default is 144, lightningwiki.net recommends 10 and otherwise all I know is that it can't be 0.
That's the default value for the cli, not
lnd
default values. You can see the default values for those fields atlnd -h
:--bitcoin.minhtlc= The smallest HTLC we are willing to forward on our channels, in millisatoshi (default: 1000) --bitcoin.basefee= The base fee in millisatoshi we will charge for forwarding payments on our channels (default: 1000) --bitcoin.feerate= The fee rate used when forwarding payments on our channels. The total fee charged is basefee + (amount * feerate / 1000000), where amount is the forwarded amount. (default: 1) --bitcoin.timelockdelta= The CLTV delta we will subtract from a forwarded HTLC's timelock value (default: 144)
We don't display these values there as it would require
lncli
to read the config forlnd
to see if they user has modified these values.
$ lncli updatechanpolicy --help
Still lists 0 as the default that is the confusion I think
I am interested in picking this one up. It seems to me that if the flag is not set, the value should not be changed, rather than setting a default value for the flag at the CLI level. If this is not what's desired, please let me know.
I think the confusing default values were removed a while ago. What remains is an inconvenience with the CLI library that we use for lncli
, where the default value of a flag is printed (now it prints (default: 0)
for most flags) and not the actual default value that lnd
uses. The default value of 0 on the CLI just means "if there's a 0 we assume the user didn't set the flag).
One option would be to use cli.StringFlag
everywhere and manually parsing the numbers, that would remove the text (default: 0
) from the help text.
I opened a PR to fix exactly this. It is very small. Any review is greatly appreciated. https://github.com/lightningnetwork/lnd/pull/6762
Some more confusion on help:
https://docs.lightning.engineering/lightning-network-tools/lnd/channel-fees suggests that I can update things independently, but I can't. For example, if I just want to update the fee rate with --fee_rate
, I get
[lncli] base_fee_msat argument missing
then if I also add the base fee with --base_fee_msat
, I get
[lncli] time_lock_delta argument missing
.
It seems as though -time_lock_delta
, --base_fee_msat
, and --fee_rate
must all be passed at the same time, they can't be set independently.