Skip to content

Commit aa572eb

Browse files
committed
Bump MSRV to rustc 1.85
We generally align our MSRV with Debian's stable channel. Debian 13 'Trixie' was just released, shipping rustc 1.85. We therefore bump our MSRV on the `main` branch here.
1 parent 192618b commit aa572eb

File tree

14 files changed

+48
-75
lines changed

14 files changed

+48
-75
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
platform: [ self-hosted, windows-latest, macos-latest ]
34-
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
34+
toolchain: [ stable, beta, 1.85.0 ] # 1.85.0 is the MSRV for all crates but `lightning-transaction-sync`.
3535
exclude:
3636
- platform: windows-latest
37-
toolchain: 1.63.0
37+
toolchain: 1.85.0
3838
- platform: windows-latest
3939
toolchain: beta
4040
- platform: macos-latest
@@ -60,7 +60,7 @@ jobs:
6060
shellcheck ci/*.sh -aP ci
6161
shellcheck contrib/*.sh -aP contrib
6262
- name: Set RUSTFLAGS to deny warnings
63-
if: "matrix.toolchain == '1.63.0'"
63+
if: "matrix.toolchain == '1.85.0'"
6464
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
6565
- name: Run CI script
6666
shell: bash # Default on Winblows is powershell
@@ -236,17 +236,13 @@ jobs:
236236
fuzz:
237237
runs-on: self-hosted
238238
env:
239-
TOOLCHAIN: 1.63
239+
TOOLCHAIN: 1.85
240240
steps:
241241
- name: Checkout source code
242242
uses: actions/checkout@v4
243243
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
244244
run: |
245245
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
246-
- name: Pin the regex dependency
247-
run: |
248-
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
249-
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
250246
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
251247
run: |
252248
cd fuzz
@@ -275,7 +271,7 @@ jobs:
275271
rustfmt:
276272
runs-on: ubuntu-latest
277273
env:
278-
TOOLCHAIN: 1.63.0
274+
TOOLCHAIN: 1.85.0
279275
steps:
280276
- name: Checkout source code
281277
uses: actions/checkout@v4

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ be covered by functional tests.
8888
When refactoring, structure your PR to make it easy to review and don't
8989
hesitate to split it into multiple small, focused PRs.
9090

91-
The Minimum Supported Rust Version (MSRV) currently is 1.63.0 (enforced by
91+
The Minimum Supported Rust Version (MSRV) currently is 1.85.0 (enforced by
9292
our GitHub Actions). We support reading serialized LDK objects written by any
9393
version of LDK 0.0.99 and above. We support LDK versions 0.0.113 and above
9494
reading serialized LDK objects written by modern LDK. Any expected issues with
@@ -124,7 +124,7 @@ display fine at any tab-length display setting. We use `rustfmt` to establish
124124
uniform coding standards throughout the codebase. Please run
125125

126126
```bash
127-
cargo +1.63.0 fmt
127+
cargo +1.85.0 fmt
128128
```
129129

130130
before committing and pushing any changes, as compliance will also be checked

ci/check-lint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ CLIPPY() {
4545
-A clippy::len_without_is_empty \
4646
-A clippy::len_zero \
4747
-A clippy::let_and_return \
48-
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
4948
-A clippy::manual_filter \
5049
-A clippy::manual_map \
5150
-A clippy::manual_memcpy \
@@ -104,9 +103,7 @@ CLIPPY() {
104103
-A clippy::unnecessary_unwrap \
105104
-A clippy::unused_unit \
106105
-A clippy::useless_conversion \
107-
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
108106
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
109-
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
110107
-A clippy::uninlined-format-args
111108
}
112109

ci/ci-tests.sh

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
11
#!/bin/bash
22
set -eox pipefail
33

4-
RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
4+
# Currently unused as we don't have to pin anything for MSRV:
5+
#RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
56

67
# Some crates require pinning to meet our MSRV even for our downstream users,
78
# which we do here.
89
# Further crates which appear only as dev-dependencies are pinned further down.
910
function PIN_RELEASE_DEPS {
10-
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
11-
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose
12-
1311
return 0 # Don't fail the script if our rustc is higher than the last check
1412
}
1513

1614
PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
1715

18-
# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
19-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
20-
21-
# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
22-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose
23-
24-
# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
25-
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose
26-
27-
# proptest 1.3.0 requires rustc 1.64.0
28-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose
29-
30-
# parking_lot 0.12.4 requires rustc 1.64.0
31-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose
32-
33-
# parking_lot_core 0.9.11 requires rustc 1.64.0
34-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose
35-
36-
# lock_api 0.4.13 requires rustc 1.64.0
37-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
38-
3916
export RUST_BACKTRACE=1
4017

4118
echo -e "\n\nChecking the workspace, except lightning-transaction-sync."
@@ -64,7 +41,6 @@ cargo test --verbose --color always
6441

6542
echo -e "\n\nTesting upgrade from prior versions of LDK"
6643
pushd lightning-tests
67-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
6844
cargo test
6945
popd
7046

ci/ci-tx-sync-tests.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ function PIN_RELEASE_DEPS {
1414

1515
PIN_RELEASE_DEPS # pin the release dependencies
1616

17-
# Starting with version 0.5.11, the `home` crate has an MSRV of rustc 1.81.0.
18-
[ "$RUSTC_MINOR_VERSION" -lt 81 ] && cargo update -p home --precise "0.5.9" --verbose
19-
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-
2317
export RUST_BACKTRACE=1
2418

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

lightning-background-processor/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ impl<
259259
G,
260260
&'a (dyn UtxoLookup + Send + Sync),
261261
L,
262-
> where
262+
>
263+
where
263264
L::Target: Logger,
264265
{
265266
/// Initializes a new [`GossipSync::Rapid`] variant.
@@ -276,7 +277,8 @@ impl<'a, L: Deref>
276277
&'a NetworkGraph<L>,
277278
&'a (dyn UtxoLookup + Send + Sync),
278279
L,
279-
> where
280+
>
281+
where
280282
L::Target: Logger,
281283
{
282284
/// Initializes a new [`GossipSync::None`] variant.

lightning/src/ln/channel.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8671,23 +8671,25 @@ where
86718671
log_trace!(logger, "Regenerating latest commitment update in channel {} with{} {} update_adds, {} update_fulfills, {} update_fails, and {} update_fail_malformeds",
86728672
&self.context.channel_id(), if update_fee.is_some() { " update_fee," } else { "" },
86738673
update_add_htlcs.len(), update_fulfill_htlcs.len(), update_fail_htlcs.len(), update_fail_malformed_htlcs.len());
8674-
let commitment_signed =
8675-
if let Ok(update) = self.send_commitment_no_state_update(logger) {
8676-
if self.context.signer_pending_commitment_update {
8677-
log_trace!(
8678-
logger,
8679-
"Commitment update generated: clearing signer_pending_commitment_update"
8680-
);
8681-
self.context.signer_pending_commitment_update = false;
8682-
}
8683-
update
8684-
} else {
8685-
if !self.context.signer_pending_commitment_update {
8686-
log_trace!(logger, "Commitment update awaiting signer: setting signer_pending_commitment_update");
8687-
self.context.signer_pending_commitment_update = true;
8688-
}
8689-
return Err(());
8690-
};
8674+
let commitment_signed = if let Ok(update) = self.send_commitment_no_state_update(logger) {
8675+
if self.context.signer_pending_commitment_update {
8676+
log_trace!(
8677+
logger,
8678+
"Commitment update generated: clearing signer_pending_commitment_update"
8679+
);
8680+
self.context.signer_pending_commitment_update = false;
8681+
}
8682+
update
8683+
} else {
8684+
if !self.context.signer_pending_commitment_update {
8685+
log_trace!(
8686+
logger,
8687+
"Commitment update awaiting signer: setting signer_pending_commitment_update"
8688+
);
8689+
self.context.signer_pending_commitment_update = true;
8690+
}
8691+
return Err(());
8692+
};
86918693
Ok(msgs::CommitmentUpdate {
86928694
update_add_htlcs,
86938695
update_fulfill_htlcs,

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8181,7 +8181,8 @@ where
81818181
ComplFunc: FnOnce(
81828182
Option<u64>,
81838183
bool,
8184-
) -> (Option<MonitorUpdateCompletionAction>, Option<RAAMonitorUpdateBlockingAction>),
8184+
)
8185+
-> (Option<MonitorUpdateCompletionAction>, Option<RAAMonitorUpdateBlockingAction>),
81858186
>(
81868187
&self, prev_hop: HTLCPreviousHopData, payment_preimage: PaymentPreimage,
81878188
payment_info: Option<PaymentClaimDetails>, attribution_data: Option<AttributionData>,
@@ -8219,7 +8220,8 @@ where
82198220
ComplFunc: FnOnce(
82208221
Option<u64>,
82218222
bool,
8222-
) -> (Option<MonitorUpdateCompletionAction>, Option<RAAMonitorUpdateBlockingAction>),
8223+
)
8224+
-> (Option<MonitorUpdateCompletionAction>, Option<RAAMonitorUpdateBlockingAction>),
82238225
>(
82248226
&self, prev_hop: HTLCClaimSource, payment_preimage: PaymentPreimage,
82258227
payment_info: Option<PaymentClaimDetails>, attribution_data: Option<AttributionData>,

lightning/src/ln/functional_test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,7 @@ pub fn do_check_spends<F: Fn(&bitcoin::transaction::OutPoint) -> Option<TxOut>>(
19521952
total_value_out += output.value.to_sat();
19531953
}
19541954
let min_fee = (tx.weight().to_wu() as u64 + 3) / 4; // One sat per vbyte (ie per weight/4, rounded up)
1955-
// Input amount - output amount = fee, so check that out + min_fee is smaller than input
1955+
// Input amount - output amount = fee, so check that out + min_fee is smaller than input
19561956
assert!(total_value_out + min_fee <= total_value_in);
19571957
tx.verify(get_output).unwrap();
19581958
}

lightning/src/ln/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ pub fn test_justice_tx_htlc_timeout() {
12231223
revoked_local_txn[1].input[0].witness.last().unwrap().len(),
12241224
OFFERED_HTLC_SCRIPT_WEIGHT
12251225
); // HTLC-Timeout
1226-
// Revoke the old state
1226+
// Revoke the old state
12271227
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_3);
12281228

12291229
{
@@ -6635,7 +6635,7 @@ pub fn test_announce_disable_channels() {
66356635
match e {
66366636
MessageSendEvent::BroadcastChannelUpdate { ref msg } => {
66376637
assert_eq!(msg.contents.channel_flags & (1 << 1), 1 << 1); // The "channel disabled" bit should be set
6638-
// Check that each channel gets updated exactly once
6638+
// Check that each channel gets updated exactly once
66396639
if chans_disabled
66406640
.insert(msg.contents.short_channel_id, msg.contents.timestamp)
66416641
.is_some()

0 commit comments

Comments
 (0)