You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was having a look at the default values of c-lightning for mainnet, and noticed the following:
static const struct config mainnet_config = {
/* ~one day to catch cheating attempts. */
.locktime_blocks = 6 * 24,
/* They can have up to 14 days, maximumu value that lnd will ask for by default. */
/* FIXME Convince lnd to use more reasonable defaults... */
.locktime_max = 14 * 24 * 6,
If I am not mistaken, if a node receives an HTLC to relay with a locktime>locktime_max it will fail by Expiry Too Far. The same will happen if a relay node to_self_delay<locktime_blocks. Therefore, the maximum amount of hops in a route that one can have with these settings are: 14, which does not comply with the 20 hops suggested by BOLT #4.
Also, this could have incompatibility issues with lnd and/or eclair, is this correct?
The text was updated successfully, but these errors were encountered:
locktime_max/locktime_blocks=14, which does not comply with the 20 hops suggested by BOLT #4.
That's not really an issue. Both parameters can be chosen by the operator of the node, according to their own needs, and it would be unreasonable for us to try to allow for arbitrary lock ups. This is already holding user funds locked for 2 weeks.
Allowing 20 hops is also not a requirement by the BOLTs, but a technical parameter chosen for the onion routing packet, which is what that BOLT refers to.
Also, this could have incompatibility issues with lnd and/or eclair, is this correct?
They also enforce an upper timelock limit, pretty much like we do, by chosing a default value that is reasonable. My guess is that they also don't allow 20 days of lockups.
Actually, had another look at it, and my bad, I think c-lightning does indeed support 20 hops. The value locktime_blocks affects cheating attemps, the value that I should have been looking at is cltv_expiry_delta:
/* BOLT #2:
*
* 1. the `cltv_expiry_delta` for channels, `3R+2G+2S`: if in doubt, a
* `cltv_expiry_delta` of 12 is reasonable (R=2, G=1, S=2)
*/
/* R = 2, G = 1, S = 3 */
.cltv_expiry_delta = 14,
which is 14, so c-lightning does indeed support 20 hops. As for other implementations, lnd supports 20 hops too (their locktime_max is 5000 blocks and their cltv_expiry_delta is 144), while eclair supports up to 7 hops (locktime_max= 7 * 144 blocks and their cltv_expiry_delta is 144).
I was having a look at the default values of
c-lightning
for mainnet, and noticed the following:If I am not mistaken, if a node receives an HTLC to relay with a
locktime>locktime_max
it will fail byExpiry Too Far
. The same will happen if a relay nodeto_self_delay<locktime_blocks
. Therefore, the maximum amount of hops in a route that one can have with these settings are:14
, which does not comply with the 20 hops suggested by BOLT #4.Also, this could have incompatibility issues with
lnd
and/oreclair
, is this correct?The text was updated successfully, but these errors were encountered: