← Back to Pull requests

multi: enforce the commitment fee rate floor #11373

Closed
unknown closed this pull request without merging on Oct 20, 2026 14:12 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 03:54 UTC
Author

Change Description

An inbound open_channel could establish a channel with a commitment fee rate below chainfee.FeePerKwFloor (253 sat/kw), including zero. Later commitment updates already reject those rates, so the channel could not carry HTLCs until its initiator raised the fee. BOLT 2 requires failing the channel for a feerate_per_kw that's too small, so reject these proposals before consulting the channel acceptor or creating a reservation, with an error that tells the peer the minimum rate. Proposals at or above the floor are used unchanged.

Outgoing proposals now meet the floor too:

  • When opening a channel, the proposed rate is raised to the floor after applying the anchor cap, which also covers a fee estimate below the floor. This matters for --max-commit-fee-rate-anchors=1, the lowest accepted value, which converts to 250 sat/kw. The setting remains accepted, but lnd logs a startup warning, and the option's description says the floor is used instead.

  • When updating a channel's fee, the link falls back to the estimator's min relay fee if its capped fee estimate is lower. The bitcoind and btcd estimators can report a min relay fee below the floor, since they cap the median feefilter of our peers at the fee estimate for the next block. The link then proposed an update_fee that SignNextCommitment refused to sign, and the link failed. The link now uses the floor as the min relay fee if the estimator reports a lower one. Channels we opened below the floor, e.g. with an older lnd and --max-commit-fee-rate-anchors=1, are now raised to at least the floor regardless of the relay fee.
  • This changes behavior for peers running an older lnd with --max-commit-fee-rate-anchors=1: they propose anchor and taproot channels below the floor, which an upgraded node now rejects until they raise that setting or upgrade. Previously, such a channel opened but couldn't carry HTLCs until the opener raised its fee rate.

    Note:

  • BOLT 2's zero_fee_commitments channel type requires feerate_per_kw to be 0 and forbids update_fee. lnd doesn't support it yet, and peers shouldn't propose it to a node that doesn't advertise it, so the floor holds for every channel type lnd negotiates today. Supporting it will need exceptions to the inbound and outbound open_channel floors added here, as well as to the existing floor in validateCommitmentSanity. The inbound check runs before negotiateCommitmentType, so it will also have to move after it to see the type. Until then, lnd rejects a peer that proposes that type anyway for its fee rate rather than for its channel type.
  • Steps to Test

    Regression tests cover inbound rejection boundaries, outbound fee capping and flooring, the rate persisted in both commitments on each side of the channel, and a link fee update with a fee estimate and min relay fee below the floor. The funding test fixtures use the production default anchor cap; their previous implicit zero cap let tests open channels at zero fee.

    go test ./funding
    go test ./htlcswitch
    

    Pull Request Checklist


    Testing


  • Your PR passes all CI checks.

  • Tests covering the positive and negative (error paths) are included.

  • Bug fixes contain tests triggering the bug to prevent regressions.
  • Code Style and Documentation


  • The change is not insubstantial. Typo fixes are not accepted to fight bot spam.

  • The change obeys the Code Documentation and Commenting guidelines, and lines wrap at 80.

  • Commits follow the Ideal Git Commit Structure.

  • Any new logging statements use an appropriate subsystem and logging level.

  • Any new lncli commands have appropriate tags in the comments for the rpc in the proto file.

  • There is a change description in a PR-specific release note fragment at docs/release-notes/unreleased/<PR number>.md, or the no-changelog label is applied for changes that do not need one.
  • 📝 Please see our Contribution Guidelines for further guidance.

    Diff: 563 lines (+422 / -141) across 7 files Reviewer: gijswijs Review duration: 618m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.50) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 563 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.379
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #11373"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.7% (MEDIUM) · Higher = larger blast radius
    49.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.5% · Safe to merge
    21.5%