Skip to content
4 changes: 2 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Run security audit
uses: rustsec/audit-check@v1.4.1
uses: rustsec/audit-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ jobs:
TOOLCHAIN: stable
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
rustup override set stable
- name: Enable caching for bitcoind
id: cache-bitcoind
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
key: bitcoind-${{ runner.os }}-${{ runner.arch }}
- name: Enable caching for electrs
id: cache-electrs
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: bin/electrs-${{ runner.os }}-${{ runner.arch }}
key: electrs-${{ runner.os }}-${{ runner.arch }}
- name: Download bitcoind/electrs
if: "(steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')"
run: |
source ./scripts/download_bitcoind_electrs.sh
mkdir bin
mkdir -p bin
mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
mv "$ELECTRS_EXE" bin/electrs-${{ runner.os }}-${{ runner.arch }}
- name: Set bitcoind/electrs environment variables
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cln-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cron-weekly-rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Nightly rustfmt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Get the current date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v8
with:
author: Fmt Bot <bot@example.com>
title: Automated nightly rustfmt (${{ env.date }})
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 11
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lnd-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Check and install CMake if needed
# lnd_grpc_rust (via prost-build v0.10.4) requires CMake >= 3.5 but is incompatible with CMake >= 4.0.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: '3.10'

Expand Down
32 changes: 27 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ concurrency:

jobs:
build:
defaults:
run:
shell: bash
strategy:
matrix:
platform: [
Expand All @@ -34,33 +37,48 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install Rust ${{ matrix.toolchain }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }}
- name: Check formatting on Rust ${{ matrix.toolchain }}
if: matrix.check-fmt
run: rustup component add rustfmt && cargo fmt --all -- --check
- name: Pin packages to allow for MSRV
if: matrix.msrv
run: |
cargo update -p idna_adapter --precise "1.2.0" --verbose # idna_adapter 1.2.1 uses ICU4X 2.2.0, requiring 1.86 and newer
cargo update -p encoding_rs --precise "0.8.35" --verbose # encoding_rs 0.8.40 and newer require 1.88 and newer
cargo update -p proptest --precise "1.11.0" --verbose # proptest 1.12.0 requires Rust 1.88
- name: Set RUSTFLAGS to deny warnings
id: rustflags
if: "matrix.toolchain == 'stable'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
run: |
echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "ldk-node") | .version')
# Preserve the deprecated FeeRate constructor in the 0.7 bindings.
if [[ "$version" == 0.7.* ]]; then
echo "uniffi=-D warnings -A deprecated" >> "$GITHUB_OUTPUT"
else
echo "uniffi=-D warnings" >> "$GITHUB_OUTPUT"
fi
- name: Enable caching for bitcoind
id: cache-bitcoind
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
key: bitcoind-${{ runner.os }}-${{ runner.arch }}
- name: Enable caching for electrs
id: cache-electrs
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: bin/electrs-${{ runner.os }}-${{ runner.arch }}
key: electrs-${{ runner.os }}-${{ runner.arch }}
- name: Download bitcoind/electrs
if: "matrix.platform != 'windows-latest' && (steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')"
run: |
source ./scripts/download_bitcoind_electrs.sh
mkdir bin
mkdir -p bin
mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
mv "$ELECTRS_EXE" bin/electrs-${{ runner.os }}-${{ runner.arch }}
- name: Set bitcoind/electrs environment variables
Expand All @@ -71,6 +89,8 @@ jobs:
run: cargo build --verbose --color always
- name: Build with UniFFI support on Rust ${{ matrix.toolchain }}
if: matrix.build-uniffi
env:
RUSTFLAGS: ${{ steps.rustflags.outputs.uniffi }}
run: cargo build --features uniffi --verbose --color always
- name: Build documentation on Rust ${{ matrix.toolchain }}
if: "matrix.platform != 'windows-latest' || matrix.toolchain != '1.85.0'"
Expand All @@ -81,6 +101,8 @@ jobs:
run: cargo check --release --verbose --color always
- name: Check release build with UniFFI support on Rust ${{ matrix.toolchain }}
if: matrix.build-uniffi
env:
RUSTFLAGS: ${{ steps.rustflags.outputs.uniffi }}
run: cargo check --release --features uniffi --verbose --color always
- name: Test on Rust ${{ matrix.toolchain }}
if: "matrix.platform != 'windows-latest'"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Install Rust stable toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set default Rust version to stable
run: rustup default stable
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/vss-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,25 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
path: ldk-node
- name: Checkout VSS
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
repository: lightningdevkit/vss-server
path: vss-server

