Merge pull request #1703 from TheBlueMatt/2022-09-badonion-first-check
[rust-lightning] / CHANGELOG.md
1 # 0.0.111 - Sep 12, 2022 - "Saturated with Messages"
2
3 ## API Updates
4  * Support for relaying onion messages has been added via a new
5    `OnionMessenger` struct when passed as the `OnionMessageHandler` to a
6    `PeerManager`. Pre-encoded onion messages can also be sent and received
7    (#1503, #1650, #1652, #1688).
8  * Rate-limiting of outbound gossip syncs has been rewritten to utilize less
9    buffering inside LDK. The new rate-limiting is also used for onion messages
10    to avoid delaying other messages (#1604. #1660, #1683).
11  * Rather than spawning a full OS thread, `lightning-background-processor` has
12    a new `process_events_async` method which takes the place of a
13    `BackgroundProcessor` for those using Rust's async (#1657).
14  * `ChannelManager::get_persistable_update_future` has been added to block on
15    a ChannelManager needing re-persistence in a Rust async environment (#1657).
16  * The `Filter::register_output` return value has been removed, as it was
17    very difficult to correctly implement (i.e., without blocking). Users
18    previously using it should instead pass dependent transactions in via
19    additional `chain::Confirm::transactions_confirmed` calls (#1663).
20  * `ChannelHandshakeConfig::their_channel_reserve_proportional_millionths` has
21    been added to allow configuring counterparty reserve values (#1619).
22  * `KeysInterface::ecdh` has been added as an ECDH oracle (#1503, #1658).
23  * The `rust-bitcoin` dependency has been updated 0.29 (#1658).
24  * The `bitcoin_hashes` dependency has been updated 0.11 (#1677).
25  * `ChannelManager::broadcast_node_announcement` has been moved to
26    `PeerManager` (#1699).
27  * `channel_` and `node_announcement`s are now rebroadcast automatically to all
28    new peers which connect (#1699).
29  * `{Init,Node}Features` sent to peers/broadcasted are now fetched via the
30    various `*MessageHandler` traits, rather than hard-coded (#1701, #1688).
31  * `Event::PaymentPathFailed::rejected_by_dest` has been renamed
32    `payment_failed_permanently` (#1702).
33  * `Invoice` now derives the std `Hash` trait (#1575).
34  * `{Signed,}RawInvoice::hash` have been renamed `signable_hash` (#1714).
35  * `chain::AccessError` now derives the std `Debug` trait (#1709).
36  * `ReadOnlyNetworkGraph::list_{channels,nodes}` have been added largely for
37    users of downstream bindings (#1651).
38  * `ChannelMonitor::get_counterparty_node_id` is now available (#1635).
39
40 ## Bug Fixes
41  * The script compared with that returned from `chain::Access` was incorrect
42    ~half of the time, causing spurious gossip rejection (#1666).
43  * Pending in-flight HTLCs are now considered when calculating new routes,
44    ensuring, e.g. MPP retries do not take known-saturated paths (#1643).
45  * Counterparty-revoked outputs are now included in `get_claimable_balance`
46    output via a new `Balance::CounterpartyRevokedOutputClaimable` (#1495).
47  * Inbound HTLCs for which we do not (yet) have a preimage are now included in
48    `get_claimable_balance` via a `Balance::MaybePreimageClaimableHTLC` (#1673).
49  * Probes that fail prior to being sent over their first hop are correctly
50    failed with a `Event::ProbeFailed` rather than a `PaymentPathFailed` (#1704).
51  * Pending `Event::HTLCHandlingFailed`s are no longer lost on restart (#1700).
52  * HTLCs that fail prior to being sent over their first hop are now marked as
53    retryable via `!PaymentPathFailed::payment_failed_permanently` (#1702).
54  * Dust HTLCs are now considered failed in the payment tracking logic after the
55    commitment transaction confirms, allowing retry on restart (#1691).
56  * On machines with buggy "monotonic" clocks, LDK will no longer panic if time
57    goes backwards (#1692).
58
59 ## Backwards Compatibility
60  * The new `current_time` argument to `PeerManager` constructors must be set to
61    a UNIX timestamp for upgraded nodes; new nodes may use a counter (#1699).
62  * `Balance::CounterpartyRevokedOutputClaimable` will never be generated for
63    channels that were observed to go on-chain with LDK versions prior to
64    0.0.111 (#1495).
65  * `ChannelMonitor::get_counterparty_node_id` will return `None` for all
66    channels opened on a version of LDK prior to 0.0.110 (#1635).
67  * Setting `their_channel_reserve_proportional_millionths` to any value other
68    than the default will cause LDK versions prior to 0.0.104 to be unable to
69    read the serialized `ChannelManager` (#1619).
70
71 ## Security
72 0.0.111 fixes a denial-of-service vulnerability which is reachable from
73 untrusted input in deployments accepting 0conf channels, or via a race-condition
74 in deployments creating outbound 0conf channels.
75
76  * LDK versions prior to 0.0.111 may spuriously panic when receiving a block if
77    they are awaiting the construction of a funding transaction for a 0-conf
78    channel (#1711). 0-conf support was added in LDK version 0.0.107.
79
80 In total, this release features 84 files changed, 6306 insertions, 1960
81 deletions in 121 commits from 11 authors, in alphabetical order:
82  * Arik Sosman
83  * Devrandom
84  * Duncan Dean
85  * Elias Rohrer
86  * Gursharan Singh
87  * Matt Corallo
88  * NicolaLS
89  * Valentine Wallace
90  * Viktor Tigerström
91  * jurvis
92  * ok300
93
94
95 # 0.0.110 - 2022-07-26 - "Routing, With a Vengeance"
96
97 ## API Updates
98  * `ChannelManager::send_probe` and `Score::probe_{failed,successful}` have
99    been added to make probing more explicit, as well as new
100    `Event::Probe{Failed,Successful}` events (#1567).
101  * `ProbabilisticScoringParameters::banned_nodes` has been renamed
102    `manual_node_penalties` and changed to take msat penalties (#1592).
103  * Per-payment tracking of failed paths was added to enable configuration of
104    `ProbabilisticScoringParameters::considered_impossible_penalty_msat` (#1600)
105  * `ProbabilisticScoringParameters::base_penalty_amount_multiplier_msat` was
106    added to allow a penalty that is only amount-dependent (#1617).
107  * `ProbabilisticScoringParameters::amount_penalty_multiplier_msat` was renamed
108    `liquidity_penalty_amount_multiplier_msat` (#1617).
109  * A new `Event::HTLCHandlingFailed` has been added which provides visibility
110    into failures to forward/claim accepted HTLCs (#1403).
111  * Support has been added for DNS hostnames in the `NetAddress` type, see
112    [BOLT PR #911](https://github.com/lightning/bolts/pull/911) (#1553).
113  * `GossipSync` now has `rapid`, `p2p`, and `none` constructors (#1618).
114  * `lightning-net-tokio` no longer requires types to be in `Arc`s (#1623).
115  * The `htlc_maximum_msat` field is now required in `ChannelUpdate` gossip
116    messages. In tests this rejects < 1% of channels (#1519).
117  * `ReadOnlyNetworkGraph::{channel,node}` have been added to query for
118    individual channel/node data, primarily for bindings users (#1543).
119  * `FeeEstimator` implementations are now wrapped internally to ensure values
120    below 253 sats/kW are never used (#1552).
121  * Route selection no longer attempts to randomize path selection. This is
122    unlikely to lead to a material change in the paths selected (#1610).
123
124 ## Bug Fixes
125  * Fixed a panic when deserializing `ChannelDetails` objects (#1588).
126  * When routing, channels are no longer fully saturated before MPP splits are
127    generated, instead a configuration knob was added as
128    `PaymentParameters::max_channel_saturation_power_of_half` (#1605).
129  * Fixed a panic which occurred in `ProbabilisticScorer` when wallclock time
130    goes backwards across a restart (#1603).
131
132 ## Serialization Compatibility
133  * All new fields are ignored by prior versions of LDK. All new fields are not
134    present when reading objects serialized by prior versions of LDK.
135  * Channel information written in the `NetworkGraph` which is missing
136    `htlc_maximum_msat` may be dropped on deserialization (#1519).
137  * Similarly, node information written in the `NetworkGraph` which contains an
138    invalid hostname may be dropped on deserialization (#1519).
139
140 In total, this release features 79 files changed, 2935 insertions, 1363
141 deletions in 52 commits from 9 authors, in alphabetical order:
142  * Duncan Dean
143  * Elias Rohrer
144  * Jeffrey Czyz
145  * Matt Corallo
146  * Max Fang
147  * Viktor Tigerström
148  * Willem Van Lint
149  * Wilmer Paulino
150  * jurvis
151
152 # 0.0.109 - 2022-07-01 - "The Kitchen Sink"
153
154 ## API Updates
155  * `ChannelManager::update_channel_config` has been added to allow the fields
156    in `ChannelConfig` to be changed in a given channel after open (#1527).
157  * If we reconnect to a peer which proves we have a stale channel state, rather
158    than force-closing we will instead panic to provide an opportunity to switch
159    to the latest state and continue operating without channel loss (#1564).
160  * A `NodeAlias` struct has been added which handles string sanitization for
161    node aliases via the `Display` trait (#1544).
162  * `ProbabilisticScoringParameters` now has a `banned_nodes` set which we will
163     never route through during path finding (#1550).
164  * `ProbabilisticScoringParameters` now offers an `anti_probing_penalty_msat`
165    option to prefer channels which afford better privacy when routing (#1555).
166  * `ProbabilisticScorer` now provides access to its estimated liquidity range
167    for a given channel via `estimated_channel_liquidity_range` (#1549).
168  * `ChannelManager::force_close_channel` has been renamed
169    `force_close_broadcasting_latest_txn` and
170    `force_close_without_broadcasting_txn` has been added (#1564).
171  * Options which cannot be changed at runtime have been moved from
172    `ChannelConfig` to `ChannelHandshakeConfig` (#1529).
173  * `find_route` takes `&NetworkGraph` instead of `ReadOnlyNetworkGraph (#1583).
174  * `ChannelDetails` now contains a copy of the current `ChannelConfig` (#1527).
175  * The `lightning-invoice` crate now optionally depends on `serde`, with
176    `Invoice` implementing `serde::{Deserialize,Serialize}` if enabled (#1548).
177  * Several fields in `UserConfig` have been renamed for clarity (#1540).
178
179 ## Bug Fixes
180  * `find_route` no longer selects routes with more than
181    `PaymentParameters::max_mpp_path_count` paths, and
182    `ChannelManager::send_payment` no longer refuses to send along routes with
183    more than ten paths (#1526).
184  * Fixed two cases where HTLCs pending at the time a counterparty broadcasts a
185    revoked commitment transaction are considered resolved prior to their actual
186    resolution on-chain, possibly passing the update to another channel (#1486).
187  * HTLCs which are relayed through LDK may now have a total expiry time two
188    weeks in the future, up from one, reducing forwarding failures (#1532).
189
190 ## Serialization Compatibility
191  * All new fields are ignored by prior versions of LDK. All new fields are not
192    present when reading objects serialized by prior versions of LDK.
193  * `ChannelConfig`'s serialization format has changed and is not compatible
194    with any previous version of LDK. Attempts to read values written by a
195    previous version of LDK will fail and attempts to read newly written objects
196    using a previous version of LDK will fail. It is not expected that users are
197    serializing `ChannelConfig` using the LDK serialization API, however, if a
198    backward compatibility wrapper is required, please open an issue.
199
200 ## Security
201 0.0.109 fixes a denial-of-service vulnerability which is reachable from
202 untrusted input in some application deployments.
203
204  * Third parties which are allowed to open channels with an LDK-based node may
205    fund a channel with a bogus and maliciously-crafted transaction which, when
206    spent, can cause a panic in the channel's corresponding `ChannelMonitor`.
207    Such a channel is never usable as it cannot be funded with a funding
208    transaction which matches the required output script, allowing the
209    `ChannelMonitor` for such channels to be safely purged as a workaround on
210    previous versions of LDK. Thanks to Eugene Siegel for reporting this issue.
211
212 In total, this release features 32 files changed, 1948 insertions, 532
213 deletions in 33 commits from 9 authors, in alphabetical order:
214  * Antoine Riard
215  * Daniel Granhão
216  * Elias Rohrer
217  * Jeffrey Czyz
218  * Matt Corallo
219  * Matt Faltyn
220  * NicolaLS
221  * Valentine Wallace
222  * Wilmer Paulino
223
224
225 # 0.0.108 - 2022-06-10 - "You Wanted It To Build?! Why Didn't You Say So?"
226
227 ## Bug Fixes
228  * Fixed `lightning-background-processor` build in release mode.
229
230 In total, this release features 9 files changed, 120 insertions, 74
231 deletions in 5 commits from 4 authors, in alphabetical order:
232  * Elias Rohrer
233  * Matt Corallo
234  * Max Fang
235  * Viktor Tigerström
236
237 # 0.0.107 - 2022-06-08 - "BlueWallet's Wishlist"
238
239 ## API Updates
240  * Channels larger than 16777215 sats (Wumbo!) are now supported and can be
241    enabled for inbound channels using
242    `ChannelHandshakeLimits::max_funding_satoshis` (#1425).
243  * Support for feature `option_zeroconf`, allowing immediate forwarding of
244    payments after channel opening. This is configured for outbound channels
245    using `ChannelHandshakeLimits::trust_own_funding_0conf` whereas
246    `ChannelManager::accept_inbound_channel_from_trusted_peer_0conf` has to be
247    used for accepting inbound channels (#1401, #1505).
248  * `ChannelManager::claim_funds` no longer returns a `bool` to indicate success.
249    Instead, an `Event::PaymentClaimed` is generated if the claim was successful.
250    Likewise, `ChannelManager::fail_htlc_backwards` no longer has a return value
251    (#1434).
252  * `lightning-rapid-gossip-sync` is a new crate for syncing gossip data from a
253    server, primarily aimed at mobile devices (#1155).
254  * `RapidGossipSync` can be passed to `BackgroundProcessor` in order to persist
255    the `NetworkGraph` and handle `NetworkUpdate`s during event handling (#1433,
256    #1517).
257  * `NetGraphMsgHandler` has been renamed to `P2PGossipSync`, the `network_graph`
258     module has been renamed to `gossip`, and `NetworkUpdate::ChannelClosed` has
259    been renamed `NetworkUpdate::ChannelFailure` (#1159).
260  * Added a `filtered_block_connected` method to `chain::Listen` and a default
261    implementation of `block_connected` for those fetching filtered instead of
262    full blocks (#1453).
263  * The `lightning-block-sync` crate's `BlockSource` trait methods now take
264    `&self` instead of `&mut self` (#1307).
265  * `inbound_payment` module is now public to allow for creating invoices without
266    a `ChannelManager` (#1384).
267  * `lightning-block-sync`'s `init` and `poll` modules support `&dyn BlockSource`
268    which can be determined at runtime (#1423).
269  * `lightning-invoice` crate's `utils` now accept an expiration time (#1422,
270    #1474).
271  * `Event::PaymentForwarded` includes `prev_channel_id` and `next_channel_id`
272    (#1419, #1475).
273  * `chain::Watch::release_pending_monitor_events`' return type now associates
274    `MonitorEvent`s with funding `OutPoints` (#1475).
275  * `lightning-background-processor` crate's `Persister` trait has been moved to
276    `lightning` crate's `util::persist` module, which now has a general
277    `KVStorePersister` trait. Blanket implementations of `Persister` and
278    `chainmonitor::Persist` are given for types implementing `KVStorePersister`.
279    ` lightning-persister`'s `FilesystemPersister` implements `KVStorePersister`
280    (#1417).
281  * `ChannelDetails` and `ChannelCounterparty` include fields for HTLC minimum
282    and maximum values (#1378).
283  * Added a `max_inbound_htlc_value_in_flight_percent_of_channel` field to
284    `ChannelHandshakeConfig`, capping the total value of outstanding inbound
285    HTLCs for a channel (#1444).
286  * `ProbabilisticScorer` is parameterized by a `Logger`, which it uses to log
287    channel liquidity updates or lack thereof (#1405).
288  * `ChannelDetails` has an `outbound_htlc_limit_msat` field, which should be
289    used in routing instead of `outbound_capacity_msat` (#1435).
290  * `ProbabilisticScorer`'s channel liquidities can be logged via
291    `debug_log_liquidity_stats` (#1460).
292  * `BackgroundProcessor` now takes an optional `WriteableScore` which it will
293    persist using the `Persister` trait's new `persist_scorer` method (#1416).
294  * Upgraded to `bitcoin` crate version 0.28.1 (#1389).
295  * `ShutdownScript::new_witness_program` now takes a `WitnessVersion` instead of
296    a `NonZeroU8` (#1389).
297  * Channels will no longer be automatically force closed when the counterparty
298    is disconnected due to incompatibility (#1429).
299  * `ChannelManager` methods for funding, accepting, and closing channels now
300    take a `counterparty_node_id` parameter, which has also been added as a field
301    to `Event::FundingGenerationReady` (#1479, #1485).
302  * `InvoicePayer::new` now takes a `Retry` enum (replacing the `RetryAttempts`
303    struct), which supports both attempt- and timeout-based retrying (#1418).
304  * `Score::channel_penalty_msat` takes a `ChannelUsage` struct, which contains
305    the capacity as an `EffectiveCapacity` enum and any potential in-flight HTLC
306    value, rather than a single `u64`. Used by `ProbabilisticScorer` for more
307    accurate penalties (#1456).
308  * `build_route_from_hops` is a new function useful for constructing a `Route`
309    given a specific list of public keys (#1491).
310  * `FundingLocked` message has been renamed `ChannelReady`, and related
311    identifiers have been renamed accordingly (#1506).
312  * `core2::io` or `std::io` (depending on feature flags `no-std` or `std`) is
313    exported as a `lightning::io` module (#1504).
314  * The deprecated `Scorer` has been removed in favor or `ProbabilisticScorer`
315    (#1512).
316
317 ## Performance Improvements
318  * `lightning-persister` crate's `FilesystemPersister` is faster by 15x (#1404).
319  * Log gossip query messages at `GOSSIP` instead of `TRACE` to avoid
320    overwhelming default logging (#1421).
321  * `PeerManager` supports processing messages from different peers in parallel,
322    and this is taken advantage of in gossip processing (#1023).
323  * Greatly reduced per-channel and per-node memory usage due to upgrade of
324    `secp256k1` crate to 0.22.1 and `bitcoin` crate to 0.28.1
325  * Reduced per-peer memory usage in `PeerManager` (#1472).
326
327 ## Spec Compliance
328  * `find_route` now assumes variable-length onions by default for nodes where
329    support for the feature is unknown (#1414).
330  * A `warn` message is now sent when receiving a `channel_reestablish` with an
331    old commitment transaction number rather than immediately force-closing the
332    channel (#1430).
333  * When a `channel_update` message is included in an onion error's `failuremsg`,
334    its message type is now encoded. Reading such messages is also supported
335    (#1465).
336
337 ## Bug Fixes
338  * Fixed a bug where crashing while persisting a `ChannelMonitorUpdate` for a
339    part of a multi-path payment could cause loss of funds due to a partial
340    payment claim on restart (#1434).
341  * `BackgroundProcessor` has been fixed to improve serialization reliability on
342    slow systems which can avoid force-closes (#1436).
343  * `gossip_timestamp_filter` filters are now honored when sending gossip to
344    peers (#1452).
345  * During a reorg, only force-close a channel if its funding transaction is
346    unconfirmed rather than as it loses confirmations (#1461).
347  * Fixed a rare panic in `lightning-net-tokio` when fetching a peer's socket
348    address after the connection has been closed caused by a race condition
349    (#1449).
350  * `find_route` will no longer return routes that would cause onion construction
351    to fail in some cases (#1476).
352  * `ProbabilisticScorer` uses more precision when approximating `log10` (#1406).
353
354 ## Serialization Compatibility
355  * All above new events/fields are ignored by prior clients. All above new
356    events/fields are not present when reading objects serialized by prior
357    versions of the library.
358  * `ChannelManager` serialization is no longer compatible with versions prior to
359    0.0.99 (#1401).
360  * Channels with `option_zeroconf` feature enabled (not required for 0-conf
361    channel use) will be unreadable by versions prior to 0.0.107 (#1401, #1505).
362
363 In total, this release features 96 files changed, 9304 insertions, 4503
364 deletions in 153 commits from 18 authors, in alphabetical order:
365  * Arik Sosman
366  * Devrandom
367  * Duncan Dean
368  * Elias Rohrer
369  * Jeffrey Czyz
370  * John Cantrell
371  * John Corser
372  * Jurvis Tan
373  * Justin Moon
374  * KaFai Choi
375  * Matt Faltyn
376  * Matt Corallo
377  * Valentine Wallace
378  * Viktor Tigerström
379  * Vincenzo Palazzo
380  * atalw
381  * dependabot[bot]
382  * shamardy
383
384
385 # 0.0.106 - 2022-04-03
386
387 ## API Updates
388  * Minimum supported rust version (MSRV) is now 1.41.1 (#1310).
389  * Lightning feature `option_scid_alias` is now supported and may be negotiated
390    when opening a channel with a peer. It can be configured via
391    `ChannelHandshakeConfig::negotiate_scid_privacy` and is off by default but
392    will be on by default in the future (#1351).
393  * `OpenChannelRequest` now has a `channel_type` field indicating the features
394    the channel will operate with and should be used to filter channels with
395    undesirable features (#1351). See the Serialization Compatibility section.
396  * `ChannelManager` supports sending and receiving short channel id aliases in
397    the `funding_locked` message. These are used when forwarding payments and
398    constructing invoice route hints for improved privacy. `ChannelDetails` has a
399    `inbound_scid_alias` field and a `get_inbound_payment_scid` method to support
400    the latter (#1311).
401  * `DefaultRouter` and `find_route` take an additional random seed to improve
402    privacy by adding a random CLTV expiry offset to each path's final hop. This
403    helps obscure the intended recipient from adversarial intermediate hops
404    (#1286). The seed is  also used to randomize candidate paths during route
405    selection (#1359).
406  * The `lightning-block-sync` crate's `init::synchronize_listeners` method
407    interface has been relaxed to support multithreaded environments (#1349).
408  * `ChannelManager::create_inbound_payment_for_hash`'s documentation has been
409    corrected to remove the one-year restriction on `invoice_expiry_delta_secs`,
410    which is only applicable to the deprecated `create_inbound_payment_legacy`
411    and `create_inbound_payment_for_hash_legacy` methods (#1341).
412  * `Features` mutator methods now take `self` by reference instead of by value
413    (#1331).
414  * The CLTV of the last hop in a path is now included when comparing against
415    `RouteParameters::max_total_cltv_expiry_delta` (#1358).
416  * Invoice creation functions in `lightning-invoice` crate's `utils` module
417    include versions that accept a description hash instead of only a description
418    (#1361).
419  * `RoutingMessageHandler::sync_routing_table` has been renamed `peer_connected`
420    (#1368).
421  * `MessageSendEvent::SendGossipTimestampFilter` has been added to indicate that
422    a `gossip_timestamp_filter` should be sent (#1368).
423  * `PeerManager` takes an optional `NetAddress` in `new_outbound_connection` and
424    `new_inbound_connection`, which is used to report back the remote address to
425    the connecting peer in the `init` message (#1326).
426  * `ChannelManager::accept_inbound_channel` now takes a `user_channel_id`, which
427    is used in a similar manner as in outbound channels. (#1381).
428  * `BackgroundProcessor` now persists `NetworkGraph` on a timer and upon
429    shutdown as part of a new `Persister` trait, which also includes
430    `ChannelManager` persistence (#1376).
431  * `ProbabilisticScoringParameters` now has a `base_penalty_msat` option, which
432    default to 500 msats. It is applied at each hop to help avoid longer paths
433    (#1375).
434  * `ProbabilisticScoringParameters::liquidity_penalty_multiplier_msat`'s default
435    value is now 40,000 msats instead of 10,000 msats (#1375).
436  * The `lightning` crate has a `grind_signatures` feature used to produce
437    signatures with low r-values for more predictable transaction weight. This
438    feature is on by default (#1388).
439  * `ProbabilisticScoringParameters` now has a `amount_penalty_multiplier_msat`
440    option, which is used to further penalize large amounts (#1399).
441  * `PhantomRouteHints`, `FixedPenaltyScorer`, and `ScoringParameters` now
442    implement `Clone` (#1346).
443
444 ## Bug Fixes
445  * Fixed a compilation error in `ProbabilisticScorer` under `--feature=no-std`
446    (#1347).
447  * Invoice creation functions in `lightning-invoice` crate's `utils` module
448    filter invoice hints in order to limit the invoice size (#1325).
449  * Fixed a bug where a `funding_locked` message was delayed by a block if the
450    funding transaction was confirmed while offline, depending on the ordering
451    of `Confirm::transactions_confirmed` calls when brought back online (#1363).
452  * Fixed a bug in `NetGraphMsgHandler` where it didn't continue to receive
453    gossip messages from peers after initial connection (#1368, #1382).
454  * `ChannelManager::timer_tick_occurred` will now timeout a received multi-path
455    payment (MPP) after three ticks if not received in full instead of waiting
456    until near the HTLC timeout block(#1353).
457  * Fixed an issue with `find_route` causing it to be overly aggressive in using
458    MPP over channels to the same first hop (#1370).
459  * Reduced time spent processing `channel_update` messages by checking
460    signatures after checking if no newer messages have already been processed
461    (#1380).
462  * Fixed a few issues in `find_route` which caused preferring paths with a
463    higher cost (#1398).
464  * Fixed an issue in `ProbabilisticScorer` where a channel with not enough
465    liquidity could still be used when retrying a failed payment if it was on a
466    path with an overall lower cost (#1399).
467
468 ## Serialization Compatibility
469  * Channels open with `option_scid_alias` negotiated will be incompatible with
470    prior releases (#1351). This may occur in the following cases:
471    * Outbound channels when `ChannelHandshakeConfig::negotiate_scid_privacy` is
472      enabled.
473    * Inbound channels when automatically accepted from an `OpenChannel` message
474      with a `channel_type` that has `ChannelTypeFeatures::supports_scid_privacy`
475      return true. See `UserConfig::accept_inbound_channels`.
476    * Inbound channels when manually accepted from an `OpenChannelRequest` with a
477      `channel_type` that has `ChannelTypeFeatures::supports_scid_privacy` return
478      true. See `UserConfig::manually_accept_inbound_channels`.
479
480 In total, this release features 43 files changed, 4052 insertions, 1274
481 deletions in 75 commits from 11 authors, in alphabetical order:
482  * Devrandom
483  * Duncan Dean
484  * Elias Rohrer
485  * Jeffrey Czyz
486  * Jurvis Tan
487  * Luiz Parreira
488  * Matt Corallo
489  * Omar Shamardy
490  * Viktor Tigerström
491  * dependabot[bot]
492  * psycho-pirate
493
494
495 # 0.0.105 - 2022-02-28
496
497 ## API Updates
498  * `Phantom node` payments are now supported, allowing receipt of a payment on
499    any one of multiple nodes without any coordination across the nodes being
500    required. See the new `PhantomKeysManager`'s docs for more, as well as
501    requirements on `KeysInterface::get_inbound_payment_key_material` and
502    `lightning_invoice::utils::create_phantom_invoice` (#1199).
503  * In order to support phantom node payments, several `KeysInterface` methods
504    now accept a `Recipient` parameter to select between the local `node_id` and
505    a phantom-specific one.
506  * `ProbabilisticScorer`, a `Score` based on learning the current balances of
507    channels in the network, was added. It attempts to better capture payment
508    success probability than the existing `Scorer`, though may underperform on
509    nodes with low payment volume. We welcome feedback on performance (#1227).
510  * `Score::channel_penalty_msat` now always takes the channel value, instead of
511    an `Option` (#1227).
512  * `UserConfig::manually_accept_inbound_channels` was added which, when set,
513    generates a new `Event::OpenChannelRequest`, which allows manual acceptance
514    or rejection of incoming channels on a per-channel basis (#1281).
515  * `Payee` has been renamed to `PaymentParameters` (#1271).
516  * `PaymentParameters` now has a `max_total_cltv_expiry_delta` field. This
517    defaults to 1008 and limits the maximum amount of time an HTLC can be pending
518    before it will either fail or be claimed (#1234).
519  * The `lightning-invoice` crate now supports no-std environments. This required
520    numerous API changes around timestamp handling and std+no-std versions of
521    several methods that previously assumed knowledge of the time (#1223, #1230).
522  * `lightning-invoice` now supports parsing invoices with expiry times of more
523    than one year. This required changing the semantics of `ExpiryTime` (#1273).
524  * The `CounterpartyCommitmentSecrets` is now public, allowing external uses of
525    the `BOLT 3` secret storage scheme (#1299).
526  * Several `Sign` methods now receive HTLC preimages as proof of state
527    transition, see new documentation for more (#1251).
528  * `KeysInterface::sign_invoice` now provides the HRP and other invoice data
529    separately to make it simpler for external signers to parse (#1272).
530  * `Sign::sign_channel_announcement` now returns both the node's signature and
531    the per-channel signature. `InMemorySigner` now requires the node's secret
532    key in order to implement this (#1179).
533  * `ChannelManager` deserialization will now fail if the `KeysInterface` used
534    has a different `node_id` than the `ChannelManager` expects (#1250).
535  * A new `ErrorAction` variant was added to send `warning` messages (#1013).
536  * Several references to `chain::Listen` objects in `lightning-block-sync` no
537    longer require a mutable reference (#1304).
538
539 ## Bug Fixes
540  * Fixed a regression introduced in 0.0.104 where `ChannelManager`'s internal
541    locks could have an order violation leading to a deadlock (#1238).
542  * Fixed cases where slow code (including user I/O) could cause us to
543    disconnect peers with ping timeouts in `BackgroundProcessor` (#1269).
544  * Now persist the `ChannelManager` prior to `BackgroundProcessor` stopping,
545    preventing race conditions where channels are closed on startup even with a
546    clean shutdown. This requires that users stop network processing and
547    disconnect peers prior to `BackgroundProcessor` shutdown (#1253).
548  * Fields in `ChannelHandshakeLimits` provided via the `override_config` to
549    `create_channel` are now applied instead of the default config (#1292).
550  * Fixed the generation of documentation on docs.rs to include API surfaces
551    which are hidden behind feature flags (#1303).
552  * Added the `channel_type` field to `accept_channel` messages we send, which
553    may avoid some future compatibility issues with other nodes (#1314).
554  * Fixed a bug where, if a previous LDK run using `lightning-persister` crashed
555    while persisting updated data, we may have failed to initialize (#1332).
556  * Fixed a rare bug where having both pending inbound and outbound HTLCs on a
557    just-opened inbound channel could cause `ChannelDetails::balance_msat` to
558    underflow and be reported as large, or cause panics in debug mode (#1268).
559  * Moved more instances of verbose gossip logging from the `Trace` level to the
560    `Gossip` level (#1220).
561  * Delayed `announcement_signatures` until the channel has six confirmations,
562    slightly improving propagation of channel announcements (#1179).
563  * Several fixes in script and transaction weight calculations when anchor
564    outputs are enabled (#1229).
565
566 ## Serialization Compatibility
567  * Using `ChannelManager` data written by versions prior to 0.0.105 will result
568    in preimages for HTLCs that were pending at startup to be missing in calls
569    to `KeysInterface` methods (#1251).
570  * Any phantom invoice payments received on a node that is not upgraded to
571    0.0.105 will fail with an "unknown channel" error. Further, downgrading to
572    0.0.104 or before and then upgrading again will invalidate existing phantom
573    SCIDs which may be included in invoices (#1199).
574
575 ## Security
576 0.0.105 fixes two denial-of-service vulnerabilities which may be reachable from
577 untrusted input in certain application designs.
578
579  * Route calculation spuriously panics when a routing decision is made for a
580    path where the second-to-last hop is a private channel, included due to a
581    multi-hop route hint in an invoice.
582  * `ChannelMonitor::get_claimable_balances` spuriously panics in some scenarios
583    when the LDK application's local commitment transaction is confirmed while
584    HTLCs are still pending resolution.
585
586 In total, this release features 109 files changed, 7270 insertions, 2131
587 deletions in 108 commits from 15 authors, in alphabetical order:
588  * Conor Okus
589  * Devrandom
590  * Elias Rohrer
591  * Jeffrey Czyz
592  * Jurvis Tan
593  * Ken Sedgwick
594  * Matt Corallo
595  * Naveen
596  * Tibo-lg
597  * Valentine Wallace
598  * Viktor Tigerström
599  * dependabot[bot]
600  * hackerrdave
601  * naveen
602  * vss96
603
604
605 # 0.0.104 - 2021-12-17
606
607 ## API Updates
608  * A `PaymentFailed` event is now provided to indicate a payment has failed
609    fully. This event is generated either after
610    `ChannelManager::abandon_payment` is called for a given payment, or the
611    payment times out, and there are no further pending HTLCs for the payment.
612    This event should be used to detect payment failure instead of
613    `PaymentPathFailed::all_paths_failed`, unless no payment retries occur via
614    `ChannelManager::retry_payment` (#1202).
615  * Payment secrets are now generated deterministically using material from
616    the new `KeysInterface::get_inbound_payment_key_material` (#1177).
617  * A `PaymentPathSuccessful` event has been added to ease passing success info
618    to a scorer, along with a `Score::payment_path_successful` method to accept
619    such info (#1178, #1197).
620  * `Score::channel_penalty_msat` has additional arguments describing the
621    channel's capacity and the HTLC amount being sent over the channel (#1166).
622  * A new log level `Gossip` has been added, which is used for verbose
623    information generated during network graph sync. Enabling the
624    `max_level_trace` feature or ignoring `Gossip` log entries reduces log
625    growth during initial start up from many GiB to several MiB (#1145).
626  * The `allow_wallclock_use` feature has been removed in favor of only using
627    the `std` and `no-std` features (#1212).
628  * `NetworkGraph` can now remove channels that we haven't heard updates for in
629    two weeks with `NetworkGraph::remove_stale_channels{,with_time}`. The first
630    is called automatically if a `NetGraphMsgHandler` is passed to
631    `BackgroundProcessor::start` (#1212).
632  * `InvoicePayer::pay_pubkey` was added to enable sending "keysend" payments to
633    supported recipients, using the `InvoicePayer` to handle retires (#1160).
634  * `user_payment_id` has been removed from `PaymentPurpose`, and
635    `ChannelManager::create_inbound_payment{,_for_hash}` (#1180).
636  * Updated documentation for several `ChannelManager` functions to remove stale
637    references to panics which no longer occur (#1201).
638  * The `Score` and `LockableScore` objects have moved into the
639    `routing::scoring` module instead of being in the `routing` module (#1166).
640  * The `Time` parameter to `ScorerWithTime` is no longer longer exposed,
641    instead being fixed based on the `std`/`no-std` feature (#1184).
642  * `ChannelDetails::balance_msat` was added to fetch a channel's balance
643    without subtracting the reserve values, lining up with on-chain claim amounts
644    less on-chain fees (#1203).
645  * An explicit `UserConfig::accept_inbound_channels` flag is now provided,
646    removing the need to set `min_funding_satoshis` to > 21 million BTC (#1173).
647  * Inbound channels that fail to see the funding transaction confirm within
648    2016 blocks are automatically force-closed with
649    `ClosureReason::FundingTimedOut` (#1083).
650  * We now accept a channel_reserve value of 0 from counterparties, as it is
651    insecure for our counterparty but not us (#1163).
652  * `NetAddress::OnionV2` parsing was removed as version 2 onion services are no
653    longer supported in modern Tor (#1204).
654  * Generation and signing of anchor outputs is now supported in the
655    `KeysInterface`, though no support for them exists in the channel itself (#1176)
656
657 ## Bug Fixes
658  * Fixed a race condition in `InvoicePayer` where paths may be retried after
659    the retry count has been exceeded. In this case the
660    `Event::PaymentPathFailed::all_paths_failed` field is not a reliable payment
661    failure indicator. There was no acceptable alternative indicator,
662    `Event::PaymentFailed` as been added to provide one (#1202).
663  * Reduced the blocks-before-timeout we expect of outgoing HTLCs before
664    refusing to forward. This check was overly strict and resulted in refusing
665    to forward som HTLCs to a next hop that had a lower security threshold than
666    us (#1119).
667  * LDK no longer attempt to update the channel fee for outbound channels when
668    we cannot afford the new fee. This could have caused force-closure by our
669    channel counterparty (#1054).
670  * Fixed several bugs which may have prevented the reliable broadcast of our
671    own channel announcements and updates (#1169).
672  * Fixed a rare bug which may have resulted in spurious route finding failures
673    when using last-hop hints and MPP with large value payments (#1168).
674  * `KeysManager::spend_spendable_outputs` no longer adds a change output that
675    is below the dust threshold for non-standard change scripts (#1131).
676  * Fixed a minor memory leak when attempting to send a payment that fails due
677    to an error when updating the `ChannelMonitor` (#1143).
678  * Fixed a bug where a `FeeEstimator` that returns values rounded to the next
679    sat/vbyte may result in force-closures (#1208).
680  * Handle MPP timeout HTLC error codes, instead of considering the recipient to
681    have sent an invalid error, removing them from the network graph (#1148)
682
683 ## Serialization Compatibility
684  * All above new events/fields are ignored by prior clients. All above new
685    events/fields are not present when reading objects serialized by prior
686    versions of the library.
687  * Payment secrets are now generated deterministically. This reduces the memory
688    footprint for inbound payments, however, newly-generated inbound payments
689    using `ChannelManager::create_inbound_payment{,_for_hash}` will not be
690    receivable using versions prior to 0.0.104.
691    `ChannelManager::create_inbound_payment{,_for_hash}_legacy` are provided for
692    backwards compatibility (#1177).
693  * `PaymentPurpose::InvoicePayment::user_payment_id` will be 0 when reading
694    objects written with 0.0.104 when read by 0.0.103 and previous (#1180).
695
696 In total, this release features 51 files changed, 5356 insertions, 2238
697 deletions in 107 commits from 9 authors, in alphabetical order:
698  * Antoine Riard
699  * Conor Okus
700  * Devrandom
701  * Duncan Dean
702  * Elias Rohrer
703  * Jeffrey Czyz
704  * Ken Sedgwick
705  * Matt Corallo
706  * Valentine Wallace
707
708
709 # 0.0.103 - 2021-11-02
710
711 ## API Updates
712  * This release is almost entirely focused on a new API in the
713    `lightning-invoice` crate - the `InvoicePayer`. `InvoicePayer` is a
714    struct which takes a reference to a `ChannelManager` and a `Router`
715    and retries payments as paths fail. It limits retries to a configurable
716    number, but is not serialized to disk and may retry additional times across
717    a serialization/load. In order to learn about failed payments, it must
718    receive `Event`s directly from the `ChannelManager`, wrapping a
719    user-provided `EventHandler` which it provides all unhandled events to
720    (#1059).
721  * `get_route` has been renamed `find_route` (#1059) and now takes a
722    `RouteParameters` struct in replacement of a number of its long list of
723    arguments (#1134). The `Payee` in the `RouteParameters` is stored in the
724    `Route` object returned and provided in the `RouteParameters` contained in
725    `Event::PaymentPathFailed` (#1059).
726  * `ChannelMonitor`s must now be persisted after calls that provide new block
727    data, prior to `MonitorEvent`s being passed back to `ChannelManager` for
728    processing. If you are using a `ChainMonitor` this is handled for you.
729    The `Persist` API has been updated to `Option`ally take the
730    `ChannelMonitorUpdate` as persistence events that result from chain data no
731    longer have a corresponding update (#1108).
732  * `routing::Score` now has a `payment_path_failed` method which it can use to
733    learn which channels often fail payments. It is automatically called by
734    `InvoicePayer` for failed payment paths (#1144).
735  * The default `Scorer` implementation is now a type alias to a type generic
736    across different clocks and supports serialization to persist scoring data
737    across restarts (#1146).
738  * `Event::PaymentSent` now includes the full fee which was spent across all
739    payment paths which were fulfilled or pending when the payment was fulfilled
740    (#1142).
741  * `Event::PaymentSent` and `Event::PaymentPathFailed` now include the
742    `PaymentId` which matches the `PaymentId` returned from
743    `ChannelManager::send_payment` or `InvoicePayer::pay_invoice` (#1059).
744  * `NetGraphMsgHandler` now takes a `Deref` to the `NetworkGraph`, allowing for
745    shared references to the graph data to make serialization and references to
746    the graph data in the `InvoicePayer`'s `Router` simpler (#1149).
747  * `routing::Score::channel_penalty_msat` has been updated to provide the
748    `NodeId` of both the source and destination nodes of a channel (#1133).
749
750 ## Bug Fixes
751  * Previous versions would often disconnect peers during initial graph sync due
752    to ping timeouts while processing large numbers of gossip messages. We now
753    delay disconnecting peers if we receive messages from them even if it takes
754    a while to receive a pong from them. Further, we avoid sending too many
755    gossip messages between pings to ensure we should always receive pongs in a
756    timely manner (#1137).
757  * If a payment was sent, creating an outbound HTLC and sending it to our
758    counterparty (implying the `ChannelMonitor` was persisted on disk), but the
759    `ChannelManager` was not persisted prior to shutdown/crash, no
760    `Event::PaymentPathFailed` event was generated if the HTLC was eventually
761    failed on chain. Events are now consistent irrespective of `ChannelManager`
762    persistence or non-persistence (#1104).
763
764 ## Serialization Compatibility
765  * All above new Events/fields are ignored by prior clients. All above new
766    Events/fields are not present when reading objects serialized by prior
767    versions of the library.
768  * Payments for which a `Route` was generated using a previous version or for
769    which the payment was originally sent by a previous version of the library
770    will not be retried by an `InvoicePayer`.
771
772 This release was singularly focused and some contributions by third parties
773 were delayed.
774 In total, this release features 38 files changed, 4414 insertions, and 969
775 deletions in 71 commits from 2 authors, in alphabetical order:
776
777  * Jeffrey Czyz
778  * Matt Corallo
779
780
781 # 0.0.102 - 2021-10-18
782
783 ## API Updates
784  * `get_route` now takes a `Score` as an argument. `Score` is queried during
785    the route-finding process, returning the absolute amounts which you are
786    willing to pay to avoid routing over a given channel. As a default, a
787    `Scorer` is provided which returns a constant amount, with a suggested
788    default of 500 msat. This translates to a willingness to pay up to 500 msat
789    in additional fees per hop in order to avoid additional hops (#1124).
790  * `Event::PaymentPathFailed` now contains a `short_channel_id` field which may
791    be filled in with a channel that can be "blamed" for the payment failure.
792    Payment retries should likely avoid the given channel for some time (#1077).
793  * `PublicKey`s in `NetworkGraph` have been replaced with a `NodeId` struct
794    which contains only a simple `[u8; 33]`, substantially improving
795    `NetworkGraph` deserialization performance (#1107).
796  * `ChainMonitor`'s `HashMap` of `ChannelMonitor`s is now private, exposed via
797    `Chainmonitor::get_monitor` and `ChainMonitor::list_monitors` instead
798    (#1112).
799  * When an outbound channel is closed prior to the broadcasting of its funding
800    transaction, but after you call
801    `ChannelManager::funding_transaction_generated`, a new event type,
802    `Event::DiscardFunding`, is generated, informing you the transaction was not
803    broadcasted and that you can spend the same inputs again elsewhere (#1098).
804  * `ChannelManager::create_channel` now returns the temporary channel ID which
805    may later appear in `Event::ChannelClosed` or `ChannelDetails` prior to the
806    channel being funded (#1121).
807  * `Event::PaymentSent` now contains the payment hash as well as the payment
808    preimage (#1062).
809  * `ReadOnlyNetworkGraph::get_addresses` now returns owned `NetAddress` rather
810    than references. As a side-effect this method is now exposed in foreign
811    language bindings (#1115).
812  * The `Persist` and `ChannelMonitorUpdateErr` types have moved to the
813    `lightning::chain::chainmonitor` and `lightning::chain` modules,
814    respectively (#1112).
815  * `ChannelManager::send_payment` now returns a `PaymentId` which identifies a
816    payment (whether MPP or not) and can be used to retry the full payment or
817    MPP parts through `retry_payment` (#1096). Note that doing so is currently
818    *not* crash safe, and you may find yourself sending twice. It is recommended
819    that you *not* use the `retry_payment` API until the next release.
820
821 ## Bug Fixes
822  * Due to an earlier fix for the Lightning dust inflation vulnerability tracked
823    in CVE-2021-41591/CVE-2021-41592/CVE-2021-41593 in 0.0.100, we required
824    counterparties to accept a dust limit slightly lower than the dust limit now
825    required by other implementations. This appeared as, at least, latest lnd
826    always refusing to accept channels opened by LDK clients (#1065).
827  * If there are multiple channels available to the same counterparty,
828    `get_route` would only consider the channel listed last as available for
829    sending (#1100).
830  * `Persist` implementations returning
831    `ChannelMonitorUpdateErr::TemporaryFailure` from `watch_channel` previously
832    resulted in the `ChannelMonitor` not being stored at all, resulting in a
833    panic after monitor updating is complete (#1112).
834  * If payments are pending awaiting forwarding at startup, an
835    `Event::PendingHTLCsForwardable` event will always be provided. This ensures
836    user code calls `ChannelManager::process_pending_htlc_fowards` even if it
837    shut down while awaiting the batching timer during the previous run (#1076).
838  * If a call to `ChannelManager::send_payment` failed due to lack of
839    availability of funds locally, LDK would store the payment as pending
840    forever, with no ability to retry or fail it, leaking memory (#1109).
841
842 ## Serialization Compatibility
843  * All above new Events/fields are ignored by prior clients. All above new
844    Events/fields, except for `Event::PaymentSent::payment_hash` are not present
845    when reading objects serialized by prior versions of the library.
846
847 In total, this release features 32 files changed, 2248 insertions, and 1483
848 deletions in 51 commits from 7 authors, in alphabetical order:
849
850  * 1nF0rmed
851  * Duncan Dean
852  * Elias Rohrer
853  * Galder Zamarreño
854  * Jeffrey Czyz
855  * Matt Corallo
856  * Valentine Wallace
857
858
859 # 0.0.101 - 2021-09-23
860
861 ## API Updates
862  * Custom message types are now supported directly in the `PeerManager`,
863    allowing you to send and receive messages of any type that is not natively
864    understood by LDK. This requires a new type bound on `PeerManager`, a
865    `CustomMessageHandler`. `IgnoringMessageHandler` provides a simple default
866    for this new bound for ignoring unknown messages (#1031, #1074).
867  * Route graph updates as a result of failed payments are no longer provided as
868    `MessageSendEvent::PaymentFailureNetworkUpdate` but instead included in a
869    new field in the `Event::PaymentFailed` events. Generally, this means route
870    graph updates are no longer handled as a part of the `PeerManager` but
871    instead through the new `EventHandler` implementation for
872    `NetGraphMsgHandler`. To make this easy, a new parameter to
873    `lightning-background-processor::BackgroundProcessor::start` is added, which
874    contains an `Option`al `NetGraphmsgHandler`. If provided as `Some`, relevant
875    events will be processed by the `NetGraphMsgHandler` prior to normal event
876    handling (#1043).
877  * `NetworkGraph` is now, itself, thread-safe. Accordingly, most functions now
878    take `&self` instead of `&mut self` and the graph data can be accessed
879    through `NetworkGraph.read_only` (#1043).
880  * The balances available on-chain to claim after a channel has been closed are
881    now exposed via `ChannelMonitor::get_claimable_balances` and
882    `ChainMonitor::get_claimable_balances`. The second can be used to get
883    information about all closed channels which still have on-chain balances
884    associated with them. See enum variants of `ln::channelmonitor::Balance` and
885    method documentation for the above methods for more information on the types
886    of balances exposed (#1034).
887  * When one HTLC of a multi-path payment fails, the new field `all_paths_failed`
888    in `Event::PaymentFailed` is set to `false`. This implies that the payment
889    has not failed, but only one part. Payment resolution is only indicated by an
890    `Event::PaymentSent` event or an `Event::PaymentFailed` with
891    `all_paths_failed` set to `true`, which is also set for the last remaining
892    part of a multi-path payment (#1053).
893  * To better capture the context described above, `Event::PaymentFailed` has
894    been renamed to `Event::PaymentPathFailed` (#1084).
895  * A new event, `ChannelClosed`, is provided by `ChannelManager` when a channel
896    is closed, including a reason and error message (if relevant, #997).
897  * `lightning-invoice` now considers invoices with sub-millisatoshi precision
898    to be invalid, and requires millisatoshi values during construction (thus
899    you must call `amount_milli_satoshis` instead of `amount_pico_btc`, #1057).
900  * The `BaseSign` interface now includes two new hooks which provide additional
901    information about commitment transaction signatures and revocation secrets
902    provided by our counterparty, allowing additional verification (#1039).
903  * The `BaseSign` interface now includes additional information for cooperative
904    close transactions, making it easier for a signer to verify requests (#1064).
905  * `Route` has two additional helper methods to get fees and amounts (#1063).
906  * `Txid` and `Transaction` objects can now be deserialized from responses when
907    using the HTTP client in the `lightning-block-sync` crate (#1037, #1061).
908
909 ## Bug Fixes
910  * Fix a panic when reading a lightning invoice with a non-recoverable
911    signature. Further, restrict lightning invoice parsing to require payment
912    secrets and better handle a few edge cases as required by BOLT 11 (#1057).
913  * Fix a panic when receiving multiple messages (such as HTLC fulfill messages)
914    after a call to `chain::Watch::update_channel` returned
915    `Err(ChannelMonitorUpdateErr::TemporaryFailure)` with no
916    `ChannelManager::channel_monitor_updated` call in between (#1066).
917  * For multi-path payments, `Event::PaymentSent` is no longer generated
918    multiple times, once for each independent part (#1053).
919  * Multi-hop route hints in invoices are now considered in the default router
920    provided via `get_route` (#1040).
921  * The time peers have to respond to pings has been increased when building
922    with debug assertions enabled. This avoids peer disconnections on slow hosts
923    when running in debug mode (#1051).
924  * The timeout for the first byte of a response for requests from the
925    `lightning-block-sync` crate has been increased to 300 seconds to better
926    handle the long hangs in Bitcoin Core when it syncs to disk (#1090).
927
928 ## Serialization Compatibility
929  * Due to a bug in 0.0.100, `Event`s written by 0.0.101 which are of a type not
930    understood by 0.0.100 may lead to `Err(DecodeError::InvalidValue)` or corrupt
931    deserialized objects in 0.100. Such `Event`s will lead to an
932    `Err(DecodeError::InvalidValue)` in versions prior to 0.0.100. The only such
933    new event written by 0.0.101 is `Event::ChannelClosed` (#1087).
934  * Payments that were initiated in versions prior to 0.0.101 may still
935    generate duplicate `PaymentSent` `Event`s or may have spurious values for
936    `Event::PaymentPathFailed::all_paths_failed` (#1053).
937  * The return values of `ChannelMonitor::get_claimable_balances` (and, thus,
938    `ChainMonitor::get_claimable_balances`) may be spurious for channels where
939    the spend of the funding transaction appeared on chain while running a
940    version prior to 0.0.101. `Balance` information should only be relied upon
941    for channels that were closed while running 0.0.101+ (#1034).
942  * Payments failed while running versions prior to 0.0.101 will never have a
943    `Some` for the `network_update` field (#1043).
944
945 In total, this release features 67 files changed, 4980 insertions, 1888
946 deletions in 89 commits from 12 authors, in alphabetical order:
947  * Antoine Riard
948  * Devrandom
949  * Galder Zamarreño
950  * Giles Cope
951  * Jeffrey Czyz
952  * Joseph Goulden
953  * Matt Corallo
954  * Sergi Delgado Segura
955  * Tibo-lg
956  * Valentine Wallace
957  * abhik-99
958  * vss96
959
960
961 # 0.0.100 - 2021-08-17 - "Oh, so *that's* what's going on inside the box"
962
963 ## API Updates
964  * The `lightning` crate can now be built in no_std mode, making it easy to
965    target embedded hardware for rust users. Note that mutexes are replaced with
966    no-ops for such builds (#1008, #1028).
967  * LDK now supports sending and receiving "keysend" payments. This includes
968    modifications to `lightning::util::events::Event::PaymentReceived` to
969    indicate the type of payment (#967).
970  * A new variant, `lightning::util::events::Event::PaymentForwarded` has been
971    added which indicates a forwarded payment has been successfully claimed and
972    we've received a forwarding fee (#1004).
973  * `lightning::chain::keysinterface::KeysInterface::get_shutdown_pubkey` has
974    been renamed to `get_shutdown_scriptpubkey`, returns a script, and is now
975    called on channel open only if
976    `lightning::util::config::ChannelConfig::commit_upfront_shutdown_pubkey` is
977    set (#1019).
978  * Closing-signed negotiation is now more configurable, with an explicit
979    `lightning::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis`
980    field allowing you to select the maximum amount you are willing to pay to
981    avoid a force-closure. Further, we are now less restrictive on the fee
982    placed on the closing transaction when we are not the party paying it. To
983    control the feerate paid on a channel at close-time, use
984    `ChannelManager::close_channel_with_target_feerate` instead of
985    `close_channel` (#1011).
986  * `lightning_background_processor::BackgroundProcessor` now stops the
987    background thread when dropped (#1007). It is marked `#[must_use]` so that
988    Rust users will receive a compile-time warning when it is immediately
989    dropped after construction (#1029).
990  * Total potential funds burn on force-close due to dust outputs is now limited
991    to `lightning::util::config::ChannelConfig::max_dust_htlc_exposure_msat` per
992    channel (#1009).
993  * The interval on which
994    `lightning::ln::peer_handler::PeerManager::timer_tick_occurred` should be
995    called has been reduced to once every five seconds (#1035) and
996    `lightning::ln::channelmanager::ChannelManager::timer_tick_occurred` should
997    now be called on startup in addition to once per minute (#985).
998  * The rust-bitcoin and bech32 dependencies have been updated to their
999    respective latest versions (0.27 and 0.8, #1012).
1000
1001 ## Bug Fixes
1002  * Fix panic when reading invoices generated by some versions of c-lightning
1003    (#1002 and #1003).
1004  * Fix panic when attempting to validate a signed message of incorrect length
1005    (#1010).
1006  * Do not ignore the route hints in invoices when the invoice is over 250k
1007    sats (#986).
1008  * Fees are automatically updated on outbound channels to ensure commitment
1009    transactions are always broadcastable (#985).
1010  * Fixes a rare case where a `lightning::util::events::Event::SpendableOutputs`
1011    event is not generated after a counterparty commitment transaction is
1012    confirmed in a reorg when a conflicting local commitment transaction is
1013    removed in the same reorg (#1022).
1014  * Fixes a remotely-triggerable force-closure of an origin channel after an
1015    HTLC was forwarded over a next-hop channel and the next-hop channel was
1016    force-closed by our counterparty (#1025).
1017  * Fixes a rare force-closure case when sending a payment as a channel fundee
1018    when overdrawing our remaining balance. Instead the send will fail (#998).
1019  * Fixes a rare force-closure case when a payment was claimed prior to a
1020    peer disconnection or restart, and later failed (#977).
1021
1022 ## Serialization Compatibility
1023  * Pending inbound keysend payments which have neither been failed nor claimed
1024    when serialized will result in a `ChannelManager` which is not readable on
1025    pre-0.0.100 clients (#967).
1026  * Because
1027    `lightning::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey`
1028    has been updated to return a script instead of only a `PublicKey`,
1029    `ChannelManager`s constructed with custom `KeysInterface` implementations on
1030    0.0.100 and later versions will not be readable on previous versions.
1031    `ChannelManager`s created with 0.0.99 and prior versions will remain readable
1032    even after the a serialization roundtrip on 0.0.100, as long as no new
1033    channels are opened. Further, users using a
1034    `lightning::chain::keysinterface::KeysManager` as their `KeysInterface` will
1035    have `ChannelManager`s which are readable on prior versions as well (#1019).
1036  * `ChannelMonitorUpdate`s created by 0.0.100 and later for channels when
1037    `lightning::util::config::ChannelConfig::commit_upfront_shutdown_pubkey` is
1038    not set may not be readable by versions prior to 0.0.100 (#1019).
1039  * HTLCs which were in the process of being claimed on-chain when a pre-0.0.100
1040    `ChannelMonitor` was serialized may generate `PaymentForwarded` events with
1041    spurious `fee_earned_msat` values. This only applies to payments which were
1042    unresolved at the time of the upgrade (#1004).
1043  * 0.0.100 clients with pending `Event::PaymentForwarded` events at
1044    serialization-time will generate serialized `ChannelManager` objects which
1045    0.0.99 and earlier clients cannot read. The likelihood of this can be reduced
1046    by ensuring you process all pending events immediately before serialization
1047    (as is done by the `lightning-background-processor` crate, #1004).
1048
1049
1050 In total, this release features 59 files changed, 5861 insertions, and 2082
1051 deletions in 95 commits from 6 authors.
1052
1053
1054 # 0.0.99 - 2021-07-09 - "It's a Bugz Life"
1055
1056 ## API Updates
1057
1058  * `lightning_block_sync::poll::Validate` is now public, allowing you to
1059    implement the `lightning_block_sync::poll::Poll` trait without
1060    `lightning_block_sync::poll::ChainPoller` (#956).
1061  * `lightning::ln::peer_handler::PeerManager` no longer requires that no calls
1062    are made to referencing the same `SocketDescriptor` after
1063    `disconnect_socket` returns. This makes the API significantly less
1064    deadlock-prone and simplifies `SocketDescriptor` implementations
1065    significantly. The relevant changes have been made to `lightning_net_tokio`
1066    and `PeerManager` documentation has been substantially rewritten (#957).
1067  * `lightning::util::message_signing`'s `sign` and `verify` methods now take
1068    secret and public keys by reference instead of value (#974).
1069  * Substantially more information is now exposed about channels in
1070    `ChannelDetails`. See documentation for more info (#984 and #988).
1071  * The latest best block seen is now exposed in
1072    `ChannelManager::current_best_block` and
1073    `ChannelMonitor::current_best_block` (#984).
1074  * Feerates charged when forwarding payments over channels is now set in
1075    `ChannelConfig::fee_base_msat` when the channel is opened. For existing
1076    channels, the value is set to the value provided in
1077    `ChannelManagerReadArgs::default_config::channel_options` the first time the
1078    `ChannelManager` is loaded in 0.0.99 (#975).
1079  * We now reject HTLCs which are received to be forwarded over private channels
1080    unless `UserConfig::accept_forwards_to_priv_channels` is set. Note that
1081    `UserConfig` is never serialized and must be provided via
1082    `ChannelManagerReadArgs::default_config` at each start (#975).
1083
1084 ## Bug Fixes
1085
1086  * We now forward gossip messages to peers instead of only relaying
1087    locally-generated gossip or sending gossip messages during initial sync
1088    (#948).
1089  * Correctly send `channel_update` messages to direct peers on private channels
1090    (#949). Without this, a private node connected to an LDK node over a private
1091    channel cannot receive funds as it does not know which fees the LDK node
1092    will charge.
1093  * `lightning::ln::channelmanager::ChannelManager` no longer expects to be
1094    persisted spuriously after we receive a `channel_update` message about any
1095    channel in the routing gossip (#972).
1096  * Asynchronous `ChannelMonitor` updates (using the
1097    `ChannelMonitorUpdateErr::TemporaryFailure` return variant) no longer cause
1098    spurious HTLC forwarding failures (#954).
1099  * Transaction provided via `ChannelMonitor::transactions_confirmed`
1100    after `ChannelMonitor::best_block_updated` was called for a much later
1101    block now trigger all relevant actions as of the later block. Previously
1102    some transaction broadcasts or other responses required an additional
1103    block be provided via `ChannelMonitor::best_block_updated` (#970).
1104  * We no longer panic in rare cases when an invoice contained last-hop route
1105    hints which were unusable (#958).
1106
1107 ## Node Compatibility
1108
1109  * We now accept spurious `funding_locked` messages sent prior to
1110    `channel_reestablish` messages after reconnect. This is a
1111    [known, long-standing bug in lnd](https://github.com/lightningnetwork/lnd/issues/4006)
1112    (#966).
1113  * We now set the `first_blocknum` and `number_of_blocks` fields in
1114    `reply_channel_range` messages to values which c-lightning versions prior to
1115    0.10 accepted. This avoids spurious force-closes from such nodes (#961).
1116
1117 ## Serialization Compatibility
1118
1119  * Due to a bug discovered in 0.0.98, if a `ChannelManager` is serialized on
1120    version 0.0.98 while an `Event::PaymentSent` is pending processing, the
1121    `ChannelManager` will fail to deserialize both on version 0.0.98 and later
1122    versions. If you have such a `ChannelManager` available, a simple patch will
1123    allow it to deserialize. Please file an issue if you need assistance (#973).
1124
1125 # 0.0.98 - 2021-06-11 - "It's ALIVVVVEEEEEEE"
1126
1127 0.0.98 should be considered a release candidate to the first alpha release of
1128 Rust-Lightning and the broader LDK. It represents several years of work
1129 designing and fine-tuning a flexible API for integrating lightning into any
1130 application. LDK should make it easy to build a lightning node or client which
1131 meets specific requirements that other lightning node software cannot. As
1132 lightning continues to evolve, and new use-cases for lightning develop, the API
1133 of LDK will continue to change and expand. However, starting with version 0.1,
1134 objects serialized with prior versions will be readable with the latest LDK.
1135 While Rust-Lightning is approaching the 0.1 milestone, language bindings
1136 components of LDK available at https://github.com/lightningdevkit are still of
1137 varying quality. Some are also approaching an 0.1 release, while others are
1138 still much more experimental. Please note that, at 0.0.98, using Rust-Lightning
1139 on mainnet is *strongly* discouraged.