📅 Original date posted:2021-12-09
📝 Original message:
Dear Ben,
BOLT 5 has a section called "Failing a channel" which you can find at https://github.com/lightning/bolts/blob/master/05-onchain.md#failing-a-channel
There you can find everything that is supposed to happen when the protocol spec says that a peer should fail a channel. This often happens when an `error` was sent. Roughly speaking "failing a channel" means closing the channel. In that case a peer should first try to mutually close the channel and only as a last resort resolve to a unilateral force close. The reasons are that force closes might include pending HTLCs and have higher fees in general.
There is also the common term of "failing the connection" which means closing the TCP connection.
If you are interested to dig a bit deeper you will see that there is the discussion about introducing warning messages at https://github.com/lightning/bolts/pull/834. The reason is to relax situations where we send `error` so that channels might not be closed as quickly as it is the case right now.
The semantics of failing the channel and what exactly should be done are also being discussed. I recently opened a pull request at https://github.com/lightning/bolts/pull/942 which resulted from the discussion around the warning messages and the idea to relax what happens in case issues arise during `channel_reestablish` which is discussed at https://github.com/lightning/bolts/pull/932
Sincerely Lightning Developer
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, December 9th, 2021 at 21:10, Benjamin Weintraub <weintraub.b at northeastern.edu> wrote:
> Hi all,
>
> I have a question about BOLT #2. What exactly does it mean to "fail the channel"? In the section for "update_add_htlc," the follwing text is written:
>
> - receiving an amount_msat equal to 0, OR less than its own htlc_minimum_msat:
>
> - SHOULD fail the channel.
>
> - receiving an amount_msat that the sending node cannot afford at the current feerate_per_kw (while maintaining its channel reserve and any to_local_anchor and to_remote_anchor costs):
>
> - SHOULD fail the channel.
>
> - if a sending node adds more than receiver max_accepted_htlcs HTLCs to its local commitment transaction, OR adds more than receiver max_htlc_value_in_flight_msat worth of offered HTLCs to its local commitment transaction:
>
> - SHOULD fail the channel.
>
> - if sending node sets cltv_expiry to greater or equal to 500000000:
>
> - SHOULD fail the channel.
>
> Does it mean closing the channel (unilaterally or mutually)? Or ending the TCP connection? Something else?
>
> Thanks,
> Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211209/8f5b3b25/attachment.html>