- name: Build and Deploy VSS Server
run: |
cd vss-server/rust
cargo run server/vss-server-config.toml&
version=$(cargo metadata --no-deps --format-version 1 --manifest-path ldk-node/Cargo.toml | jq -r '.packages[] | select(.name == "ldk-node") | .version')
cd vss-server
# The 0.7 tests use fixed headers without authentication.
if [[ "$version" == 0.7.* ]]; then
RUSTFLAGS="--cfg noop_authorizer" cargo run --no-default-features server/vss-server-config.toml&
else
cargo run server/vss-server-config.toml&
fi
- name: Run VSS Integration tests
run: |
cd ldk-node
Expand Down
14 changes: 8 additions & 6 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,14 @@ where
self.logger,
"Failed to process funding transaction as channel went away before we could fund it: {}",
err
)
);
},
Err(err) => {
log_error!(
self.logger,
"Failed to process funding transaction: {:?}",
err
)
);
},
}
},
Expand Down Expand Up @@ -1151,7 +1151,7 @@ where
"Channel request rejected".to_string(),
)
.unwrap_or_else(|e| {
log_error!(self.logger, "Failed to reject channel: {:?}", e)
log_error!(self.logger, "Failed to reject channel: {:?}", e);
});
return Ok(());
}
Expand Down Expand Up @@ -1195,7 +1195,7 @@ where
"Channel request rejected".to_string(),
)
.unwrap_or_else(|e| {
log_error!(self.logger, "Failed to reject channel: {:?}", e)
log_error!(self.logger, "Failed to reject channel: {:?}", e);
});
return Ok(());
}
Expand All @@ -1212,7 +1212,7 @@ where
"Channel request rejected".to_string(),
)
.unwrap_or_else(|e| {
log_error!(self.logger, "Failed to reject channel: {:?}", e)
log_error!(self.logger, "Failed to reject channel: {:?}", e);
});
return Ok(());
}
Expand Down Expand Up @@ -1704,7 +1704,9 @@ where
},
}
},
Err(()) => log_error!(self.logger, "Failed signing funding transaction"),
Err(()) => {
log_error!(self.logger, "Failed signing funding transaction");
},
},
LdkEvent::SplicePending {
channel_id,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl Node {
gossip_sync_logger,
"Background sync of RGS gossip data failed: {}",
e
)
);
}
}
}
Expand Down Expand Up @@ -1054,7 +1054,7 @@ impl Node {
match self.peer_store.remove_peer(&counterparty_node_id) {
Ok(()) => {},
Err(e) => {
log_error!(self.logger, "Failed to remove peer {}: {}", counterparty_node_id, e)
log_error!(self.logger, "Failed to remove peer {}: {}", counterparty_node_id, e);
},
}

Expand Down
8 changes: 6 additions & 2 deletions src/payment/unified_qr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,19 @@ impl UnifiedQrPayment {
let offer = maybe_wrap(offer);
match self.bolt12_payment.send(&offer, None, None, route_parameters) {
Ok(payment_id) => return Ok(QrPaymentResult::Bolt12 { payment_id }),
Err(e) => log_error!(self.logger, "Failed to send BOLT12 offer: {:?}. This is part of a unified QR code payment. Falling back to the BOLT11 invoice.", e),
Err(e) => {
log_error!(self.logger, "Failed to send BOLT12 offer: {:?}. This is part of a unified QR code payment. Falling back to the BOLT11 invoice.", e);
},
}
}

if let Some(invoice) = uri_network_checked.extras.bolt11_invoice {
let invoice = maybe_wrap(invoice);
match self.bolt11_invoice.send(&invoice, route_parameters) {
Ok(payment_id) => return Ok(QrPaymentResult::Bolt11 { payment_id }),
Err(e) => log_error!(self.logger, "Failed to send BOLT11 invoice: {:?}. This is part of a unified QR code payment. Falling back to the on-chain transaction.", e),
Err(e) => {
log_error!(self.logger, "Failed to send BOLT11 invoice: {:?}. This is part of a unified QR code payment. Falling back to the on-chain transaction.", e);
},
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ impl Runtime {

match timeout_res {
Ok(stop_res) => match stop_res {
Ok(()) => log_debug!(self.logger, "Stopped background processing of events."),
Ok(()) => {
log_debug!(self.logger, "Stopped background processing of events.");
},
Err(e) => {
abort_handle.abort();
log_error!(
Expand Down
Loading
Loading