Commit 5321673
committed
Implement quiescence protocol
Quiescence is a new protocol feature that allows for channels to undergo
"fundamental" changes (i.e., protocol upgrade) while there are no
pending updates on either side. Its first use case will be to carry out
channel splices, to ensure new HTLC/fee updates are not made while a
splice is being negotiated.
Each side of the channel is allowed to send a `stfu` message if any of
their outbound updates are not pending for either side (i.e.,
irrevocably committed on both commitment transactions). Once both sides
exchange `stfu`, the channel becomes quiescent. A message timeout is
enforced during the quiescence handshake to ensure we can eventually
re-establish the channel and propose new HTLC/fee updates again.
Several new state flags have been added to `ChannelState::ChannelReady`
to track the progress of the quiescence handshake. Once the channel
becomes quiescent, we transition a new `ChannelState::ChannelQuiescent`
state. Since quiescence is not a persistent protocol (it implicitly
terminates upon peer disconnection), and updates cannot be made, we
chose to introduce a new state completely once quiescent, as several of
the `ChannelState::ChannelReady` flags (e.g., `AWAITING_REMOTE_REVOKE`,
`MONITOR_UPDATE_IN_PROGRESS`, etc.) are not relevant.1 parent 7e1a530 commit 5321673
File tree
5 files changed
+976
-28
lines changed- lightning-types/src
- lightning/src/ln
5 files changed
+976
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
153 | | - | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| |||
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | | - | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| |||
534 | 536 | | |
535 | 537 | | |
536 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
537 | 549 | | |
538 | 550 | | |
539 | 551 | | |
| |||
1175 | 1187 | | |
1176 | 1188 | | |
1177 | 1189 | | |
| 1190 | + | |
1178 | 1191 | | |
1179 | 1192 | | |
1180 | 1193 | | |
| |||
1195 | 1208 | | |
1196 | 1209 | | |
1197 | 1210 | | |
1198 | | - | |
| 1211 | + | |
1199 | 1212 | | |
1200 | 1213 | | |
1201 | 1214 | | |
| |||
0 commit comments