Repository navigation
Conversation
receive_for_hash always requested LDK's minimum final CLTV expiry delta, leaving a user that has to obtain the preimage from elsewhere no way to ask the payer for more time before the HTLC is failed back. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
I've assigned @tnull as a reviewer! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
receive_for_hashalways requests LDK's minimum final CLTV expiry delta. A node that registers an invoice for a hash and only obtains the preimage from elsewhere, for example a gateway that has to complete a payment on another system before it can claim, has no way to ask the payer for more time before the HTLC is failed back.This adds
Bolt11Payment::receive_for_hash_with_min_final_cltv_expiry_delta, which passes the delta through toBolt11InvoiceParameters::min_final_cltv_expiry_delta. As documented there, the delta must be at leastMIN_FINAL_CLTV_EXPIRY_DELTA, and the invoice requests three blocks more to allow for blocks confirmed while the payment is routed. All other receive methods passNoneand behave as before.The channel full-cycle test covers it: it receives a payment with a raised delta, checks the invoice's
min_final_cltv_expiry_delta, and claims it manually.I am using this in prod already for a custom fedimint gateway.