Skip to content

Commit 4ee435e

Browse files
committed
f add guidance for setting max pending updates
1 parent faa0f56 commit 4ee435e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lightning/src/util/persist.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,18 @@ where
377377
///
378378
/// The `maximum_pending_updates` parameter controls how many updates may be stored before a
379379
/// [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
380-
/// consolidation will frequently occur with fewer updates, this number is merely the maximum
381-
/// that may be stored.
380+
/// consolidation will frequently occur with fewer updates than what you set here; this number
381+
/// is merely the maximum that may be stored. When setting this value, consider that for higher
382+
/// values of `maximum_pending_updates`:
383+
///
384+
/// - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
385+
/// [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
386+
/// `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
387+
/// - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
388+
/// "waves" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
389+
/// less frequent "waves."
390+
/// - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
391+
/// [`MonitorUpdatingPersister::cleanup_stale_updates`].
382392
pub fn new(
383393
kv_store: K, logger: L, maximum_pending_updates: u64, entropy_source: ES,
384394
signer_provider: SP,

0 commit comments

Comments
 (0)