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