Skip to content

Commit

Permalink
Merge pull request lightningdevkit#3362 from TheBlueMatt/2024-10-0.0.125
Browse files Browse the repository at this point in the history
Cut 0.0.125 with a few bugfixes
  • Loading branch information
TheBlueMatt authored Oct 14, 2024
2 parents b023eed + 2028c78 commit e80d632
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 30 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 0.0.125 - Oct 14, 2024 - "Delayed Beta Testing"

## Bug Fixes
* On upgrade to 0.0.124, channels which were at a steady-state (i.e. for which
the counterparty has received our latest `revoke_and_ack` message) will
force-close upon receiving the next channel state update from our
counterparty. When built with debug assertions a debug assertion failure will
occur instead (#3362).
* Listeners in a `ChainListenerSet` will now have their `block_connected`
method called, when appropriate, rather than always having their
`filtered_block_connected` method called with full block data (#3354).
* Routefinding historical liquidity channel scores were made more consistent
for channels which have very little data which has been decayed (#3362).
* A debug assertion failure when adding nodes to the network graph after
removal of nodes from the network graph was fixed (#3362).

In total, this release features 6 files changed, 32 insertions, 7
deletions in 5 commits since 0.0.124 from 2 authors, in alphabetical order:

* Elias Rohrer
* Matt Corallo


# 0.0.124 - Sep 3, 2024 - "Papercutting Feature Requests"

## API Updates
Expand Down
11 changes: 6 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.124"
version = "0.0.125"
authors = ["Valentine Wallace <[email protected]>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
Expand All @@ -11,6 +11,7 @@ edition = "2021"

[package.metadata.docs.rs]
all-features = true
features = ["lightning/std"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
Expand All @@ -21,14 +22,14 @@ default = ["std"]

[dependencies]
bitcoin = { version = "0.32.2", default-features = false }
lightning = { version = "0.0.124", path = "../lightning", default-features = false }
lightning-rapid-gossip-sync = { version = "0.0.124", path = "../lightning-rapid-gossip-sync", default-features = false }
lightning = { version = "0.0.125", path = "../lightning", default-features = false }
lightning-rapid-gossip-sync = { version = "0.0.125", path = "../lightning-rapid-gossip-sync", default-features = false }

[dev-dependencies]
tokio = { version = "1.35", features = [ "macros", "rt", "rt-multi-thread", "sync", "time" ] }
lightning = { version = "0.0.124", path = "../lightning", features = ["_test_utils"] }
lightning = { version = "0.0.125", path = "../lightning", features = ["_test_utils"] }
lightning-invoice = { version = "0.32.0", path = "../lightning-invoice" }
lightning-persister = { version = "0.0.124", path = "../lightning-persister" }
lightning-persister = { version = "0.0.125", path = "../lightning-persister" }

[lints]
workspace = true
6 changes: 3 additions & 3 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.124"
version = "0.0.125"
authors = ["Jeffrey Czyz", "Matt Corallo"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
Expand All @@ -19,13 +19,13 @@ rpc-client = [ "serde_json", "chunked_transfer" ]

[dependencies]
bitcoin = "0.32.2"
lightning = { version = "0.0.124", path = "../lightning" }
lightning = { version = "0.0.125", path = "../lightning" }
tokio = { version = "1.35", features = [ "io-util", "net", "time", "rt" ], optional = true }
serde_json = { version = "1.0", optional = true }
chunked_transfer = { version = "1.4", optional = true }

[dev-dependencies]
lightning = { version = "0.0.124", path = "../lightning", features = ["_test_utils"] }
lightning = { version = "0.0.125", path = "../lightning", features = ["_test_utils"] }
tokio = { version = "1.35", features = [ "macros", "rt" ] }

[lints]
Expand Down
2 changes: 0 additions & 2 deletions lightning-block-sync/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ impl<'a, L: chain::Listen + ?Sized> chain::Listen for DynamicChainListener<'a, L
struct ChainListenerSet<'a, L: chain::Listen + ?Sized>(Vec<(u32, &'a L)>);

impl<'a, L: chain::Listen + ?Sized> chain::Listen for ChainListenerSet<'a, L> {
// Needed to differentiate test expectations.
#[cfg(test)]
fn block_connected(&self, block: &bitcoin::Block, height: u32) {
for (starting_height, chain_listener) in self.0.iter() {
if height > *starting_height {
Expand Down
4 changes: 2 additions & 2 deletions lightning-custom-message/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightning-custom-message"
version = "0.0.124"
version = "0.0.125"
authors = ["Jeffrey Czyz"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
Expand All @@ -15,7 +15,7 @@ rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
bitcoin = "0.32.2"
lightning = { version = "0.0.124", path = "../lightning" }
lightning = { version = "0.0.125", path = "../lightning" }

[lints]
workspace = true
6 changes: 3 additions & 3 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.124"
version = "0.0.125"
authors = ["Matt Corallo"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
Expand All @@ -16,12 +16,12 @@ rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
bitcoin = "0.32.2"
lightning = { version = "0.0.124", path = "../lightning" }
lightning = { version = "0.0.125", path = "../lightning" }
tokio = { version = "1.35", features = [ "rt", "sync", "net", "time" ] }

[dev-dependencies]
tokio = { version = "1.35", features = [ "macros", "rt", "rt-multi-thread", "sync", "net", "time" ] }
lightning = { version = "0.0.124", path = "../lightning", features = ["_test_utils"] }
lightning = { version = "0.0.125", path = "../lightning", features = ["_test_utils"] }

[lints]
workspace = true
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.124"
version = "0.0.125"
authors = ["Valentine Wallace", "Matt Corallo"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
Expand All @@ -15,7 +15,7 @@ rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
bitcoin = "0.32.2"
lightning = { version = "0.0.124", path = "../lightning" }
lightning = { version = "0.0.125", path = "../lightning" }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.48.0", default-features = false, features = ["Win32_Storage_FileSystem", "Win32_Foundation"] }
Expand All @@ -24,7 +24,7 @@ windows-sys = { version = "0.48.0", default-features = false, features = ["Win32
criterion = { version = "0.4", optional = true, default-features = false }

[dev-dependencies]
lightning = { version = "0.0.124", path = "../lightning", features = ["_test_utils"] }
lightning = { version = "0.0.125", path = "../lightning", features = ["_test_utils"] }
bitcoin = { version = "0.32.2", default-features = false }

[lints]
Expand Down
10 changes: 7 additions & 3 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightning-rapid-gossip-sync"
version = "0.0.124"
version = "0.0.125"
authors = ["Arik Sosman <[email protected]>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
Expand All @@ -9,19 +9,23 @@ description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""

[package.metadata.docs.rs]
all-features = true
features = ["lightning/std"]

[features]
default = ["std"]
std = []

[dependencies]
lightning = { version = "0.0.124", path = "../lightning", default-features = false }
lightning = { version = "0.0.125", path = "../lightning", default-features = false }
bitcoin = { version = "0.32.2", default-features = false }

[target.'cfg(ldk_bench)'.dependencies]
criterion = { version = "0.4", optional = true, default-features = false }

[dev-dependencies]
lightning = { version = "0.0.124", path = "../lightning", features = ["_test_utils"] }
lightning = { version = "0.0.125", path = "../lightning", features = ["_test_utils"] }

[lints]
workspace = true
6 changes: 3 additions & 3 deletions lightning-transaction-sync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightning-transaction-sync"
version = "0.0.124"
version = "0.0.125"
authors = ["Elias Rohrer"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
Expand All @@ -23,15 +23,15 @@ electrum = ["electrum-client"]
async-interface = []

[dependencies]
lightning = { version = "0.0.124", path = "../lightning", default-features = false, features = ["std"] }
lightning = { version = "0.0.125", path = "../lightning", default-features = false, features = ["std"] }
bitcoin = { version = "0.32.2", default-features = false }
bdk-macros = "0.6"
futures = { version = "0.3", optional = true }
esplora-client = { version = "0.9", default-features = false, optional = true }
electrum-client = { version = "0.21.0", optional = true }

[dev-dependencies]
lightning = { version = "0.0.124", path = "../lightning", default-features = false, features = ["std", "_test_utils"] }
lightning = { version = "0.0.125", path = "../lightning", default-features = false, features = ["std", "_test_utils"] }
tokio = { version = "1.35.0", features = ["full"] }

[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
Expand Down
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.124"
version = "0.0.125"
authors = ["Matt Corallo"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
Expand Down
12 changes: 10 additions & 2 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7153,6 +7153,12 @@ impl<SP: Deref> Channel<SP> where
pub fn get_channel_reestablish<L: Deref>(&mut self, logger: &L) -> msgs::ChannelReestablish where L::Target: Logger {
assert!(self.context.channel_state.is_peer_disconnected());
assert_ne!(self.context.cur_counterparty_commitment_transaction_number, INITIAL_COMMITMENT_NUMBER);
// This is generally the first function which gets called on any given channel once we're
// up and running normally. Thus, we take this opportunity to attempt to resolve the
// `holder_commitment_point` to get any keys which we are currently missing.
self.context.holder_commitment_point.try_resolve_pending(
&self.context.holder_signer, &self.context.secp_ctx, logger,
);
// Prior to static_remotekey, my_current_per_commitment_point was critical to claiming
// current to_remote balances. However, it no longer has any use, and thus is now simply
// set to a dummy (but valid, as required by the spec) public key.
Expand Down Expand Up @@ -9464,8 +9470,10 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
// TODO(async_signing): remove this expect with the Uninitialized variant
let current = holder_signer.get_per_commitment_point(cur_holder_commitment_transaction_number, &secp_ctx)
.expect("Must be able to derive the current commitment point upon channel restoration");
HolderCommitmentPoint::PendingNext {
transaction_number: cur_holder_commitment_transaction_number, current,
let next = holder_signer.get_per_commitment_point(cur_holder_commitment_transaction_number - 1, &secp_ctx)
.expect("Must be able to derive the next commitment point upon channel restoration");
HolderCommitmentPoint::Available {
transaction_number: cur_holder_commitment_transaction_number, current, next,
}
},
};
Expand Down
4 changes: 3 additions & 1 deletion lightning/src/routing/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,9 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
IndexedMapEntry::Vacant(node_entry) => {
let mut removed_node_counters = self.removed_node_counters.lock().unwrap();
**chan_info_node_counter = removed_node_counters.pop()
.unwrap_or(self.next_node_counter.fetch_add(1, Ordering::Relaxed) as u32);
.unwrap_or_else(|| {
self.next_node_counter.fetch_add(1, Ordering::Relaxed) as u32
});
node_entry.insert(NodeInfo {
channels: vec!(short_channel_id),
announcement_info: None,
Expand Down
16 changes: 14 additions & 2 deletions lightning/src/routing/scoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1818,15 +1818,27 @@ mod bucketed_history {
// values, which will result in us thinking we have some nontrivial probability of
// routing up to that amount.
if min_liquidity_offset_history_buckets[0] != 0 {
let mut highest_max_bucket_with_points = 0; // The highest max-bucket with any data
// Track the highest max-buckets with any data at all, as well as the highest
// max-bucket with at least BUCKET_FIXED_POINT_ONE.
let mut highest_max_bucket_with_points = 0;
let mut highest_max_bucket_with_full_points = None;
let mut total_max_points = 0; // Total points in max-buckets to consider
for (max_idx, max_bucket) in max_liquidity_offset_history_buckets.iter().enumerate() {
if *max_bucket >= BUCKET_FIXED_POINT_ONE {
highest_max_bucket_with_full_points = Some(cmp::max(highest_max_bucket_with_full_points.unwrap_or(0), max_idx));
}
if *max_bucket != 0 {
highest_max_bucket_with_points = cmp::max(highest_max_bucket_with_points, max_idx);
}
total_max_points += *max_bucket as u64;
}
let max_bucket_end_pos = BUCKET_START_POS[32 - highest_max_bucket_with_points] - 1;
// Use the highest max-bucket with at least BUCKET_FIXED_POINT_ONE, but if none is
// available use the highest max-bucket with any non-zero value. This ensures that
// if we have substantially decayed data we don't end up thinking the highest
// max-bucket is zero even though we have no points in the 0th max-bucket and do
// have points elsewhere.
let selected_max = highest_max_bucket_with_full_points.unwrap_or(highest_max_bucket_with_points);
let max_bucket_end_pos = BUCKET_START_POS[32 - selected_max] - 1;
if payment_pos < max_bucket_end_pos {
let (numerator, denominator) = success_probability(payment_pos as u64, 0,
max_bucket_end_pos as u64, POSITION_TICKS as u64 - 1, params, true);
Expand Down

0 comments on commit e80d632

Please sign in to comment.