@@ -176,6 +176,16 @@ pub trait Confirm {
176
176
}
177
177
178
178
/// An enum representing the status of a channel monitor update persistence.
179
+ ///
180
+ /// Note that there is no error variant - any failure to persist a [`ChannelMonitor`] should be
181
+ /// retried indefinitely, the node shut down (as if we cannot update stored data we can't do much
182
+ /// of anything useful), or the channel force-close using
183
+ /// [`ChannelManager::force_close_broadcasting_latest_txn`].
184
+ ///
185
+ /// Note that in the last case, force-closing with the latest [`ChannelMonitorUpdate`] applied may
186
+ /// result in a transaction which can only be spent by the latest [`ChannelMonitor`]. Thus, if the
187
+ /// latest [`ChannelMonitor`] is not durably persisted anywhere, naively calling
188
+ /// [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
179
189
#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
180
190
pub enum ChannelMonitorUpdateStatus {
181
191
/// The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
@@ -204,6 +214,10 @@ pub enum ChannelMonitorUpdateStatus {
204
214
/// remote location (with local copies persisted immediately), it is anticipated that all
205
215
/// updates will return [`InProgress`] until the remote copies could be updated.
206
216
///
217
+ /// Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
218
+ /// reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
219
+ /// remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
220
+ ///
207
221
/// [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
208
222
InProgress ,
209
223
}
@@ -216,14 +230,10 @@ pub enum ChannelMonitorUpdateStatus {
216
230
/// channel state changes and HTLCs are resolved. See method documentation for specific
217
231
/// requirements.
218
232
///
219
- /// Implementations **must** ensure that updates are successfully applied and persisted upon method
220
- /// completion. If an update will not succeed, then it must immediately shut down.
221
- ///
222
233
/// If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
223
234
/// backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
224
235
/// could result in a revoked transaction being broadcast, allowing the counterparty to claim all
225
- /// funds in the channel. See [`ChannelMonitorUpdateStatus`] for more details about how to handle
226
- /// multiple instances.
236
+ /// funds in the channel.
227
237
pub trait Watch < ChannelSigner : WriteableEcdsaChannelSigner > {
228
238
/// Watches a channel identified by `funding_txo` using `monitor`.
229
239
///
0 commit comments