Skip to content

Commit 49eefb0

Browse files
authored
Merge pull request #4265 from TheBlueMatt/2025-12-0.1-bindings-updates
[0.1-bindings] Merge v0.1.8 into 0.1-bindings
2 parents 336674d + 4562434 commit 49eefb0

File tree

35 files changed

+2585
-637
lines changed

35 files changed

+2585
-637
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -179,29 +179,6 @@ jobs:
179179
cd bench
180180
RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench
181181
182-
check_commits:
183-
runs-on: ubuntu-latest
184-
env:
185-
TOOLCHAIN: stable
186-
steps:
187-
- name: Checkout source code
188-
uses: actions/checkout@v4
189-
with:
190-
fetch-depth: 0
191-
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
192-
run: |
193-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
194-
rustup override set ${{ env.TOOLCHAIN }}
195-
- name: Fetch full tree and rebase on upstream
196-
run: |
197-
git remote add upstream https://github.com/lightningdevkit/rust-lightning
198-
git fetch upstream
199-
export GIT_COMMITTER_EMAIL="[email protected]"
200-
export GIT_COMMITTER_NAME="RL CI"
201-
git rebase upstream/main
202-
- name: For each commit, run cargo check (including in fuzz)
203-
run: ci/check-each-commit.sh upstream/main
204-
205182
check_release:
206183
runs-on: ubuntu-latest
207184
env:
@@ -231,6 +208,24 @@ jobs:
231208
RUSTFLAGS: '--cfg=taproot'
232209
RUSTDOCFLAGS: '--cfg=taproot'
233210

211+
check_docs:
212+
runs-on: self-hosted
213+
env:
214+
# While docs.rs builds using a nightly compiler (and we use some nightly features),
215+
# nightly ends up randomly breaking builds occasionally, so we instead use beta
216+
# and set RUSTC_BOOTSTRAP in check-docsrs.sh
217+
TOOLCHAIN: beta
218+
steps:
219+
- name: Checkout source code
220+
uses: actions/checkout@v4
221+
with:
222+
fetch-depth: 0
223+
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
224+
run: |
225+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
226+
- name: Simulate docs.rs build
227+
run: ci/check-docsrs.sh
228+
234229
fuzz:
235230
runs-on: ubuntu-latest
236231
env:
@@ -291,20 +286,3 @@ jobs:
291286
rustup component add rustfmt
292287
- name: Run rustfmt checks
293288
run: ci/rustfmt.sh
294-
295-
incremental-mutants:
296-
runs-on: ubuntu-latest
297-
if: github.ref_name != 'main' # `main` has no diff with itself
298-
steps:
299-
- uses: actions/checkout@v4
300-
with:
301-
fetch-depth: 0
302-
- name: Relative diff
303-
run: |
304-
git branch -av
305-
git diff origin/main.. | tee git.diff
306-
- uses: Swatinem/rust-cache@v2
307-
- name: Mutants
308-
run: |
309-
cargo install cargo-mutants
310-
cargo mutants --no-shuffle -j 2 -vV --in-diff git.diff
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI check_commits
2+
3+
on:
4+
pull_request:
5+
branches-ignore:
6+
- master
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check_commits:
14+
runs-on: ubuntu-latest
15+
env:
16+
TOOLCHAIN: stable
17+
steps:
18+
- name: Checkout source code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
23+
run: |
24+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
25+
rustup override set ${{ env.TOOLCHAIN }}
26+
- name: Fetch full tree and rebase on upstream
27+
run: |
28+
git remote add upstream https://github.com/lightningdevkit/rust-lightning
29+
git fetch upstream
30+
export GIT_COMMITTER_EMAIL="[email protected]"
31+
export GIT_COMMITTER_NAME="RL CI"
32+
git rebase upstream/${{ github.base_ref }}
33+
- name: For each commit, run cargo check (including in fuzz)
34+
run: ci/check-each-commit.sh upstream/${{ github.base_ref }}

