X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=CHANGELOG.md;h=5eff3eb09647167538f6894f522cc774e33194d5;hb=refs%2Fheads%2F2023-08-one-less-write;hp=e12c84a6b567240ed9d0e006f1c05f3516fcb885;hpb=d355ce1b78164d34a59c93b36c064f96462696a4;p=rust-lightning diff --git a/CHANGELOG.md b/CHANGELOG.md index e12c84a6..5eff3eb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,258 @@ +# 0.0.116 - Jul 21, 2023 - "Anchoring the Roadmap" + +## API Updates + + * Support for zero-HTLC-fee anchor output channels has been added and is now + considered beta (#2367). Users who set + `ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx` should be + prepared to handle the new `Event::BumpTransaction`, e.g. via the + `BumpTransactionEventHandler` (#2089). Note that in order to do so you must + ensure you always have a reserve of available unspent on-chain funds to use + for CPFP. LDK currently makes no attempt to ensure this for you. + * Users who set `ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx` + and wish to accept inbound anchor-based channels must do so manually by + setting `UserConfig::manually_accept_inbound_channels` (#2368). + * Support forwarding and accepting HTLCs with a reduced amount has been added, + to support LSPs skimming a fee on the penultimate hop (#2319). + * BOLT11 and BOLT12 Invoice and related types have been renamed to include a + BOLTNN prefix, ensuring uniqueness in `lightning{,-invoice}` crates (#2416). + * `Score`rs now have an associated type which represents a parameter passed + when calculating penalties. This allows for the same `Score`r to be used with + different penalty calculation parameters (#2237). + * `DefaultRouter` is no longer restrained to a `Mutex`-wrapped `Score`, + allowing it to be used in `no-std` builds (#2383). + * `CustomMessageHandler::provided_{node,init}_features` and various custom + feature bit methods on `*Features` were added (#2204). + * Keysend/push payments using MPP are now supported when receiving if + `UserConfig::accept_mpp_keysend` is set and when sending if specified in the + `PaymentParameters`. Note that not all recipients support this (#2156). + * A new `ConfirmationTarget::MempoolMinimum` has been added (#2415). + * `SpendableOutputDescriptor::to_psbt_input` was added (#2286). + * `ChannelManager::update_partial_channel_config` was added (#2330). + * `ChannelDetails::channel_shutdown_state` was added (#2347). + * The shutdown script can now be provided at shutdown time via + `ChannelManager::close_channel_with_feerate_and_script` (#2219). + * `BroadcasterInterface` now takes multiple transactions at once. While not + available today, in the future single calls should be passed to a full node + via a single batch/package transaction acceptance API (#2272). + * `Balance::claimable_amount_satoshis` was added (#2333). + * `payment_{hash,preimage}` have been added to some `Balance` variants (#2217). + * The `lightning::chain::keysinterface` is now `lightning::sign` (#2246). + * Routing to a blinded path has been implemented, though sending to such a + route is not yet supported in `ChannelManager` (#2120). + * `OffersMessageHandler` was added for offers-related onion messages (#2294). + * The `CustomMessageHandler` parameter to `PeerManager` has moved to + `MessageHandler` from `PeerManager::new` explicitly (#2249). + * Various P2P messages for dual funding channel establishment have been added, + though handling for them is not yet in `ChannelManager` (#1794) + * Script-fetching methods in `sign` interfaces can now return errors, see docs + for the implications of failing (#2213). + * The `data_loss_protect` option is now required when reading + `channel_reestablish` messages, as many others have done (#2253). + * `InFlightHtlcs::add_inflight_htlc` has been added (#2042). + * The `init` message `networks` field is now written and checked (#2329). + * `PeerManager` generics have been simplified with the introduction of the + `APeerManager` trait (#2249). + * `ParitalOrd` and `Ord` are now implemented for `Invoice` (#2279). + * `ParitalEq` and `Debug` are now implemented for `InMemorySigner` (#2328). + * `ParitalEq` and `Eq` are now implemented for `PaymentError` (#2316). + * `NetworkGraph::update_channel_from_announcement_no_lookup` was added (#2222). + * `lightning::routing::gossip::verify_{channel,node}_announcement` was added + (#2307). + +## Backwards Compatibility + * `PaymentParameters` written with blinded path info using LDK 0.0.115 will not + be readable in LDK 0.0.116, and vice versa. + * Forwarding less than `Event::HTLCIntercepted::expected_outbound_amount_msat` + in `ChannelManager::forward_intercepted_htlc` may prevent the + `ChannelManager` from being read by LDK prior to 0.0.116 (#2319) + * Setting `ChannelConfig::accept_underpaying_htlcs` may prevent the + `ChannelManager` from being read by LDK prior to 0.0.116 and un-setting the + parameter between restarts may lead to payment failures (#2319). + * `ChannelManager::create_inbound_payment{,_for_hash}_legacy` has been removed, + removing the ability to create inbound payments which are claimable after + downgrade to LDK 0.0.103 and prior. In the future handling such payments will + also be removed (#2351). + * Some fields required by LDK 0.0.103 and earlier are no longer written, thus + deserializing objects written by 0.0.116 with 0.0.103 may now fail (#2351). + +## Bug Fixes + * `ChannelDetails::next_outbound_htlc_limit_msat` was made substantially more + accurate and a corresponding `next_outbound_htlc_minimum_msat` was added. + This resolves issues where unpayable routes were generated due to + overestimation of the amount which is payable over one of our channels as + the first hop (#2312). + * A rare case where delays in processing `Event`s generated by + `ChannelMonitor`s could lead to loss of those events in case of an untimely + crash. This could lead to the loss of an `Event::SpendableOutputs` (#2369). + * Fixed a regression in 0.0.115 which caused `PendingHTLCsForwardable` events + to be missed when processing phantom node receives. This caused such + payments to be delayed until a further, unrelated HTLC came in (#2395). + * Peers which are unresponsive to channel messages for several timer ticks are + now disconnected to allow for on-reconnection state machine reset. This + works around some issues in LND prior to 16.3 which can cause channels to + hang and eventually force-close (#2293). + * `ChannelManager::new` now requires the current time (either from a recent + block header or the system clock), ensuring invoices created immediately + after startup aren't already expired (#2372). + * Resolved an issue where reading a `ProbabilisticScorer` on some platforms + (e.g. iOS) can lead to a panic (#2322). + * `ChannelConfig::max_dust_htlc_exposure` is now allowed to scale based on + current fees, and the default has been updated to do so. This substantially + reduces the chance of force-closure due to dust exposure. Note that existing + channels will retain their current value and you may wish to update the + value on your existing channels on upgrade (#2354). + * `PeerManager::process_events` no longer blocks in any case. This fixes a bug + where reentrancy from `PeerManager` into user code which eventually calls + `process_events` could lead to a deadlock (#2280). + * The persist timing of network graph and scoring in + `lightning-background-processor` has been tweaked to provide more reliable + persistence after updates to either (#2226). + * The number of route hints added to BOLT 11 invoices by the + `lightning-invoice::utils` builders has been reduced to three to ensure + invoices can be represented in scan-able QR codes (#2044). + * Fixed sending large onion messages, which would previously have resulted in + an HMAC error on the second hop (#2277). + * Fixed a memory leak that may occur when a `ChannelManager` or + `ChannelMonitor` is `drop`ed (#2233). + * A potential deadlock in calling `NetworkGraph::eq` was resolved (#2284). + * Fixed an overflow which prevented disconnecting peers in some minor cases + with more than 31 peers (#2245). + * Gossip messages with an unknown chain hash are now ignored (#2230). + * Rapid Gossip Sync processing now fails on an unknown chain hash (#2324). + * `RouteHintHop::htlc_maximum_msat` is now enforced. Note that BOLT11 route + hints do not have such a field so this code is generally unused (#2305). + +## Security +0.0.116 fixes a denial-of-service vulnerability which is reachable from +untrusted input from channel counterparties if a 0-conf channel exists with +that counterparty. + * A premature `announcement_signatures` message from a peer prior to a 0-conf + channel's funding transaction receiving any confirmations would panic in any + version since 0-conf channels were introduced (#2439). + +In total, this release features 142 files changed, 21033 insertions, 11066 +deletions in 327 commits from 21 authors, in alphabetical order: + * Alec Chen + * Andrei + * Antoine Riard + * Arik Sosman + * Chad Upjohn + * Daniel Granhão + * Duncan Dean + * Elias Rohrer + * Fred Walker + * Gleb Naumenko + * Jeffrey Czyz + * Martin Habovstiak + * Matt Corallo + * Tony Giorgio + * Valentine Wallace + * Vladimir Fomene + * Willem Van Lint + * Wilmer Paulino + * benthecarman + * ff + * henghonglee + + +# 0.0.115 - Apr 24, 2023 - "Rebroadcast the Bugfixes" + +## API Updates + * The MSRV of the main LDK crates has been increased to 1.48 (#2107). + * Attempting to claim an un-expired payment on a channel which has closed no + longer fails. The expiry time of payments is exposed via + `PaymentClaimable::claim_deadline` (#2148). + * `payment_metadata` is now supported in `Invoice` deserialization, sending, + and receiving (via a new `RecipientOnionFields` struct) (#2139, #2127). + * `Event::PaymentFailed` now exposes a failure reason (#2142). + * BOLT12 messages now support stateless generation and validation (#1989). + * The `NetworkGraph` is now pruned of stale data after RGS processing (#2161). + * Max inbound HTLCs in-flight can be changed in the handshake config (#2138). + * `lightning-transaction-sync` feature `esplora-async-https` was added (#2085). + * A `ChannelPending` event is now emitted after the initial handshake (#2098). + * `PaymentForwarded::outbound_amount_forwarded_msat` was added (#2136). + * `ChannelManager::list_channels_by_counterparty` was added (#2079). + * `ChannelDetails::feerate_sat_per_1000_weight` was added (#2094). + * `Invoice::fallback_addresses` was added to fetch `bitcoin` types (#2023). + * The offer/refund description is now exposed in `Invoice{,Request}` (#2206). + +## Backwards Compatibility + * Payments sent with the legacy `*_with_route` methods on LDK 0.0.115+ will no + longer be retryable via the LDK 0.0.114- `retry_payment` method (#2139). + * `Event::PaymentPathFailed::retry` was removed and will always be `None` for + payments initiated on 0.0.115 which fail on an earlier version (#2063). + * `Route`s and `PaymentParameters` with blinded path information will not be + readable on prior versions of LDK. Such objects are not currently constructed + by LDK, but may be when processing BOLT12 data in a coming release (#2146). + * Providing `ChannelMonitorUpdate`s generated by LDK 0.0.115 to a + `ChannelMonitor` on 0.0.114 or before may panic (#2059). Note that this is + in general unsupported, and included here only for completeness. + +## Bug Fixes + * Fixed a case where `process_events_async` may `poll` a `Future` which has + already completed (#2081). + * Fixed deserialization of `u16` arrays. This bug may have previously corrupted + the historical buckets in a `ProbabilisticScorer`. Users relying on the + historical buckets may wish to wipe their scorer on upgrade to remove corrupt + data rather than waiting on it to decay (#2191). + * The `process_events_async` task is now `Send` and can thus be polled on a + multi-threaded runtime (#2199). + * Fixed a missing macro export causing + `impl_writeable_tlv_based_enum{,_upgradable}` calls to not compile (#2091). + * Fixed compilation of `lightning-invoice` with both `no-std` and serde (#2187) + * Fix an issue where the `background-processor` would not wake when a + `ChannelMonitorUpdate` completed asynchronously, causing delays (#2090). + * Fix an issue where `process_events_async` would exit immediately (#2145). + * `Router` calls from the `ChannelManager` now call `find_route_with_id` rather + than `find_route`, as was intended and described in the API (#2092). + * Ensure `process_events_async` always exits if any sleep future returns true, + not just if all sleep futures repeatedly return true (#2145). + * `channel_update` messages no longer set the disable bit unless the peer has + been disconnected for some time. This should resolve cases where channels are + disabled for extended periods of time (#2198). + * We no longer remove CLN nodes from the network graph for violating the BOLT + spec in some cases after failing to pay through them (#2220). + * Fixed a debug assertion which may panic under heavy load (#2172). + * `CounterpartyForceClosed::peer_msg` is now wrapped in UntrustedString (#2114) + * Fixed a potential deadlock in `funding_transaction_generated` (#2158). + +## Security + * Transaction re-broadcasting is now substantially more aggressive, including a + new regular rebroadcast feature called on a timer from the + `background-processor` or from `ChainMonitor::rebroadcast_pending_claims`. + This should substantially increase transaction confirmation reliability + without relying on downstream `TransactionBroadcaster` implementations for + rebroadcasting (#2203, #2205, #2208). + * Implemented the changes from BOLT PRs #1031, #1032, and #1040 which resolve a + privacy vulnerability which allows an intermediate node on the path to + discover the final destination for a payment (#2062). + +In total, this release features 110 files changed, 11928 insertions, 6368 +deletions in 215 commits from 21 authors, in alphabetical order: + * Advait + * Alan Cohen + * Alec Chen + * Allan Douglas R. de Oliveira + * Arik Sosman + * Elias Rohrer + * Evan Feenstra + * Jeffrey Czyz + * John Cantrell + * Lucas Soriano del Pino + * Marc Tyndel + * Matt Corallo + * Paul Miller + * Steven + * Steven Williamson + * Steven Zhao + * Tony Giorgio + * Valentine Wallace + * Wilmer Paulino + * benthecarman + * munjesi + + # 0.0.114 - Mar 3, 2023 - "Faster Async BOLT12 Retries" ## API Updates @@ -22,7 +277,7 @@ missing support for blinded path payments (#1927, #1908, #1926). * A `lightning-custom-message` crate has been added to make combining multiple custom messages into one enum/handler easier (#1832). - * `Event::PaymentPathFailure` is now generated for failure to send an HTLC + * `Event::PaymentPathFailed` is now generated for failure to send an HTLC over the first hop on our local channel (#2014, #2043). * `lightning-net-tokio` no longer requires an `Arc` on `PeerManager` (#1968). * `ChannelManager::list_recent_payments` was added (#1873). @@ -40,7 +295,7 @@ if you downgrade prior to receipt (#1878). * `Event::PaymentPathFailed::network_update` will always be `None` if an 0.0.114-generated event is read by a prior version of LDK (#2043). - * `Event::PaymentPathFailed::all_paths_removed` will always be false if an + * `Event::PaymentPathFailed::all_paths_failed` will always be false if an 0.0.114-generated event is read by a prior version of LDK. Users who rely on it to determine payment retries should migrate to `Event::PaymentFailed`, in a separate release prior to upgrading to LDK 0.0.114 if downgrading is