AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 27 Bitcoin

Delete `TxBuilder::commit_tx_fee_sat`

Public commit record

What the developer wrote

Authored by Leo Nash

58/100 · Thin
Delete `TxBuilder::commit_tx_fee_sat`

Move calls to `TxBuilder::commit_tx_fee_sat` in
`new_for_inbound_channel` and `new_for_outbound_channel` to
`ChannelContext::get_next_{*}_commitment_stats`, and set the parameters
such that the exact same behavior is maintained.

We also replace calls to `TxBuilder::commit_tx_fee_sat` in
`get_pending_htlc_stats`, `next_local_commit_tx_fee_msat`, and
`next_remote_commit_tx_fee_msat` with `chan_utils::commit_tx_fee_sat`.
All three functions get deleted in an upcoming commit, so we accept
this temporary use of the `chan_utils::commit_tx_fee_sat` function.
✓ Descriptive subject✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit is a code cleanup in the Lightning Dev Kit's rust-lightning project. It removes a helper method called `commit_tx_fee_sat` from a transaction-building trait and moves the fee-checking logic into a more central place when opening channels. The goal is to keep the same behavior while simplifying the code. There is no direct evidence in the commit that this fixes a security vulnerability.

Recommended action

Treat as a normal refactor commit. Reviewers should verify that the moved fee checks produce identical thresholds and error messages, and that removing the `addl_nondust_htlc_count` debug assertion does not mask incorrect HTLC counts in anchor-zero-fee channels. No immediate security response is indicated by the commit itself.

Security signals we found

01

Refactor moves fee-sufficiency checks from channel-open setup into post-construction validation using commitment stats

02

Removal of `debug_assert_eq!(addl_nondust_htlc_count, 0)` in anchor-zero-fee commitment path

03

Test-only addition of `PredictedNextFee` defaults to satisfy new code paths

Risk score

Why this scored 27/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 5/15
Confidence 5/10
Evidence quality 2/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.