Skip to content

Ensure minimum RBF feerate satisfies BIP125#4494

Merged
TheBlueMatt merged 1 commit intolightningdevkit:mainfrom
jkczyz:2026-03-rbf-feerate
Apr 1, 2026
Merged

Ensure minimum RBF feerate satisfies BIP125#4494
TheBlueMatt merged 1 commit intolightningdevkit:mainfrom
jkczyz:2026-03-rbf-feerate

Conversation

@jkczyz
Copy link
Copy Markdown
Contributor

@jkczyz jkczyz commented Mar 18, 2026

The spec's 25/24 multiplier doesn't always satisfy BIP125's relay requirement of an absolute fee increase at low feerates, while a flat +25 sat/kwu increment falls below the spec's 25/24 rule above 600 sat/kwu. Use max(prev + 25, ceil(prev * 25/24)) for our own RBFs to satisfy both constraints, while still accepting the bare 25/24 rule from counterparties.

Potential spec change in lightning/bolts#1327.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Mar 18, 2026

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@jkczyz jkczyz force-pushed the 2026-03-rbf-feerate branch from 72455fc to 1098cc3 Compare March 18, 2026 18:57
@jkczyz jkczyz self-assigned this Mar 19, 2026
@jkczyz jkczyz mentioned this pull request Mar 19, 2026
36 tasks
@jkczyz jkczyz force-pushed the 2026-03-rbf-feerate branch from 1098cc3 to 9b9c114 Compare March 30, 2026 22:08
@jkczyz jkczyz marked this pull request as ready for review March 30, 2026 22:15
@jkczyz
Copy link
Copy Markdown
Contributor Author

jkczyz commented Mar 30, 2026

Will need for proper integration testing of LDK Node's rbf_channel API.

@jkczyz jkczyz requested review from TheBlueMatt and wpaulino and removed request for valentinewallace March 30, 2026 22:19
@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

ldk-claude-review-bot commented Mar 30, 2026

I have thoroughly reviewed the entire PR diff. All three issues from my prior review have been addressed in this revision:

  1. min_rbf_feerate now uses max(prev + 25, ceil(prev * 25/24)) — correctly satisfying both BIP125 relay and the spec's 25/24 rule at all feerates.
  2. Doc comments on FundingTemplate (lines 221-222, 236-238) accurately describe the dual-rule formula.
  3. Test comment at splicing_tests.rs:6050-6051 now correctly shows the max() computation at 10,000 sat/kwu.

The new test test_splice_rbf_at_high_feerate properly exercises the crossover region (1000 sat/kwu, where 25/24 dominates). The new acceptor-side test block in test_splice_rbf_insufficient_feerate correctly validates that a counterparty feerate satisfying only the bare 25/24 rule (264) is accepted even though our own floor is higher (278).

No issues found.

@jkczyz jkczyz changed the title Use +25 sat/kwu increment for our minimum RBF feerate Ensure minimum RBF feerate satisfies BIP125 Mar 30, 2026
@jkczyz jkczyz force-pushed the 2026-03-rbf-feerate branch from a18dac2 to a8d3bda Compare March 30, 2026 22:52
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.12%. Comparing base (8d00139) to head (1ff1bb4).
⚠️ Report is 117 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4494      +/-   ##
==========================================
+ Coverage   86.24%   87.12%   +0.88%     
==========================================
  Files         160      163       +3     
  Lines      107909   108740     +831     
  Branches   107909   108740     +831     
==========================================
+ Hits        93061    94735    +1674     
+ Misses      12212    11520     -692     
+ Partials     2636     2485     -151     
Flag Coverage Δ
fuzzing 40.21% <9.09%> (?)
tests 86.21% <94.44%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkczyz jkczyz force-pushed the 2026-03-rbf-feerate branch from a8d3bda to f56d3c8 Compare March 31, 2026 00:16
@wpaulino
Copy link
Copy Markdown
Contributor

Needs a squash. Can we move forward with this yet or is there still more spec discussion to be had?

The spec's 25/24 multiplier doesn't always satisfy BIP125's relay
requirement of an absolute fee increase at low feerates, while a flat
+25 sat/kwu increment falls below the spec's 25/24 rule above 600
sat/kwu. Use max(prev + 25, ceil(prev * 25/24)) for our own RBFs to
satisfy both constraints, while still accepting the bare 25/24 rule
from counterparties.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jkczyz jkczyz force-pushed the 2026-03-rbf-feerate branch from f56d3c8 to 1ff1bb4 Compare March 31, 2026 22:25
@jkczyz
Copy link
Copy Markdown
Contributor Author

jkczyz commented Mar 31, 2026

Needs a squash. Can we move forward with this yet or is there still more spec discussion to be had?

Squashed. Yeah, we can move forward. We still enforce the spec as it is currently written against our counterparty.

@jkczyz jkczyz requested a review from TheBlueMatt March 31, 2026 22:32
@TheBlueMatt TheBlueMatt merged commit 27a8dbb into lightningdevkit:main Apr 1, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants