Skip to content

Commit d1145ee

Browse files
committed
Merge tag 'v0.0.118' into 6b4f5ab
0.0.118 - Oct 23, 2023 - "Just the Twelve Sinks" API Updates =========== * BOLT12 sending and receiving is now supported as an alpha feature. You may run into unexpected issues and will need to have a direct connection with the offer's blinded path introduction points as messages are not yet routed. We are seeking feedback from early testers (lightningdevkit#2578, lightningdevkit#2039). * `ConfirmationTarget` has been rewritten to provide information about the specific use LDK needs the feerate estimate for, rather than the generic low-, medium-, and high-priority estimates. This allows LDK users to more accurately target their feerate estimates (lightningdevkit#2660). For those wishing to retain their existing behavior, see the table below for conversion. * `ChainHash` is now used in place of `BlockHash` where it represents the genesis block (lightningdevkit#2662). * `lightning-invoice` payment utilities now take a `Deref` to `AChannelManager` (lightningdevkit#2652). * `peel_onion` is provided to statelessly decode an `OnionMessage` (lightningdevkit#2599). * `ToSocketAddrs` + `Display` are now impl'd for `SocketAddress` (lightningdevkit#2636, lightningdevkit#2670) * `Display` is now implemented for `OutPoint` (lightningdevkit#2649). * `Features::from_be_bytes` is now provided (lightningdevkit#2640). For those moving to the new `ConfirmationTarget`, the new variants in terms of the old mempool/low/medium/high priorities are as follows: * `OnChainSweep` = `HighPriority` * `MaxAllowedNonAnchorChannelRemoteFee` = `max(25 * 250, HighPriority * 10)` * `MinAllowedAnchorChannelRemoteFee` = `MempoolMinimum` * `MinAllowedNonAnchorChannelRemoteFee` = `Background - 250` * `AnchorChannelFee` = `Background` * `NonAnchorChannelFee` = `Normal` * `ChannelCloseMinimum` = `Background` Bug Fixes ========= * Calling `ChannelManager::close_channel[_with_feerate_and_script]` on a channel which did not exist would immediately hang holding several key `ChannelManager`-internal locks (lightningdevkit#2657). * Channel information updates received from a failing HTLC are no longer applied to our `NetworkGraph`. This prevents a node which we attempted to route a payment through from being able to learn the sender of the payment. In some rare cases, this may result in marginally reduced payment success rates (lightningdevkit#2666). * Anchor outputs are now properly considered when calculating the amount available to send in HTLCs. This can prevent force-closes in anchor channels when sending payments which overflow the available balance (lightningdevkit#2674). * A peer that sends an `update_fulfill_htlc` message for a forwarded HTLC, then reconnects prior to sending a `commitment_signed` (thus retransmitting their `update_fulfill_htlc`) may result in the channel stalling and being unable to make progress (lightningdevkit#2661). * In exceedingly rare circumstances, messages intended to be sent to a peer prior to reconnection can be sent after reconnection. This could result in undefined channel state and force-closes (lightningdevkit#2663). Backwards Compatibility ======================= * Creating a blinded path to receive a payment then downgrading to LDK prior to 0.0.117 may result in failure to receive the payment (lightningdevkit#2413). * Calling `ChannelManager::pay_for_offer` or `ChannelManager::create_refund_builder` may prevent downgrading to LDK prior to 0.0.118 until the payment times out and has been removed (lightningdevkit#2039). Node Compatibility ================== * LDK now sends a bogus `channel_reestablish` message to peers when they ask to resume an unknown channel. This should cause LND nodes to force-close and broadcast the latest channel state to the chain. In order to trigger this when we wish to force-close a channel, LDK now disconnects immediately after sending a channel-closing `error` message. This should result in cooperative peers also working to confirm the latest commitment transaction when we wish to force-close (lightningdevkit#2658). Security ======== 0.0.118 expands mitigations against transaction cycling attacks to non-anchor channels, though note that no mitigations which exist today are considered robust to prevent the class of attacks. * In order to mitigate against transaction cycling attacks, non-anchor HTLC transactions are now properly re-signed before broadcasting (lightningdevkit#2667). In total, this release features 61 files changed, 3470 insertions, 1503 deletions in 85 commits from 12 authors, in alphabetical order: * Antonio Yang * Elias Rohrer * Evan Feenstra * Fedeparma74 * Gursharan Singh * Jeffrey Czyz * Matt Corallo * Sergi Delgado Segura * Vladimir Fomene * Wilmer Paulino * benthecarman * slanesuke
2 parents 6b4f5ab + d2242f6 commit d1145ee

File tree

178 files changed

+41130
-16819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+41130
-16819
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
include:
2323
- toolchain: stable
2424
platform: ubuntu-latest
25-
coverage: true
2625
# 1.48.0 is the MSRV for all crates except lightning-transaction-sync and Win/Mac
2726
- toolchain: 1.48.0
2827
platform: ubuntu-latest
@@ -37,11 +36,9 @@ jobs:
3736
- name: Checkout source code
3837
uses: actions/checkout@v3
3938
- name: Install Rust ${{ matrix.toolchain }} toolchain
40-
uses: actions-rs/toolchain@v1
41-
with:
42-
toolchain: ${{ matrix.toolchain }}
43-
override: true
44-
profile: minimal
39+
run: |
40+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }}
41+
rustup override set ${{ matrix.toolchain }}
4542
- name: Install no-std-check dependencies for ARM Embedded
4643
if: "matrix.platform == 'ubuntu-latest'"
4744
run: |
@@ -52,46 +49,31 @@ jobs:
5249
run: |
5350
sudo apt-get -y install shellcheck
5451
shellcheck ci/ci-tests.sh
55-
- name: Run CI script with coverage generation
56-
if: matrix.coverage
57-
shell: bash # Default on Winblows is powershell
58-
run: LDK_COVERAGE_BUILD=true ./ci/ci-tests.sh
5952
- name: Run CI script
60-
if: "!matrix.coverage"
6153
shell: bash # Default on Winblows is powershell
62-
run: ./ci/ci-tests.sh
63-
- name: Install deps for kcov
64-
if: matrix.coverage
65-
run: |
66-
sudo apt-get update
67-
sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
68-
- name: Install kcov
69-
if: matrix.coverage
70-
run: |
71-
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
72-
tar xzf master.tar.gz
73-
cd kcov-master && mkdir build && cd build
74-
cmake ..
75-
make
76-
make install DESTDIR=../../kcov-build
77-
cd ../.. && rm -rf kcov-master master.tar.gz
78-
- name: Generate coverage report
79-
if: matrix.coverage
80-
run: |
81-
for file in target/debug/deps/lightning*; do
82-
[ -x "${file}" ] || continue;
83-
mkdir -p "target/cov/$(basename $file)";
84-
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
85-
done
86-
- name: Upload coverage
87-
if: matrix.coverage
88-
uses: codecov/codecov-action@v3
54+
run: CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh
55+
56+
coverage:
57+
strategy:
58+
fail-fast: false
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout source code
62+
uses: actions/checkout@v3
8963
with:
64+
fetch-depth: 0
65+
- name: Install Rust stable toolchain
66+
run: |
67+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
68+
- name: Run tests with coverage generation
69+
run: |
70+
cargo install cargo-llvm-cov
71+
export RUSTFLAGS="-Clink-dead-code -Coverflow-checks=off"
72+
cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json
9073
# Could you use this to fake the coverage report for your PR? Sure.
9174
# Will anyone be impressed by your amazing coverage? No
9275
# Maybe if codecov wasn't broken we wouldn't need to do this...
93-
token: f421b687-4dc2-4387-ac3d-dc3b2528af57
94-
fail_ci_if_error: true
76+
bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57"
9577
9678
benchmark:
9779
runs-on: ubuntu-latest
@@ -101,11 +83,9 @@ jobs:
10183
- name: Checkout source code
10284
uses: actions/checkout@v3
10385
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
104-
uses: actions-rs/toolchain@v1
105-
with:
106-
toolchain: ${{ env.TOOLCHAIN }}
107-
override: true
108-
profile: minimal
86+
run: |
87+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
88+
rustup override set ${{ env.TOOLCHAIN }}
10989
- name: Cache routing graph snapshot
11090
id: cache-graph
11191
uses: actions/cache@v3
@@ -141,23 +121,26 @@ jobs:
141121
cd ..
142122
- name: Run benchmarks on Rust ${{ matrix.toolchain }}
143123
run: |
144-
RUSTC_BOOTSTRAP=1 cargo bench --features _bench_unstable
124+
cd bench
125+
RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench
126+
- name: Run benchmarks with hashbrown on Rust ${{ matrix.toolchain }}
127+
run: |
128+
cd bench
129+
RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench --features hashbrown
145130
146131
check_commits:
147132
runs-on: ubuntu-latest
148133
env:
149-
TOOLCHAIN: 1.57.0
134+
TOOLCHAIN: stable
150135
steps:
151136
- name: Checkout source code
152137
uses: actions/checkout@v3
153138
with:
154139
fetch-depth: 0
155140
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
156-
uses: actions-rs/toolchain@v1
157-
with:
158-
toolchain: ${{ env.TOOLCHAIN }}
159-
override: true
160-
profile: minimal
141+
run: |
142+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
143+
rustup override set ${{ env.TOOLCHAIN }}
161144
- name: Fetch full tree and rebase on upstream
162145
run: |
163146
git remote add upstream https://github.com/lightningdevkit/rust-lightning
@@ -178,41 +161,36 @@ jobs:
178161
with:
179162
fetch-depth: 0
180163
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
181-
uses: actions-rs/toolchain@v1
182-
with:
183-
toolchain: ${{ env.TOOLCHAIN }}
184-
override: true
185-
profile: minimal
164+
run: |
165+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
166+
rustup override set ${{ env.TOOLCHAIN }}
186167
- name: Run cargo check for release build.
187168
run: |
188169
cargo check --release
189170
cargo check --no-default-features --features=no-std --release
190171
cargo check --no-default-features --features=futures --release
191172
cargo doc --release
192-
RUSTDOCFLAGS="--cfg=anchors" cargo doc --release
193173
- name: Run cargo check for Taproot build.
194174
run: |
195175
cargo check --release
196176
cargo check --no-default-features --features=no-std --release
197177
cargo check --no-default-features --features=futures --release
198178
cargo doc --release
199179
env:
200-
RUSTFLAGS: '--cfg=anchors --cfg=taproot'
201-
RUSTDOCFLAGS: '--cfg=anchors --cfg=taproot'
180+
RUSTFLAGS: '--cfg=taproot'
181+
RUSTDOCFLAGS: '--cfg=taproot'
202182

