Skip to content

feat: add minCltvExpiryDelta for LDK#2181

Open
frnandu wants to merge 5 commits intomasterfrom
feat/add-minCltvExpiryDelta-for-ldk
Open

feat: add minCltvExpiryDelta for LDK#2181
frnandu wants to merge 5 commits intomasterfrom
feat/add-minCltvExpiryDelta-for-ldk

Conversation

@frnandu
Copy link
Copy Markdown
Contributor

@frnandu frnandu commented Mar 26, 2026

fixes #2065

Summary by CodeRabbit

  • Improvements

    • Hold invoices now support an optional minimum CLTV expiry delta with validation to ensure values stay within protocol limits, allowing finer control over confirmation timeout behavior.
  • Chores

    • Updated a direct library dependency to a newer version.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 67f06631-ef4a-4aaa-8040-a6ea1125a5c8

📥 Commits

Reviewing files that changed from the base of the PR and between 77b956b and ccc963b.

📒 Files selected for processing (1)
  • lnclient/ldk/ldk.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • lnclient/ldk/ldk.go

📝 Walkthrough

Walkthrough

Updated the github.com/getAlby/ldk-node-go dependency in go.mod and added conditional handling of minCltvExpiryDelta in lnclient/ldk/ldk.go, validating the value and routing to either ReceiveForHashWithMinCltvExpiryDelta or the original ReceiveForHash.

Changes

Cohort / File(s) Summary
Dependency Update
go.mod
Bumped github.com/getAlby/ldk-node-go from pseudo-version v0.0.0-20260210094439-f4fc56578330 to v0.0.0-20260325180303-fbe7fe6a114d.
minCltvExpiryDelta Support
lnclient/ldk/ldk.go
MakeHoldInvoice now checks minCltvExpiryDelta: if non-nil and ≤ 65535 it calls ReceiveForHashWithMinCltvExpiryDelta (converting to uint16); otherwise falls back to ReceiveForHash. Removed the prior TODO.

Sequence Diagram(s)

(No sequence diagram generated — changes are localized and do not introduce a new multi-component sequential flow meeting the criteria.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • im-adithya

Poem

🐰 I hopped through code, a tiny tweak,
A delta checked before we speak,
If small enough it takes the lane,
Else old routes keep invoices sane,
Hop, hash, settle — carrot streak! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: add minCltvExpiryDelta for LDK' accurately describes the main change—implementing minCltvExpiryDelta support for the LDK provider, which is the primary objective.
Linked Issues check ✅ Passed The PR successfully implements minCltvExpiryDelta support for LDK by updating the dependency and adding validation/branching logic, directly addressing the missing field requirement from issue #2065.
Out of Scope Changes check ✅ Passed All changes are within scope: the dependency update and MakeHoldInvoice implementation directly support minCltvExpiryDelta for LDK as specified in issue #2065.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-minCltvExpiryDelta-for-ldk

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fully Implement NWC HOLD invoices spec

2 participants