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

funding: bound the commit fee rate an initiator can impose on us

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

73/100 · Adequate
funding: bound the commit fee rate an initiator can impose on us

In this commit, we add the other half of the BOLT-02 requirement here: the
receiver MUST fail the channel if it considers feerate_per_kw unreasonably
large. The spec leaves the threshold up to us, so we take the same approach
as CLN and Eclair and cap at 10x our own estimate for the same conf target
(3) we'd use for a channel we open ourselves.

A pure multiple of our estimate is a bit brittle on its own: on a quiet
chain, or when the estimator falls back to the relay fee, 10x of a very
small number is still a very small number, and we'd start turning away
channels opened at a rate that's perfectly sane in absolute terms. So we
floor the bound at 100 sat/vbyte, which no realistic mempool needs a
commitment to beat. If the estimator errors out entirely we fall back to
that floor rather than failing the flow.

That conf target is now a single constant shared with the rate we pay on a
channel we open ourselves, so the two cannot drift apart: the point of the
bound is to track the rate we'd consider necessary for a timely unilateral
close, and a second hardcoded 3 would let those diverge silently.

The bound is consulted only after the cheap admission checks have passed,
so a peer that is over its pending-channel limit cannot drive fee
estimation work on the funding goroutine.

Since all channels are single funder today, an initiator that proposes an
absurd rate mostly burns its own capacity. But it doesn't only do that: the
open still costs us a pending channel slot, and left unchecked it lands us
with a confirmed channel that can never be used and has to be closed on
chain. Rejecting up front is cheaper for both of us.

The error carries a sentinel the funding manager can match on, so the
decision does not depend on the wording of the message we send the peer.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change prevents a remote user from opening a Lightning channel with an outrageously high on-chain fee. Before the patch, an initiator could set a commitment fee so large that most of the channel's money would be eaten by fees, leaving a channel that is effectively unusable and must be closed on the blockchain. The patch caps the fee a remote peer can impose at ten times LND's own fee estimate, with a hard floor of 100 sat/vbyte, and rejects the channel if the proposed fee exceeds that cap.

Recommended action

This is a defensive hardening patch. Operators should upgrade to a release containing this commit. No configuration change is required; the bound is automatic.

Security signals we found

01

Adds BOLT-02 required rejection of unreasonably large feerate_per_kw

02

Caps remote-imposed commitment fee rate at 10x local estimate with 100 sat/vbyte floor

03

Uses a sentinel error to avoid text-based error matching

04

Includes regression tests for multiplier, floor, estimator failure, and interaction with reserve check

Risk score

Why this scored 64/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 12/15
Confidence 9/10
Evidence quality 5/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.