203183
fuzz:
204184
runs-on: ubuntu-latest
205185
env:
206-
TOOLCHAIN: stable
186+
TOOLCHAIN: 1.58
207187
steps:
208188
- name: Checkout source code
209189
uses: actions/checkout@v3
210-
- name: Install Rust 1.58 toolchain
211-
uses: actions-rs/toolchain@v1
212-
with:
213-
toolchain: 1.58
214-
override: true
215-
profile: minimal
190+
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
191+
run: |
192+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
193+
rustup override set ${{ env.TOOLCHAIN }}
216194
- name: Install dependencies for honggfuzz
217195
run: |
218196
sudo apt-get update
@@ -232,11 +210,9 @@ jobs:
232210
- name: Checkout source code
233211
uses: actions/checkout@v3
234212
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
235-
uses: actions-rs/toolchain@v1
236-
with:
237-
toolchain: ${{ env.TOOLCHAIN }}
238-
override: true
239-
profile: minimal
213+
run: |
214+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
215+
rustup override set ${{ env.TOOLCHAIN }}
240216
- name: Install clippy
241217
run: |
242218
rustup component add clippy

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ lightning-c-bindings/a.out
88
Cargo.lock
99
.idea
1010
lightning/target
11-
lightning/ldk-net_graph-*.bin
11+
lightning/net_graph-*.bin
12+
lightning-rapid-gossip-sync/res/full_graph.lngossip
1213
lightning-custom-message/target
14+
lightning-transaction-sync/target
1315
no-std-check/target

0 commit comments

Comments
 (0)