Skip to content

Commit

Permalink
Add context for option_anchors_zero_fee_htlc_tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Riard committed Dec 9, 2022
1 parent 5fb0b5c commit 219adca
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions 02-peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,9 @@ dust exposure. The exact value used is a matter of node policy.

For channels that don't use `option_anchors_zero_fee_htlc_tx`, an increase of
the `feerate_per_kw` may trim multiple htlcs from commitment transactions,
which could create a large increase in dust exposure.
which could create a large increase in dust exposure. If `option_anchors_zero_fee_htlc_tx`
has been negotiated, the HTLC feerate is implied to be 0, the checks should
still be applied as a node can be exposed due to the sum of the trimmed HTLCs.

### Adding an HTLC: `update_add_htlc`

Expand Down Expand Up @@ -1165,13 +1167,14 @@ The node _not responsible_ for paying the Bitcoin fee:
- MUST NOT send `update_fee`.

A sending node:
- if the `update_fee` increases `feerate_per_kw`:
- if the dust balance of the remote transaction at the updated `feerate_per_kw` is greater than `max_dust_htlc_exposure_msat`:
- MAY NOT send `update_fee`
- MAY fail the channel
- if the dust balance of the local transaction at the updated `feerate_per_kw` is greater than `max_dust_htlc_exposure_msat`:
- MAY NOT send `update_fee`
- MAY fail the channel
- if `option_anchors_zero_fee_htlc_tx` was not negotiated:
- if the `update_fee` increases `feerate_per_kw`:
- if the dust balance of the remote transaction at the updated `feerate_per_kw` is greater than `max_dust_htlc_exposure_msat`:
- MAY NOT send `update_fee`
- MAY fail the channel
- if the dust balance of the local transaction at the updated `feerate_per_kw` is greater than `max_dust_htlc_exposure_msat`:
- MAY NOT send `update_fee`
- MAY fail the channel

A receiving node:
- if the `update_fee` is too low for timely processing, OR is unreasonably large:
Expand All @@ -1182,11 +1185,12 @@ A receiving node:
current commitment transaction:
- SHOULD fail the channel,
- but MAY delay this check until the `update_fee` is committed.
- if the `update_fee` increases `feerate_per_kw`:
- if the dust balance of the remote transaction at the updated `feerate_per_kw` is greater then `max_dust_htlc_exposure_msat`:
- MAY fail the channel
- if the dust balance of the local transaction at the updated `feerate_per_kw` is greater than `max_dust_htlc_exposure_msat`:
- MAY fail the channel
- if `option_anchors_zero_fee_htlc_tx` was not negotiated:
- if the `update_fee` increases `feerate_per_kw`:
- if the dust balance of the remote transaction at the updated `feerate_per_kw` is greater then `max_dust_htlc_exposure_msat`:
- MAY fail the channel
- if the dust balance of the local transaction at the updated `feerate_per_kw` is greater than `max_dust_htlc_exposure_msat`:
- MAY fail the channel

#### Rationale

Expand Down

0 comments on commit 219adca

Please sign in to comment.