Sitelet https://github.com/lightningnetwork/lnd/issues/11149
Skip to content

Failure to reject absurdly high channel feerates #11149

Description

@morehouse

BOLT 2 has two required checks that provide an upper limit on the feerate imposed by the counterparty (1, 2) :

  1. The receiver MUST fail the channel if:
      - both `to_local` and `to_remote` amounts for the initial commitment transaction are less than or equal to `channel_reserve_satoshis`
    
  2. The receiver MUST fail the channel if:
      - it considers `feerate_per_kw` ... unreasonably large.
    

LND implements neither.

Impact

LND will accept an initial channel feerate so high that neither party can spend on the channel. For example, LND accepts the following channel parameters:

funding_satoshis = 2_000_000
push_msat = 0
feerate_per_kw = 2_750_000
channel_reserve_satoshis = 20_000

The balances on the initial commitment transaction after fees are:

to_local (funder) = 9_000 sat
to_remote (LND) = 0 sat

Thus there aren't enough funds available for either party to meet their reserves, and neither can spend over the channel.

Suggested fix

Add a check for requirement 1 above, as mandated by the spec.

Also add a requirement 2 cap on the initial feerate imposed by the counterparty. For reference, CLN and Eclair both cap at 10x their own feerate estimates, with Eclair imposing an additional hard limit of 25,000 sat/kw on anchor channels.

Discovery

The specification non-compliance was detected by smite.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions