Skip to content

Make splice fee ceiling calculation overflow-safe - #1237

Open
elnafateh wants to merge 1 commit into
lightningdevkit:mainfrom
elnafateh:fix/splice-feerate-overflow
Open

elnafateh wants to merge 1 commit into
lightningdevkit:mainfrom
elnafateh:fix/splice-feerate-overflow

Conversation

@elnafateh

Copy link
Copy Markdown
Contributor

Problem

The splice fee ceiling uses unchecked multiplication. Extreme caller-supplied fee rates can overflow it, causing debug builds to panic and release builds to calculate an invalid ceiling.

Fix

Calculate the 1.5× ceiling using saturating arithmetic. Normal rates keep the same ceiling; unrepresentable results clamp to FeeRate::MAX. Add boundary coverage for rates above the multiplication limit and FeeRate::MAX.

  • Added two focused fee-estimator tests

@ldk-reviews-bot

ldk-reviews-bot commented Nov 16, 2026 •

Copy link
Copy Markdown

I've assigned @tnull 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.

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.

2 participants