CHANGELOG.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,60 @@
1-
# 0.1.5 - Jul XXX, 2025 - "Async Path Reduction"
1+
# 0.1.8 - Dec 2, 2025 - "Async Update Completion"
2+
3+
## Bug Fixes
4+
* In cases where an MPP payment is claimed while one channel is waiting on a
5+
counterparty's `revoke_and_ack` message and the `revoke_and_ack` message is
6+
received prior to the asynchronous completion of the MPP-claim
7+
`ChannelMonitorUpdate`, the channel will no longer hang (#4236).
8+
* Deserializing invalid `Duration`s can no longer panic (#4172).
9+
10+
11+
# 0.1.7 - Oct 21, 2025 - "Unstable Release CI"
12+
13+
## Bug Fixes
14+
* Builds with the `docsrs` cfg flag (set automatically for builds on docs.rs
15+
but otherwise not used) were fixed.
16+
17+
18+
# 0.1.6 - Oct 10, 2025 - "Async Preimage Claims"
19+
20+
## Performance Improvements
21+
* `NetworkGraph::remove_stale_channels_and_tracking` has been sped up by more
22+
than 20x in cases where many entries need to be removed (such as after
23+
initial gossip sync, #4080).
24+
25+
## Bug Fixes
26+
* Delivery of on-chain resolutions of HTLCs to `ChannelManager` has been made
27+
more robust to prevent loss in some exceedingly rare crash cases. This may
28+
marginally increase payment resolution event replays on startup (#3984).
29+
* Corrected forwarding of new gossip to peers which we are sending an initial
30+
gossip sync to (#4107).
31+
* A rare race condition may have resulted in outbound BOLT12 payments
32+
spuriously failing while processing the `Bolt12Invoice` message (#4078).
33+
* If a channel is updated multiple times after a payment is claimed while using
34+
async persistence of the `ChannelMonitorUpdate`s, and the node then restarts
35+
with a stale copy of its `ChannelManager`, the `PaymentClaimed` may have been
36+
lost (#3988).
37+
* If an async-persisted `ChannelMonitorUpdate` for one part of an MPP claim
38+
does not complete before multiple `ChannelMonitorUpdate`s for another channel
39+
in the same MPP claim complete, and the node restarts twice, the preimage may
40+
be lost and the MPP payment part may not be claimed (#3928).
41+
42+
## Security
43+
0.1.6 fixes a denial of service vulnerability and a funds-theft vulnerability.
44+
* When a channel has been force-closed, we have already claimed some of its
45+
HTLCs on-chain, and we later learn a new preimage allowing us to claim
46+
further HTLCs on-chain, we could in some cases generate invalid claim
47+
transactions leading to loss of funds (#4154).
48+
* When a `ChannelMonitor` is created for a channel which is never funded with
49+
a real transaction, `ChannelMonitor::get_claimable_balances` would never be
50+
empty. As a result, `ChannelMonitor::check_and_update_full_resolution_status`
51+
would never indicate the monitor is prunable, and thus
52+
`ChainMonitor::archive_fully_resolved_channel_monitors` would never remove
53+
it. This allows a peer which opens channels without funding them to bloat our
54+
memory and disk space, eventually leading to denial-of-service (#4081).
55+
56+
57+
# 0.1.5 - Jul 16, 2025 - "Async Path Reduction"
258

359
## Performance Improvements
460
* `NetworkGraph`'s expensive internal consistency checks have now been

ci/check-docsrs.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
#shellcheck disable=SC2002,SC2086,SC2207
3+
4+
set -ex
5+
6+
# Attempt to simulate the docsrs builds. Sadly its not entirely trivial as
7+
# docs.rs reads metadata out of Cargo.toml which we don't want to have a whole
8+
# parser for.
9+
10+
WORKSPACE_MEMBERS=( $(cat Cargo.toml | tr '\n' '\r' | sed 's/\r //g' | tr '\r' '\n' | grep '^members =' | sed 's/members.*=.*\[//' | tr -d '"' | tr ',' '\n') )
11+
echo "${WORKSPACE_MEMBERS[@]}"
12+
for CRATE in "${WORKSPACE_MEMBERS[@]}"; do
13+
pushd "$CRATE"
14+
CARGO_ARGS=""
15+
RUSTDOC_ARGS=""
16+
cat Cargo.toml | grep -A 100 '\[package.metadata.docs.rs\]' | tail -n +2 > /tmp/ldk-docsrs-rustdoc-config.txt
17+
while read -r LINE; do
18+
case "$LINE" in
19+
"["*) break;;
20+
"features"*)
21+
OG_IFS="$IFS"
22+
IFS=','
23+
for FEATURE in $(echo "$LINE" | sed 's/features.*=.*\[//g' | tr -d '"] '); do
24+
export CARGO_ARGS="$CARGO_ARGS --features $FEATURE"
25+
done
26+
IFS="$OG_IFS"
27+
;;
28+
"all-features = true")
29+
export CARGO_ARGS="$CARGO_ARGS --all-features"
30+
;;
31+
"rustdoc-args"*)
32+
RUSTDOC_ARGS="$(echo "$LINE" | sed 's/rustdoc-args.*=.*\[//g' | tr -d '"],')"
33+
;;
34+
esac
35+
done < /tmp/ldk-docsrs-rustdoc-config.txt
36+
rm /tmp/ldk-docsrs-rustdoc-config.txt
37+
echo "Building $CRATE with args $CARGO_ARGS and flags $RUSTDOC_ARGS"
38+
# We rely on nightly features but want to use a stable release in CI to avoid
39+
# spurous breakage, thus we set RUSTC_BOOTSTRAP=1 here.
40+
RUSTC_BOOTSTRAP=1 cargo rustdoc $CARGO_ARGS -- $RUSTDOC_ARGS
41+
popd
42+
done

ci/ci-tests.sh

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
#shellcheck disable=SC2002,SC2207
23
set -eox pipefail
34

45
RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
@@ -7,6 +8,12 @@ RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
78
# which we do here.
89
# Further crates which appear only as dev-dependencies are pinned further down.
910
function PIN_RELEASE_DEPS {
11+
# Starting with version 2.0.107, the `syn` crate has an MSRV of rustc 1.68
12+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p syn --precise "2.0.106" --verbose
13+
14+
# Starting with version 1.0.42, the `quote` crate has an MSRV of rustc 1.68
15+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose
16+
1017
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
1118
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose
1219

@@ -27,28 +34,21 @@ PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
2734
# proptest 1.3.0 requires rustc 1.64.0
2835
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose
2936

37+
# parking_lot 0.12.4 requires rustc 1.64.0
38+
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose
39+
40+
# parking_lot_core 0.9.11 requires rustc 1.64.0
41+
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose
42+
43+
# lock_api 0.4.13 requires rustc 1.64.0
44+
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
45+
3046
export RUST_BACKTRACE=1
3147

3248
echo -e "\n\nChecking the workspace, except lightning-transaction-sync."
3349
cargo check --verbose --color always
3450

35-
# When the workspace members change, make sure to update the list here as well
36-
# as in `Cargo.toml`.
37-
WORKSPACE_MEMBERS=(
38-
lightning
39-
lightning-types
40-
lightning-block-sync
41-
lightning-invoice
42-
lightning-net-tokio
43-
lightning-persister
44-
lightning-background-processor
45-
lightning-rapid-gossip-sync
46-
lightning-custom-message
47-
lightning-macros
48-
lightning-dns-resolver
49-
lightning-liquidity
50-
possiblyrandom
51-
)
51+
WORKSPACE_MEMBERS=( $(cat Cargo.toml | tr '\n' '\r' | sed 's/\r //g' | tr '\r' '\n' | grep '^members =' | sed 's/members.*=.*\[//' | tr -d '"' | tr ',' ' ') )
5252

5353
echo -e "\n\nChecking, testing, and building docs for all workspace members individually..."
5454
for DIR in "${WORKSPACE_MEMBERS[@]}"; do
@@ -59,8 +59,11 @@ done
5959

6060
echo -e "\n\nTesting upgrade from prior versions of LDK"
6161
pushd lightning-tests
62+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p syn --precise "2.0.106" --verbose
63+
[ "$RUSTC_MINOR_VERSION" -lt 68 ] && cargo update -p quote --precise "1.0.41" --verbose
6264
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
6365
cargo test
66+
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
6467
popd
6568

6669
echo -e "\n\nChecking and testing Block Sync Clients with features"

ci/ci-tx-sync-tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ PIN_RELEASE_DEPS # pin the release dependencies
1717
# Starting with version 0.5.11, the `home` crate has an MSRV of rustc 1.81.0.
1818
[ "$RUSTC_MINOR_VERSION" -lt 81 ] && cargo update -p home --precise "0.5.9" --verbose
1919

20+
# Starting with version 1.2.0, the `idna_adapter` crate has an MSRV of rustc 1.81.0.
21+
[ "$RUSTC_MINOR_VERSION" -lt 81 ] && cargo update -p idna_adapter --precise "1.1.0" --verbose
22+
2023
export RUST_BACKTRACE=1
2124

2225
echo -e "\n\nChecking Transaction Sync Clients with features."

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![deny(rustdoc::private_intra_doc_links)]
66
#![deny(missing_docs)]
77
#![cfg_attr(not(feature = "futures"), deny(unsafe_code))]
8-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8+
#![cfg_attr(docsrs, feature(doc_cfg))]
99
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
1010

1111
#[cfg(any(test, feature = "std"))]

lightning-block-sync/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#![deny(rustdoc::private_intra_doc_links)]
1818
#![deny(missing_docs)]
1919
#![deny(unsafe_code)]
20-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
20+
#![cfg_attr(docsrs, feature(doc_cfg))]
2121

2222
#[cfg(any(feature = "rest-client", feature = "rpc-client"))]
2323
pub mod http;

lightning-invoice/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![deny(non_camel_case_types)]
66
#![deny(non_snake_case)]
77
#![deny(unused_mut)]
8-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8+
#![cfg_attr(docsrs, feature(doc_cfg))]
99
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
1010

1111
//! This crate provides data structures to represent

lightning-liquidity/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#![allow(bare_trait_objects)]
4646
#![allow(ellipsis_inclusive_range_patterns)]
4747
#![allow(clippy::drop_non_drop)]
48-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
48+
#![cfg_attr(docsrs, feature(doc_cfg))]
4949
#![cfg_attr(not(feature = "std"), no_std)]
5050

5151
#[macro_use]

0 commit comments

Comments
 (0)