Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ jobs:
- name: Pin the syn and regex dependencies
run: |
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"
cargo update -p proc-macro2 --precise "1.0.103" --verbose && cargo update -p serde_json --precise "1.0.145" --verbose
cargo update -p itoa --precise "1.0.15" --verbose && cargo update -p ryu --precise "1.0.20" --verbose
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"
cargo update -p proc-macro2 --precise "1.0.103" --verbose && cargo update -p serde_json --precise "1.0.145" --verbose
cargo update -p itoa --precise "1.0.15" --verbose && cargo update -p ryu --precise "1.0.20" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 0.2.1 - Jan 26, 2025 - "Electrum Confirmations Logged"

## API Updates
* The `AttributionData` struct is now public, correcting an issue where it was
accidentally sealed preventing construction of some messages (#4268).
* The async background processor now exits even if work remains to be done as
soon as the sleeper returns the exit flag (#4259).

## Bug Fixes
* The presence of unconfirmed transactions no longer causes
`ElectrumSyncClient` to spuriously fail to sync (#4341).
* `ChannelManager::splice_channel` now properly fails immediately if the
peer does not support splicing (#4262, #4274).
* A spurious debug assertion was removed which could fail in cases where an
HTLC fails to be forwarded after being accepted (#4312).
* Many log calls related to outbound payments were corrected to include a
`payment_hash` field (#4342).


# 0.2 - Dec 2, 2025 - "Natively Asynchronous Splicing"

## API Updates
Expand Down
1 change: 1 addition & 0 deletions ci/check-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CLIPPY() {
-A clippy::unwrap-or-default \
-A clippy::upper_case_acronyms \
-A clippy::swap-with-temporary \
-A clippy::assertions-on-constants \
`# Things where we do odd stuff on purpose ` \
-A clippy::unusual_byte_groupings \
-A clippy::unit_arg \
Expand Down
17 changes: 17 additions & 0 deletions ci/ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ function PIN_RELEASE_DEPS {
# quote 1.0.42 requires rustc 1.68.0
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose

# Starting with version 1.0.104, the `proc-macro2` crate has an MSRV of rustc 1.68
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p proc-macro2 --precise "1.0.103" --verbose

# Starting with version 1.0.146, the `serde_json` crate has an MSRV of rustc 1.68
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p serde_json --precise "1.0.145" --verbose

# Starting with version 1.0.16, the `itoa` crate has an MSRV of rustc 1.68
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p itoa --precise "1.0.15" --verbose

# Starting with version 1.0.21, the `ryu` crate has an MSRV of rustc 1.68
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p ryu --precise "1.0.20" --verbose

return 0 # Don't fail the script if our rustc is higher than the last check
}

Expand Down Expand Up @@ -58,6 +70,7 @@ pushd lightning-tests
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p syn --precise "2.0.106" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p proc-macro2 --precise "1.0.103" --verbose
cargo test
popd

Expand Down Expand Up @@ -130,6 +143,10 @@ echo -e "\n\nTesting no_std build on a downstream no-std crate"
pushd no-std-check
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p syn --precise "2.0.106" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p proc-macro2 --precise "1.0.103" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p serde_json --precise "1.0.145" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p itoa --precise "1.0.15" --verbose
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p ryu --precise "1.0.20" --verbose
cargo check --verbose --color always
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
popd
Expand Down
13 changes: 7 additions & 6 deletions fuzz/src/process_onion_failure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ use lightning::{
ln::{
channelmanager::{HTLCSource, PaymentId},
msgs::OnionErrorPacket,
onion_utils,
},
routing::router::{BlindedTail, Path, RouteHop, TrampolineHop},
types::features::{ChannelFeatures, NodeFeatures},
util::logger::Logger,
util::ser::Readable,
};

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

let attribution_data = if get_bool!() {
Some(lightning::ln::AttributionData {
hold_times: get_slice!(80).try_into().unwrap(),
hmacs: get_slice!(840).try_into().unwrap(),
})
let mut bytes = get_slice!(80 + 840);
let data: onion_utils::AttributionData = Readable::read(&mut bytes).unwrap();
Some(data)
} else {
None
};
let encrypted_packet =
OnionErrorPacket { data: failure_data.into(), attribution_data: attribution_data.clone() };
lightning::ln::process_onion_failure(&secp_ctx, &logger, &htlc_source, encrypted_packet);
onion_utils::process_onion_failure(&secp_ctx, &logger, &htlc_source, encrypted_packet);

if let Some(attribution_data) = attribution_data {
lightning::ln::decode_fulfill_attribution_data(
onion_utils::decode_fulfill_attribution_data(
&secp_ctx,
&logger,
&path,
Expand Down
36 changes: 19 additions & 17 deletions lightning-background-processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,11 @@ pub(crate) mod futures_util {
use core::pin::Pin;
use core::task::{Poll, RawWaker, RawWakerVTable, Waker};
pub(crate) struct Selector<
A: Future<Output = ()> + Unpin,
A: Future<Output = bool> + Unpin,
B: Future<Output = ()> + Unpin,
C: Future<Output = ()> + Unpin,
D: Future<Output = ()> + Unpin,
E: Future<Output = bool> + Unpin,
E: Future<Output = ()> + Unpin,
> {
pub a: A,
pub b: B,
Expand All @@ -490,28 +490,30 @@ pub(crate) mod futures_util {
}

pub(crate) enum SelectorOutput {
A,
A(bool),
B,
C,
D,
E(bool),
E,
}

impl<
A: Future<Output = ()> + Unpin,
A: Future<Output = bool> + Unpin,
B: Future<Output = ()> + Unpin,
C: Future<Output = ()> + Unpin,
D: Future<Output = ()> + Unpin,
E: Future<Output = bool> + Unpin,
E: Future<Output = ()> + Unpin,
> Future for Selector<A, B, C, D, E>
{
type Output = SelectorOutput;
fn poll(
mut self: Pin<&mut Self>, ctx: &mut core::task::Context<'_>,
) -> Poll<SelectorOutput> {
// Bias the selector so it first polls the sleeper future, allowing to exit immediately
// if the flag is set.
match Pin::new(&mut self.a).poll(ctx) {
Poll::Ready(()) => {
return Poll::Ready(SelectorOutput::A);
Poll::Ready(res) => {
return Poll::Ready(SelectorOutput::A(res));
},
Poll::Pending => {},
}
Expand All @@ -534,8 +536,8 @@ pub(crate) mod futures_util {
Poll::Pending => {},
}
match Pin::new(&mut self.e).poll(ctx) {
Poll::Ready(res) => {
return Poll::Ready(SelectorOutput::E(res));
Poll::Ready(()) => {
return Poll::Ready(SelectorOutput::E);
},
Poll::Pending => {},
}
Expand Down Expand Up @@ -1037,15 +1039,15 @@ where
(false, false) => FASTEST_TIMER,
};
let fut = Selector {
a: channel_manager.get_cm().get_event_or_persistence_needed_future(),
b: chain_monitor.get_update_future(),
c: om_fut,
d: lm_fut,
e: sleeper(sleep_delay),
a: sleeper(sleep_delay),
b: channel_manager.get_cm().get_event_or_persistence_needed_future(),
c: chain_monitor.get_update_future(),
d: om_fut,
e: lm_fut,
};
match fut.await {
SelectorOutput::A | SelectorOutput::B | SelectorOutput::C | SelectorOutput::D => {},
SelectorOutput::E(exit) => {
SelectorOutput::B | SelectorOutput::C | SelectorOutput::D | SelectorOutput::E => {},
SelectorOutput::A(exit) => {
if exit {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion lightning-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lightning-macros"
version = "0.2.0"
version = "0.2.1"
authors = ["Elias Rohrer"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
Expand Down
Loading