Skip to content

Commit

Permalink
Merge pull request #1217 from TheBlueMatt/2021-12-0.0.104
Browse files Browse the repository at this point in the history
Cut 0.0.104
  • Loading branch information
TheBlueMatt authored Dec 17, 2021
2 parents 1c157a2 + 27d5c7a commit 2a8a396
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 22 deletions.
104 changes: 104 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions lightning-background-processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightning-background-processor"
version = "0.0.103"
version = "0.0.104"
authors = ["Valentine Wallace <[email protected]>"]
license = "MIT OR Apache-2.0"
repository = "http://github.com/rust-bitcoin/rust-lightning"
Expand All @@ -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" }
4 changes: 2 additions & 2 deletions lightning-block-sync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 }
Expand Down
6 changes: 3 additions & 3 deletions lightning-invoice/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
documentation = "https://docs.rs/lightning-invoice/"
license = "MIT OR Apache-2.0"
Expand All @@ -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"] }
8 changes: 4 additions & 4 deletions lightning-invoice/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lightning-net-tokio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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/"
Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions lightning-persister/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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/"
Expand All @@ -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"] }
2 changes: 1 addition & 1 deletion lightning/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
4 changes: 2 additions & 2 deletions lightning/src/chain/chaininterface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a8a396

Please sign in to comment.