-
Notifications
You must be signed in to change notification settings - Fork 906
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
Make cltv_expiry for keysends slightly more conservative #4548
Make cltv_expiry for keysends slightly more conservative #4548
Conversation
3147e0e
to
f073422
Compare
Thanks for the proposal @valentinewallace, what's the rationale for bumping this higher? Is it just to add a bit more slack to out-of-sync nodes? And is 22 blocks somehow special? IIRC the final CLTV delta serves two purposes:
|
Thanks for the response @cdecker!
I don't think 22 is particularly special, but yeah, I believe tl;dr the idea is to account for our peer being behind on blocks. Partly, the theory is that this may protect us from channel failures for low-power, slow peers due to HTLC expiration. (More context: in RL, the extra fudge factor is named |
The final CLTV should be configurable (as it is in invoices). Lack of ability for the recipient to control their risk tolerance via the CLTV delta limit is a major shortcoming of keysend (and afaiu lnd actually requires senders to provide it). Obviously forcing it be provided from senders is a pretty terrible UX, but all the more reason to be conservative and provide a CLTV delta that a recipient is likely to support, maybe something more like the BOLT-suggested spec times two or so. |
Yes, keysend is a hack. However, wider interoperability is always good, so changing this to 22 is the Right Thing IMHO. |
Though I'd prefer a decent comment: it should literally be 22 with a comment saying that is the Rust lightning default and the highest we know of. |
f073422
to
ea6c902
Compare
Thanks Rusty, implemented this! |
Oh, and can we have (in the commit message) a Changelog line: Changelog-Changed: (These get auto-generated into our CHANGELOG.md at release). Thanks! |
ea6c902
to
64385ef
Compare
This makes the min_cltv_expiry_delta equal to Rust-Lightning's, which is the highest minimum we know of. Changelog-Changed: keysend now uses 22 for the final CTLV, making it rust-lightning compatible.
64385ef
to
281f21b
Compare
Sorry for the delay, done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack 281f21b
Hi all! I'm working on making Rust-Lightning compatible with CL's keysend.
Would you all be open to a change like this? Rust-Lightning is a bit more conservative than the default 18 for
min_final_cltv_expiry
, so I thought it might be reasonable to make CL use a bit more conservative value too. Let me know what you think.