Merge pull request #1217 from TheBlueMatt/2021-12-0.0.104 v0.0.104
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Fri, 17 Dec 2021 23:30:54 +0000 (23:30 +0000)
committerGitHub <noreply@github.com>
Fri, 17 Dec 2021 23:30:54 +0000 (23:30 +0000)
Cut 0.0.104

CHANGELOG.md
lightning-background-processor/Cargo.toml
lightning-block-sync/Cargo.toml
lightning-invoice/Cargo.toml
lightning-invoice/src/utils.rs
lightning-net-tokio/Cargo.toml
lightning-persister/Cargo.toml
lightning/Cargo.toml
lightning/src/chain/chaininterface.rs

index 80745291a0e6722a01b77a8e67dede699a79bc76..df1204e9bc727305d1527822adb16f5a66bdb843 100644 (file)
@@ -1,3 +1,107 @@
+# 0.0.104 - 2021-12-17
+
+## API Updates
+ * A `PaymentFailed` event is now provided to indicate a payment has failed
+   fully. This event is generated either after
+   `ChannelManager::abandon_payment` is called for a given payment, or the
+   payment times out, and there are no further pending HTLCs for the payment.
+   This event should be used to detect payment failure instead of
+   `PaymentPathFailed::all_paths_failed`, unless no payment retries occur via
+   `ChannelManager::retry_payment` (#1202).
+ * Payment secrets are now generated deterministically using material from
+   the new `KeysInterface::get_inbound_payment_key_material` (#1177).
+ * A `PaymentPathSuccessful` event has been added to ease passing success info
+   to a scorer, along with a `Score::payment_path_successful` method to accept
+   such info (#1178, #1197).
+ * `Score::channel_penalty_msat` has additional arguments describing the
+   channel's capacity and the HTLC amount being sent over the channel (#1166).
+ * A new log level `Gossip` has been added, which is used for verbose
+   information generated during network graph sync. Enabling the
+   `max_level_trace` feature or ignoring `Gossip` log entries reduces log
+   growth during initial start up from many GiB to several MiB (#1145).
+ * The `allow_wallclock_use` feature has been removed in favor of only using
+   the `std` and `no-std` features (#1212).
+ * `NetworkGraph` can now remove channels that we haven't heard updates for in
+   two weeks with `NetworkGraph::remove_stale_channels{,with_time}`. The first
+   is called automatically if a `NetGraphMsgHandler` is passed to
+   `BackgroundProcessor::start` (#1212).
+ * `InvoicePayer::pay_pubkey` was added to enable sending "keysend" payments to
+   supported recipients, using the `InvoicePayer` to handle retires (#1160).
+ * `user_payment_id` has been removed from `PaymentPurpose`, and
+   `ChannelManager::create_inbound_payment{,_for_hash}` (#1180).
+ * Updated documentation for several `ChannelManager` functions to remove stale
+   references to panics which no longer occur (#1201).
+ * The `Score` and `LockableScore` objects have moved into the
+   `routing::scoring` module instead of being in the `routing` module (#1166).
+ * The `Time` parameter to `ScorerWithTime` is no longer longer exposed,
+   instead being fixed based on the `std`/`no-std` feature (#1184).
+ * `ChannelDetails::balance_msat` was added to fetch a channel's balance
+   without subtracting the reserve values, lining up with on-chain claim amounts
+   less on-chain fees (#1203).
+ * An explicit `UserConfig::accept_inbound_channels` flag is now provided,
+   removing the need to set `min_funding_satoshis` to > 21 million BTC (#1173).
+ * Inbound channels that fail to see the funding transaction confirm within
+   2016 blocks are automatically force-closed with
+   `ClosureReason::FundingTimedOut` (#1083).
+ * We now accept a channel_reserve value of 0 from counterparties, as it is
+   insecure for our counterparty but not us (#1163).
+ * `NetAddress::OnionV2` parsing was removed as version 2 onion services are no
+   longer supported in modern Tor (#1204).
+ * Generation and signing of anchor outputs is now supported in the
+   `KeysInterface`, though no support for them exists in the channel itself (#1176)
+
+## Bug Fixes
+ * Fixed a race condition in `InvoicePayer` where paths may be retried after
+   the retry count has been exceeded. In this case the
+   `Event::PaymentPathFailed::all_paths_failed` field is not a reliable payment
+   failure indicator. There was no acceptable alternative indicator,
+   `Event::PaymentFailed` as been added to provide one (#1202).
+ * Reduced the blocks-before-timeout we expect of outgoing HTLCs before
+   refusing to forward. This check was overly strict and resulted in refusing
+   to forward som HTLCs to a next hop that had a lower security threshold than
+   us (#1119).
+ * LDK no longer attempt to update the channel fee for outbound channels when
+   we cannot afford the new fee. This could have caused force-closure by our
+   channel counterparty (#1054).
+ * Fixed several bugs which may have prevented the reliable broadcast of our
+   own channel announcements and updates (#1169).
+ * Fixed a rare bug which may have resulted in spurious route finding failures
+   when using last-hop hints and MPP with large value payments (#1168).
+ * `KeysManager::spend_spendable_outputs` no longer adds a change output that
+   is below the dust threshold for non-standard change scripts (#1131).
+ * Fixed a minor memory leak when attempting to send a payment that fails due
+   to an error when updating the `ChannelMonitor` (#1143).
+ * Fixed a bug where a `FeeEstimator` that returns values rounded to the next
+   sat/vbyte may result in force-closures (#1208).
+ * Handle MPP timeout HTLC error codes, instead of considering the recipient to
+   have sent an invalid error, removing them from the network graph (#1148)
+
+## Serialization Compatibility
+ * All above new events/fields are ignored by prior clients. All above new
+   events/fields are not present when reading objects serialized by prior
+   versions of the library.
+ * Payment secrets are now generated deterministically. This reduces the memory
+   footprint for inbound payments, however, newly-generated inbound payments
+   using `ChannelManager::create_inbound_payment{,_for_hash}` will not be
+   receivable using versions prior to 0.0.104.
+   `ChannelManager::create_inbound_payment{,_for_hash}_legacy` are provided for
+   backwards compatibility (#1177).
+ * `PaymentPurpose::InvoicePayment::user_payment_id` will be 0 when reading
+   objects written with 0.0.104 when read by 0.0.103 and previous (#1180).
+
+In total, this release features 51 files changed, 5356 insertions, 2238
+deletions in 107 commits from 9 authors, in alphabetical order:
+ * Antoine Riard
+ * Conor Okus
+ * Devrandom
+ * Duncan Dean
+ * Elias Rohrer
+ * Jeffrey Czyz
+ * Ken Sedgwick
+ * Matt Corallo
+ * Valentine Wallace
+
+
 # 0.0.103 - 2021-11-02
 
 ## API Updates
index 531678325eb1643da225bf1272dc61568885b4cf..0056393dd2557111a31482bb7b49d1473794eac2 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "lightning-background-processor"
-version = "0.0.103"
+version = "0.0.104"
 authors = ["Valentine Wallace <vwallace@protonmail.com>"]
 license = "MIT OR Apache-2.0"
 repository = "http://github.com/rust-bitcoin/rust-lightning"
@@ -11,9 +11,9 @@ edition = "2018"
 
 [dependencies]
 bitcoin = "0.27"
-lightning = { version = "0.0.103", path = "../lightning", features = ["std"] }
-lightning-persister = { version = "0.0.103", path = "../lightning-persister" }
+lightning = { version = "0.0.104", path = "../lightning", features = ["std"] }
+lightning-persister = { version = "0.0.104", path = "../lightning-persister" }
 
 [dev-dependencies]
-lightning = { version = "0.0.103", path = "../lightning", features = ["_test_utils"] }
-lightning-invoice = { version = "0.11.0", path = "../lightning-invoice" }
+lightning = { version = "0.0.104", path = "../lightning", features = ["_test_utils"] }
+lightning-invoice = { version = "0.12.0", path = "../lightning-invoice" }
index e9d5f52816e4e56cb7a0bc4142ca82d4964b5647..ae6eb58258d4e2f49433b6988dbf9c391fdd962c 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "lightning-block-sync"
-version = "0.0.103"
+version = "0.0.104"
 authors = ["Jeffrey Czyz", "Matt Corallo"]
 license = "MIT OR Apache-2.0"
 repository = "http://github.com/rust-bitcoin/rust-lightning"
@@ -15,7 +15,7 @@ rpc-client = [ "serde", "serde_json", "chunked_transfer" ]
 
 [dependencies]
 bitcoin = "0.27"
-lightning = { version = "0.0.103", path = "../lightning" }
+lightning = { version = "0.0.104", path = "../lightning" }
 tokio = { version = "1.0", features = [ "io-util", "net", "time" ], optional = true }
 serde = { version = "1.0", features = ["derive"], optional = true }
 serde_json = { version = "1.0", optional = true }
index 010becc27198333100fb740664f92cc258f64279..71648b3c84d40ef70c7857ffa9918ccb51824dd7 100644 (file)
@@ -1,7 +1,7 @@
 [package]
 name = "lightning-invoice"
 description = "Data structures to parse and serialize BOLT11 lightning invoices"
-version = "0.11.0"
+version = "0.12.0"
 authors = ["Sebastian Geisler <sgeisler@wh2.tu-dresden.de>"]
 documentation = "https://docs.rs/lightning-invoice/"
 license = "MIT OR Apache-2.0"
@@ -10,11 +10,11 @@ readme = "README.md"
 
 [dependencies]
 bech32 = "0.8"
-lightning = { version = "0.0.103", path = "../lightning" }
+lightning = { version = "0.0.104", path = "../lightning" }
 secp256k1 = { version = "0.20", features = ["recovery"] }
 num-traits = "0.2.8"
 bitcoin_hashes = "0.10"
 
 [dev-dependencies]
 hex = "0.3"
-lightning = { version = "0.0.103", path = "../lightning", features = ["_test_utils"] }
+lightning = { version = "0.0.104", path = "../lightning", features = ["_test_utils"] }
index 5918753ae1c1f196ffa03002646a5bd2a97374c3..53fdc13f2fc2255f7102a3225252f4139e887efc 100644 (file)
@@ -97,20 +97,20 @@ where
 }
 
 /// A [`Router`] implemented using [`find_route`].
-pub struct DefaultRouter<G, L: Deref> where G: Deref<Target = NetworkGraph>, L::Target: Logger {
+pub struct DefaultRouter<G: Deref<Target = NetworkGraph>, L: Deref> where L::Target: Logger {
        network_graph: G,
        logger: L,
 }
 
-impl<G, L: Deref> DefaultRouter<G, L> where G: Deref<Target = NetworkGraph>, L::Target: Logger {
+impl<G: Deref<Target = NetworkGraph>, L: Deref> DefaultRouter<G, L> where L::Target: Logger {
        /// Creates a new router using the given [`NetworkGraph`] and  [`Logger`].
        pub fn new(network_graph: G, logger: L) -> Self {
                Self { network_graph, logger }
        }
 }
 
-impl<G, L: Deref, S: Score> Router<S> for DefaultRouter<G, L>
-where G: Deref<Target = NetworkGraph>, L::Target: Logger {
+impl<G: Deref<Target = NetworkGraph>, L: Deref, S: Score> Router<S> for DefaultRouter<G, L>
+where L::Target: Logger {
        fn find_route(
                &self, payer: &PublicKey, params: &RouteParameters, _payment_hash: &PaymentHash,
                first_hops: Option<&[&ChannelDetails]>, scorer: &S
index ad3dc008e6a69c1874e532a6b311ca202dbb8a1c..0a763f09fefcdc964242f3195632f9e765fae861 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "lightning-net-tokio"
-version = "0.0.103"
+version = "0.0.104"
 authors = ["Matt Corallo"]
 license = "MIT OR Apache-2.0"
 repository = "https://github.com/rust-bitcoin/rust-lightning/"
@@ -12,7 +12,7 @@ edition = "2018"
 
 [dependencies]
 bitcoin = "0.27"
-lightning = { version = "0.0.103", path = "../lightning" }
+lightning = { version = "0.0.104", path = "../lightning" }
 tokio = { version = "1.0", features = [ "io-util", "macros", "rt", "sync", "net", "time" ] }
 
 [dev-dependencies]
index ef8631059c986fb3d11468e0098391318492a964..7c32b6cf4a1aa4cca19dba38295f3185342a025c 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "lightning-persister"
-version = "0.0.103"
+version = "0.0.104"
 authors = ["Valentine Wallace", "Matt Corallo"]
 license = "MIT OR Apache-2.0"
 repository = "https://github.com/rust-bitcoin/rust-lightning/"
@@ -13,11 +13,11 @@ unstable = ["lightning/unstable"]
 
 [dependencies]
 bitcoin = "0.27"
-lightning = { version = "0.0.103", path = "../lightning" }
+lightning = { version = "0.0.104", path = "../lightning" }
 libc = "0.2"
 
 [target.'cfg(windows)'.dependencies]
 winapi = { version = "0.3", features = ["winbase"] }
 
 [dev-dependencies]
-lightning = { version = "0.0.103", path = "../lightning", features = ["_test_utils"] }
+lightning = { version = "0.0.104", path = "../lightning", features = ["_test_utils"] }
index b80e0a5b1b727e87470fc50c2bda21a5a79124b4..1234cd5c05c0fd34668be44e6bdef43823f11a5a 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "lightning"
-version = "0.0.103"
+version = "0.0.104"
 authors = ["Matt Corallo"]
 license = "MIT OR Apache-2.0"
 repository = "https://github.com/rust-bitcoin/rust-lightning/"
index cca51e3185130c4c99f76d4517805fd5129fb029..9a45a88ffe407898e1b38ee42f3356856b7f9cd4 100644 (file)
@@ -41,10 +41,10 @@ pub enum ConfirmationTarget {
 pub trait FeeEstimator {
        /// Gets estimated satoshis of fee required per 1000 Weight-Units.
        ///
-       /// Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later  
+       /// Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
        /// round-downs don't put us below 1 satoshi-per-byte).
        ///
-       /// This method can be implemented with the following unit conversions: 
+       /// This method can be implemented with the following unit conversions:
        ///  * max(satoshis-per-byte * 250, 253)
        ///  * max(satoshis-per-kbyte / 4, 253)
        fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32;