Skip to content

Commit b18924c

Browse files
authored
Merge pull request #4344 from TheBlueMatt/2026-0.2-0.2.1
[0.2] Backports and cut 0.2.1
2 parents 0c8269b + 45a9d2b commit b18924c

File tree

21 files changed

+638
-322
lines changed

21 files changed

+638
-322
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,11 @@ jobs:
264264
- name: Pin the syn and regex dependencies
265265
run: |
266266
cd fuzz && cargo update -p regex --precise "1.9.6" && cargo update -p syn --precise "2.0.106" && cargo update -p quote --precise "1.0.41"
267+
cargo update -p proc-macro2 --precise "1.0.103" --verbose && cargo update -p serde_json --precise "1.0.145" --verbose
268+
cargo update -p itoa --precise "1.0.15" --verbose && cargo update -p ryu --precise "1.0.20" --verbose
267269
cd write-seeds && cargo update -p regex --precise "1.9.6" && cargo update -p syn --precise "2.0.106" && cargo update -p quote --precise "1.0.41"
270+
cargo update -p proc-macro2 --precise "1.0.103" --verbose && cargo update -p serde_json --precise "1.0.145" --verbose
271+
cargo update -p itoa --precise "1.0.15" --verbose && cargo update -p ryu --precise "1.0.20" --verbose
268272
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
269273
run: |
270274
cd fuzz

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# 0.2.1 - Jan 26, 2025 - "Electrum Confirmations Logged"
2+
3+
## API Updates
4+
* The `AttributionData` struct is now public, correcting an issue where it was
5+
accidentally sealed preventing construction of some messages (#4268).
6+
* The async background processor now exits even if work remains to be done as
7+
soon as the sleeper returns the exit flag (#4259).
8+
9+
## Bug Fixes
10+
* The presence of unconfirmed transactions no longer causes
11+
`ElectrumSyncClient` to spuriously fail to sync (#4341).
12+
* `ChannelManager::splice_channel` now properly fails immediately if the
13+
peer does not support splicing (#4262, #4274).
14+
* A spurious debug assertion was removed which could fail in cases where an
15+
HTLC fails to be forwarded after being accepted (#4312).
16+
* Many log calls related to outbound payments were corrected to include a
17+
`payment_hash` field (#4342).
18+
19+
120
# 0.2 - Dec 2, 2025 - "Natively Asynchronous Splicing"
221

322
## API Updates

ci/check-lint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CLIPPY() {
1313
-A clippy::unwrap-or-default \
1414
-A clippy::upper_case_acronyms \
1515
-A clippy::swap-with-temporary \
16+
-A clippy::assertions-on-constants \
1617
`# Things where we do odd stuff on purpose ` \
1718
-A clippy::unusual_byte_groupings \
1819
-A clippy::unit_arg \

ci/ci-tests.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ function PIN_RELEASE_DEPS {
1717
# quote 1.0.42 requires rustc 1.68.0
1818
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose
1919

20+
# Starting with version 1.0.104, the `proc-macro2` crate has an MSRV of rustc 1.68
21+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p proc-macro2 --precise "1.0.103" --verbose
22+
23+
# Starting with version 1.0.146, the `serde_json` crate has an MSRV of rustc 1.68
24+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p serde_json --precise "1.0.145" --verbose
25+
26+
# Starting with version 1.0.16, the `itoa` crate has an MSRV of rustc 1.68
27+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p itoa --precise "1.0.15" --verbose
28+
29+
# Starting with version 1.0.21, the `ryu` crate has an MSRV of rustc 1.68
30+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p ryu --precise "1.0.20" --verbose
31+
2032
return 0 # Don't fail the script if our rustc is higher than the last check
2133
}
2234

@@ -58,6 +70,7 @@ pushd lightning-tests
5870
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
5971
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p syn --precise "2.0.106" --verbose
6072
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose
73+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p proc-macro2 --precise "1.0.103" --verbose
6174
cargo test
6275
popd
6376

@@ -130,6 +143,10 @@ echo -e "\n\nTesting no_std build on a downstream no-std crate"
130143
pushd no-std-check
131144
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p syn --precise "2.0.106" --verbose
132145
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose
146+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p proc-macro2 --precise "1.0.103" --verbose
147+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p serde_json --precise "1.0.145" --verbose
148+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p itoa --precise "1.0.15" --verbose
149+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p ryu --precise "1.0.20" --verbose
133150
cargo check --verbose --color always
134151
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
135152
popd

fuzz/src/process_onion_failure.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ use lightning::{
99
ln::{
1010
channelmanager::{HTLCSource, PaymentId},
1111
msgs::OnionErrorPacket,
12+
onion_utils,
1213
},
1314
routing::router::{BlindedTail, Path, RouteHop, TrampolineHop},
1415
types::features::{ChannelFeatures, NodeFeatures},
1516
util::logger::Logger,
17+
util::ser::Readable,
1618
};
1719

1820
// Imports that need to be added manually
@@ -126,19 +128,18 @@ fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
126128
let failure_data = get_slice!(failure_len);
127129

128130
let attribution_data = if get_bool!() {
129-
Some(lightning::ln::AttributionData {
130-
hold_times: get_slice!(80).try_into().unwrap(),
131-
hmacs: get_slice!(840).try_into().unwrap(),
132-
})
131+
let mut bytes = get_slice!(80 + 840);
132+
let data: onion_utils::AttributionData = Readable::read(&mut bytes).unwrap();
133+
Some(data)
133134
} else {
134135
None
135136
};
136137
let encrypted_packet =
137138
OnionErrorPacket { data: failure_data.into(), attribution_data: attribution_data.clone() };
138-
lightning::ln::process_onion_failure(&secp_ctx, &logger, &htlc_source, encrypted_packet);
139+
onion_utils::process_onion_failure(&secp_ctx, &logger, &htlc_source, encrypted_packet);
139140

140141
if let Some(attribution_data) = attribution_data {
141-
lightning::ln::decode_fulfill_attribution_data(
142+
onion_utils::decode_fulfill_attribution_data(
142143
&secp_ctx,
143144
&logger,
144145
&path,

lightning-background-processor/src/lib.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,11 @@ pub(crate) mod futures_util {
476476
use core::pin::Pin;
477477
use core::task::{Poll, RawWaker, RawWakerVTable, Waker};
478478
pub(crate) struct Selector<
479-
A: Future<Output = ()> + Unpin,
479+
A: Future<Output = bool> + Unpin,
480480
B: Future<Output = ()> + Unpin,
481481
C: Future<Output = ()> + Unpin,
482482
D: Future<Output = ()> + Unpin,
483-
E: Future<Output = bool> + Unpin,
483+
E: Future<Output = ()> + Unpin,
484484
> {
485485
pub a: A,
486486
pub b: B,
@@ -490,28 +490,30 @@ pub(crate) mod futures_util {
490490
}
491491

492492
pub(crate) enum SelectorOutput {
493-
A,
493+
A(bool),
494494
B,
495495
C,
496496
D,
497-
E(bool),
497+
E,
498498
}
499499

500500
impl<
501-
A: Future<Output = ()> + Unpin,
501+
A: Future<Output = bool> + Unpin,
502502
B: Future<Output = ()> + Unpin,
503503
C: Future<Output = ()> + Unpin,
504504
D: Future<Output = ()> + Unpin,
505-
E: Future<Output = bool> + Unpin,
505+
E: Future<Output = ()> + Unpin,
506506
> Future for Selector<A, B, C, D, E>
507507
{
508508
type Output = SelectorOutput;
509509
fn poll(
510510
mut self: Pin<&mut Self>, ctx: &mut core::task::Context<'_>,
511511
) -> Poll<SelectorOutput> {
512+
// Bias the selector so it first polls the sleeper future, allowing to exit immediately
513+
// if the flag is set.
512514
match Pin::new(&mut self.a).poll(ctx) {
513-
Poll::Ready(()) => {
514-
return Poll::Ready(SelectorOutput::A);
515+
Poll::Ready(res) => {
516+
return Poll::Ready(SelectorOutput::A(res));
515517
},
516518
Poll::Pending => {},
517519
}
@@ -534,8 +536,8 @@ pub(crate) mod futures_util {
534536
Poll::Pending => {},
535537
}
536538
match Pin::new(&mut self.e).poll(ctx) {
537-
Poll::Ready(res) => {
538-
return Poll::Ready(SelectorOutput::E(res));
539+
Poll::Ready(()) => {
540+
return Poll::Ready(SelectorOutput::E);
539541
},
540542
Poll::Pending => {},
541543
}
@@ -1037,15 +1039,15 @@ where
10371039
(false, false) => FASTEST_TIMER,
10381040
};
10391041
let fut = Selector {
1040-
a: channel_manager.get_cm().get_event_or_persistence_needed_future(),
1041-
b: chain_monitor.get_update_future(),
1042-
c: om_fut,
1043-
d: lm_fut,
1044-
e: sleeper(sleep_delay),
1042+
a: sleeper(sleep_delay),
1043+
b: channel_manager.get_cm().get_event_or_persistence_needed_future(),
1044+
c: chain_monitor.get_update_future(),
1045+
d: om_fut,
1046+
e: lm_fut,
10451047
};
10461048
match fut.await {
1047-
SelectorOutput::A | SelectorOutput::B | SelectorOutput::C | SelectorOutput::D => {},
1048-
SelectorOutput::E(exit) => {
1049+
SelectorOutput::B | SelectorOutput::C | SelectorOutput::D | SelectorOutput::E => {},
1050+
SelectorOutput::A(exit) => {
10491051
if exit {
10501052
break;
10511053
}

lightning-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lightning-macros"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
authors = ["Elias Rohrer"]
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/lightningdevkit/rust-lightning/"

lightning-transaction-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lightning-transaction-sync"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
authors = ["Elias Rohrer"]
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/lightningdevkit/rust-lightning"

lightning-transaction-sync/src/electrum.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,29 @@ where
336336
script_history.iter().filter(|h| h.tx_hash == **txid);
337337
if let Some(history) = filtered_history.next() {
338338
let prob_conf_height = history.height as u32;
339+
if prob_conf_height <= 0 {
340+
// Skip if it's a an unconfirmed entry.
341+
continue;
342+
}
339343
let confirmed_tx = self.get_confirmed_tx(tx, prob_conf_height)?;
340344
confirmed_txs.push(confirmed_tx);
341345
}
342-
debug_assert!(filtered_history.next().is_none());
346+
if filtered_history.next().is_some() {
347+
log_error!(
348+
self.logger,
349+
"Failed due to server returning multiple history entries for Tx {}.",
350+
txid
351+
);
352+
return Err(InternalError::Failed);
353+
}
343354
}
344355

345356
for (watched_output, script_history) in
346357
sync_state.watched_outputs.values().zip(output_results)
347358
{
348359
for possible_output_spend in script_history {
349360
if possible_output_spend.height <= 0 {
361+
// Skip if it's a an unconfirmed entry.
350362
continue;
351363
}
352364

lightning/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lightning"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
authors = ["Matt Corallo"]
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/lightningdevkit/rust-lightning/"
@@ -35,7 +35,7 @@ default = ["std", "grind_signatures"]
3535
[dependencies]
3636
lightning-types = { version = "0.3.0", path = "../lightning-types", default-features = false }
3737
lightning-invoice = { version = "0.34.0", path = "../lightning-invoice", default-features = false }
38-
lightning-macros = { version = "0.2.0", path = "../lightning-macros" }
38+
lightning-macros = { version = "0.2.1", path = "../lightning-macros" }
3939

4040
bech32 = { version = "0.11.0", default-features = false }
4141
bitcoin = { version = "0.32.2", default-features = false, features = ["secp-recovery"] }
@@ -53,7 +53,7 @@ inventory = { version = "0.3", optional = true }
5353
[dev-dependencies]
5454
regex = "1.5.6"
5555
lightning-types = { version = "0.3.0", path = "../lightning-types", features = ["_test_utils"] }
56-
lightning-macros = { version = "0.2.0", path = "../lightning-macros" }
56+
lightning-macros = { version = "0.2.1", path = "../lightning-macros" }
5757
parking_lot = { version = "0.12", default-features = false }
5858

5959
[dev-dependencies.bitcoin]

0 commit comments

Comments
 (0)