Correct FeeEstimator docs on the 253 sat/kW lower bound
What changed, and why it matters
This is a documentation-only edit. It corrects a misleading comment in the code that wrongly claimed all fee estimates returned to LDK are forced to be at least 253 satoshis per 1000 weight units. The new comment clarifies that this minimum only applies to Lightning protocol fee rates, not to all uses of the fee estimate. No code behavior changes.
No action required. This is a documentation correction with no runtime effect.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates the rustdoc for the FeeEstimator::get_est_sat_per_1000_weight trait method in lightning/src/chain/chaininterface.rs. The old doc stated LDK wraps the method and enforces a 253 sats/KW floor universally. The revised doc explains the floor is enforced only for Lightning protocol feerates via LowerBoundedFeeEstimator, and that non-protocol callers such as OutputSweeper may use the raw estimate for ConfirmationTarget::OutputSpendingFee. The diff is +9/-3 lines and contains no logic changes.
Changed components
lightning/src/chain/chaininterface.rsInspect captured patch +9 / −3
### lightning/src/chain/chaininterface.rs
@@ -350,12 +350,18 @@ pub enum ConfirmationTarget {
pub trait FeeEstimator {
/// Gets estimated satoshis of fee required per 1000 Weight-Units.
///
- /// LDK will wrap this method and ensure that the value returned is no smaller than 253
- /// (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
- ///
/// The following unit conversions can be used to convert to sats/KW:
/// * satoshis-per-byte * 250
/// * satoshis-per-kbyte / 4
+ ///
+ /// LDK bounds the feerates it uses for lightning protocol purposes below by
+ /// [`FEERATE_FLOOR_SATS_PER_KW`] (253 sats/KW, ie 1 satoshi-per-byte rounded up to ensure later
+ /// round-downs don't put us below 1 satoshi-per-byte). However, not all feerates LDK uses are
+ /// lightning protocol feerates, and some callers use the value returned here without applying
+ /// that bound. Most notably, [`OutputSweeper`] uses it as-is for
+ /// [`ConfirmationTarget::OutputSpendingFee`].
+ ///
+ /// [`OutputSweeper`]: crate::util::sweep::OutputSweeper
fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32;
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.