Skip to content

Commit

Permalink
BOLT 2: quiescence protocol.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed May 9, 2021
1 parent a9db80e commit 439c635
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,6 @@ csv
CHECKSIGVERIFY
IFDUP
sats
quiesce
quiescing
SomeThing
41 changes: 41 additions & 0 deletions 02-peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ operation, and closing.
* [The `funding_created` Message](#the-funding_created-message)
* [The `funding_signed` Message](#the-funding_signed-message)
* [The `funding_locked` Message](#the-funding_locked-message)
* [Channel Quiescence](#channel-quiescence)
* [Channel Close](#channel-close)
* [Closing Initiation: `shutdown`](#closing-initiation-shutdown)
* [Closing Negotiation: `closing_signed`](#closing-negotiation-closing_signed)
Expand Down Expand Up @@ -445,6 +446,46 @@ to broadcast the commitment transaction to get his funds back and open a new
channel. To avoid this, the funder should ensure the funding transaction
confirms in the next 2016 blocks.

## Channel Quiescence

Various fundamental changes, in particular protocol upgrades, are
easiest on channels where both commitment transactions match, and no
pending updates are in flight. We define a protocol to quiesce the
channel by indicating that "SomeThing Fundamental is Underway".

### `stfu`

1. type: 2 (`stfu`)
2. data:
* [`channel_id`:`channel_id`]

### Requirements

The sender of `stfu`:
- MUST NOT send `stfu` if any of the sender's htlc additions, htlc removals
or fee updates are pending for either peer.
- MUST NOT send `stfu` twice.
- MUST set `channel_id` to the id of the channel to quiesce.
- MUST now consider the channel to be quiescing.
- MUST NOT send an update message after `stfu`.

The receiver of `stfu`:
- if it has sent `stfu` then:
- MUST now consider the channel to be quiescent
- otherwise:
- SHOULD NOT send any more update messages.
- MUST reply with `stfu` once it can do so.

Upon disconnection:
- the channel is no longer considered quiescent.

### Rationale

The normal use would be to cease sending updates, then wait for all
the current updates to be acknowledged by both peers, then start
quiescence. If both sides send `stfu` simultaneously, the result is
exactly the same as if one had replied to the other.

## Channel Close

Nodes can negotiate a mutual close of the connection, which unlike a
Expand Down

0 comments on commit 439c635

Please sign in to comment.