Skip to content

Commit 16de185

Browse files
committed
Avoid stuck channels after fee increase
Add an additional "reserve" for funders on top of the real reserve to avoid getting in a state where the channel is unusable because of the increased commit tx cost of a new HTLC. Requirements are only added for the funder sending an HTLC. Fundee receiving HTLCs may choose to verify that funders apply this, but it may lead to an unusable UX. Fixes #728.
1 parent 458b0d3 commit 16de185

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

02-peer-protocol.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,20 @@ is destined, is described in [BOLT #4](04-onion-routing.md).
787787
#### Requirements
788788

789789
A sending node:
790-
- MUST NOT offer `amount_msat` it cannot pay for in the
791-
remote commitment transaction at the current `feerate_per_kw` (see "Updating
792-
Fees") while maintaining its channel reserve.
790+
- if it is _responsible_ for paying the Bitcoin fee:
791+
- MUST NOT offer `amount_msat` if, after adding that HTLC to its commitment
792+
transaction, it cannot pay the fee for either the local or remote commitment
793+
transaction at the current `feerate_per_kw` while maintaining its channel
794+
reserve (see "Updating Fees").
795+
- SHOULD NOT offer `amount_msat` if, after adding that HTLC to its commitment
796+
transaction, its remaining balance doesn't allow it to pay the fee for a
797+
future additional non-dust HTLC at `2*feerate_per_kw` while maintaining its
798+
channel reserve ("fee spike buffer").
799+
- if it is _not responsible_ for paying the Bitcoin fee:
800+
- SHOULD NOT offer `amount_msat` if, once the remote node adds that HTLC to
801+
its commitment transaction, it cannot pay the fee for the updated local or
802+
remote transaction at the current `feerate_per_kw` while maintaining its
803+
channel reserve.
793804
- MUST offer `amount_msat` greater than 0.
794805
- MUST NOT offer `amount_msat` below the receiving node's `htlc_minimum_msat`
795806
- MUST set `cltv_expiry` less than 500000000.
@@ -856,6 +867,15 @@ seconds, and the protocol only supports an expiry in blocks.
856867
specification; larger amounts are not necessary, nor wise, during the
857868
bootstrap phase of the network.
858869

870+
The node _responsible_ for paying the Bitcoin fee has to maintain a small "fee
871+
spike buffer" on top of its reserve to accommodate a future fee increase.
872+
Without this buffer, the node _responsible_ for paying the Bitcoin fee may
873+
reach a state where it is unable to receive any HTLC while maintaining its
874+
channel reserve (because of the increased weight of the commitment transaction),
875+
resulting in an unusable channel.
876+
See [#728](https://github.com/lightningnetwork/lightning-rfc/issues/728) for
877+
more details.
878+
859879
### Removing an HTLC: `update_fulfill_htlc`, `update_fail_htlc`, and `update_fail_malformed_htlc`
860880

861881
For simplicity, a node can only remove HTLCs added by the other node.

0 commit comments

Comments
 (0)