-# 0.0.110 - 2022-07-26
+# 0.0.110 - 2022-07-26 - "Routing, With a Vengeance"
## API Updates
* `ChannelManager::send_probe` and `Score::probe_{failed,successful}` have
* Wilmer Paulino
* jurvis
-# 0.0.109 - 2022-07-01
+# 0.0.109 - 2022-07-01 - "The Kitchen Sink"
## API Updates
* `ChannelManager::update_channel_config` has been added to allow the fields
* Wilmer Paulino
-# 0.0.108 - 2022-06-10
+# 0.0.108 - 2022-06-10 - "You Wanted It To Build?! Why Didn't You Say So?"
## Bug Fixes
* Fixed `lightning-background-processor` build in release mode.
* Max Fang
* Viktor Tigerström
-# 0.0.107 - 2022-06-08
+# 0.0.107 - 2022-06-08 - "BlueWallet's Wishlist"
## API Updates
* Channels larger than 16777215 sats (Wumbo!) are now supported and can be
* vss96
-# 0.0.100 - 2021-08-17
+# 0.0.100 - 2021-08-17 - "Oh, so *that's* what's going on inside the box"
## API Updates
* The `lightning` crate can now be built in no_std mode, making it easy to
deletions in 95 commits from 6 authors.
-# 0.0.99 - 2021-07-09
+# 0.0.99 - 2021-07-09 - "It's a Bugz Life"
## API Updates
versions. If you have such a `ChannelManager` available, a simple patch will
allow it to deserialize. Please file an issue if you need assistance (#973).
-# 0.0.98 - 2021-06-11
+# 0.0.98 - 2021-06-11 - "It's ALIVVVVEEEEEEE"
0.0.98 should be considered a release candidate to the first alpha release of
Rust-Lightning and the broader LDK. It represents several years of work
///
/// An [`EventHandler`] may safely call back to the provider in order to handle an event.
/// However, it must not call [`Writeable::write`] as doing so would result in a deadlock.
- ///
- /// Pending events are persisted as part of [`ChannelManager`]. While these events are cleared
- /// when processed, an [`EventHandler`] must be able to handle previously seen events when
- /// restarting from an old state.
fn process_pending_events<H: Deref>(&self, handler: H) where H::Target: EventHandler {
PersistenceNotifierGuard::optionally_notify(&self.total_consistency_lock, &self.persistence_notifier, || {
let mut result = NotifyOption::SkipPersist;
(4, path, vec_type),
(6, short_channel_id, option),
});
- Ok(Some(Event::ProbeFailed{
+ Ok(Some(Event::ProbeFailed {
payment_id,
payment_hash,
path: path.unwrap(),
};
f()
},
+ 25u8 => {
+ let f = || {
+ let mut prev_channel_id = [0; 32];
+ let mut failed_next_destination_opt = None;
+ read_tlv_fields!(reader, {
+ (0, prev_channel_id, required),
+ (2, failed_next_destination_opt, ignorable),
+ });
+ if let Some(failed_next_destination) = failed_next_destination_opt {
+ Ok(Some(Event::HTLCHandlingFailed {
+ prev_channel_id,
+ failed_next_destination,
+ }))
+ } else {
+ // If we fail to read a `failed_next_destination` assume it's because
+ // `MaybeReadable::read` returned `Ok(None)`, though it's also possible we
+ // were simply missing the field.
+ Ok(None)
+ }
+ };
+ f()
+ },
// Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
// Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
// reads.
///
/// # Requirements
///
-/// See [`process_pending_events`] for requirements around event processing.
-///
/// When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
-/// event since the last invocation. The handler must either act upon the event immediately
-/// or preserve it for later handling.
+/// event since the last invocation.
+///
+/// In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
+/// and replay any unhandled events on startup. An [`Event`] is considered handled when
+/// [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
+/// relevant changes to disk *before* returning.
+///
+/// Further, because an application may crash between an [`Event`] being handled and the
+/// implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
+/// effect, [`Event`]s may be replayed.
///
/// Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
/// consult the provider's documentation on the implication of processing events and how a handler
pub trait EventsProvider {
/// Processes any events generated since the last call using the given event handler.
///
- /// Subsequent calls must only process new events. However, handlers must be capable of handling
- /// duplicate events across process restarts. This may occur if the provider was recovered from
- /// an old state (i.e., it hadn't been successfully persisted after processing pending events).
+ /// See the trait-level documentation for requirements.
fn process_pending_events<H: Deref>(&self, handler: H) where H::Target: EventHandler;
}