From 219adca398c003e349265f2d6d2950f5d8df2302 Mon Sep 17 00:00:00 2001 From: Antoine Riard Date: Thu, 8 Dec 2022 21:48:19 -0500 Subject: [PATCH] Add context for option_anchors_zero_fee_htlc_tx --- 02-peer-protocol.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/02-peer-protocol.md b/02-peer-protocol.md index 45ab4a74c..703f82db1 100644 --- a/02-peer-protocol.md +++ b/02-peer-protocol.md @@ -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` @@ -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: @@ -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