Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lnd updatechanpolicy has confusing --help #1523

Open
abrkn opened this issue Jul 8, 2018 · 12 comments · May be fixed by #6778 or #8673
Open

lnd updatechanpolicy has confusing --help #1523

abrkn opened this issue Jul 8, 2018 · 12 comments · May be fixed by #6778 or #8673
Assignees
Labels
beginner Issues suitable for new developers documentation Documentation changes that do not affect code behaviour good first issue Issues suitable for first time contributors to LND help wanted P4 low prio

Comments

@abrkn
Copy link

abrkn commented Jul 8, 2018

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.

@Roasbeef
Copy link
Member

Roasbeef commented Jul 8, 2018

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.

@Roasbeef
Copy link
Member

Roasbeef commented Jul 8, 2018

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.

@Roasbeef
Copy link
Member

Roasbeef commented Jul 8, 2018

You don't need to set a value, if you aren't actually modifying it.

@Roasbeef Roasbeef added documentation Documentation changes that do not affect code behaviour P4 low prio beginner Issues suitable for new developers labels Jul 10, 2018
@ctrlbreak-
Copy link

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?

@dognip
Copy link

dognip commented Jan 4, 2019

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).

@halseth
Copy link
Contributor

halseth commented Jan 8, 2019

Reopen to properly set the default value.

@halseth halseth reopened this Jan 8, 2019
@halseth halseth added help wanted good first issue Issues suitable for first time contributors to LND labels Jan 8, 2019
lundy405 added a commit to lundy405/lnd that referenced this issue Feb 26, 2019
lundy405 added a commit to lundy405/lnd that referenced this issue Feb 26, 2019
Close issue lightningnetwork#1523 - Sane time_lock_delta default
@Chrozayis
Copy link

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.

@plwalters
Copy link
Contributor

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.

$ lncli updatechanpolicy --help

Still lists 0 as the default that is the confusion I think

@SachinMeier
Copy link

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.

@guggero
Copy link
Collaborator

guggero commented Jul 18, 2022

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.

@SachinMeier
Copy link

I opened a PR to fix exactly this. It is very small. Any review is greatly appreciated.
#6762

@AndySchroder
Copy link

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.

@nettijoe96 nettijoe96 linked a pull request Apr 22, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner Issues suitable for new developers documentation Documentation changes that do not affect code behaviour good first issue Issues suitable for first time contributors to LND help wanted P4 low prio
Projects
None yet