Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,10 +31,10 @@ jobs:
fail-fast: false
matrix:
platform: [ self-hosted, windows-latest, macos-latest ]
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
exclude:
- platform: windows-latest
toolchain: 1.63.0
toolchain: 1.75.0
- platform: windows-latest
toolchain: beta
- platform: macos-latest
Expand All@@ -60,7 +60,7 @@ jobs:
shellcheck ci/*.sh -aP ci
shellcheck contrib/*.sh -aP contrib
- name: Set RUSTFLAGS to deny warnings
if: "matrix.toolchain == '1.63.0'"
if: "matrix.toolchain == '1.75.0'"
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
- name: Run CI script
shell: bash # Default on Winblows is powershell
Expand All@@ -71,7 +71,7 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
toolchain: [ stable, beta, 1.75.0 ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source code
Expand DownExpand Up@@ -254,17 +254,13 @@ jobs:
fuzz:
runs-on: self-hosted
env:
TOOLCHAIN: 1.63
TOOLCHAIN: 1.75
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
- name: Pin the regex dependency
run: |
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
run: |
cd fuzz
Expand DownExpand Up@@ -293,7 +289,7 @@ jobs:
rustfmt:
runs-on: ubuntu-latest
env:
TOOLCHAIN: 1.63.0
TOOLCHAIN: 1.75.0
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ be covered by functional tests.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

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

```bash
cargo +1.63.0 fmt
cargo +1.75.0 fmt
```

before committing and pushing any changes, as compliance will also be checked
Expand Down
3 changes: 0 additions & 3 deletions ci/check-lint.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,7 +47,6 @@ CLIPPY() {
-A clippy::len_without_is_empty \
-A clippy::len_zero \
-A clippy::let_and_return \
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
-A clippy::manual_filter \
-A clippy::manual_map \
-A clippy::manual_memcpy \
Expand DownExpand Up@@ -106,9 +105,7 @@ CLIPPY() {
-A clippy::unnecessary_unwrap \
-A clippy::unused_unit \
-A clippy::useless_conversion \
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
-A clippy::manual_is_multiple_of `# to be removed once we hit MSRV 1.87` \
-A clippy::uninlined-format-args
}
Expand Down
29 changes: 4 additions & 25 deletions ci/ci-tests.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,40 +2,20 @@
#shellcheck disable=SC2002,SC2207
set -eox pipefail

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

# Some crates require pinning to meet our MSRV even for our downstream users,
# which we do here.
# Further crates which appear only as dev-dependencies are pinned further down.
function PIN_RELEASE_DEPS {
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose

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

PIN_RELEASE_DEPS # pin the release dependencies in our main workspace

# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose

# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose

# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose

# proptest 1.3.0 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose

# parking_lot 0.12.4 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose

# parking_lot_core 0.9.11 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose

# lock_api 0.4.13 requires rustc 1.64.0
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verbose

export RUST_BACKTRACE=1

Expand All@@ -49,7 +29,6 @@ cargo test --verbose --color always

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

Expand Down
1 change: 1 addition & 0 deletions lightning-background-processor/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to perform required background tasks for Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-block-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities to fetch the chain data from a block source and feed them into Rust Lightning.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-custom-message/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for supporting custom peer-to-peer messages in LDK.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
edition = "2021"
rust-version = "1.75"

[dependencies]
lightning = { version = "0.2.0", path = "../lightning", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions lightning-invoice/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
readme = "README.md"
repository = "https://github.com/lightningdevkit/rust-lightning/"
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/de.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
// Carry bits, 0, 1, 2, 3, or 4 bits
let mut carry_bits = 0;
let mut carry = 0u8;
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
let mut output = Vec::<u8>::with_capacity(expected_raw_length);

// Iterate over input in reverse
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/ser.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
/// The length of the output of `encode_int_be_base32`.
fn encoded_int_be_base32_size(int: u64) -> usize {
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
(bit_len + 4) / 5
bit_len.div_ceil(5)
}

impl Base32Iterable for RawDataPart {
Expand Down
1 change: 1 addition & 0 deletions lightning-liquidity/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["John Cantrell <johncantrell97@gmail.com>", "Elias Rohrer <dev@tnull.
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
description = "Types and primitives to integrate a spec-compliant LSP with an LDK-based node."
repository = "https://github.com/lightningdevkit/lightning-liquidity/"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps2/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -781,7 +781,7 @@ where
/// Returns whether the peer has any active LSPS2 requests.
pub(crate) fn has_active_requests(&self, counterparty_node_id: &PublicKey) -> bool {
let outer_state_lock = self.per_peer_state.read().unwrap();
outer_state_lock.get(counterparty_node_id).map_or(false, |inner| {
outer_state_lock.get(counterparty_node_id).is_some_and(|inner| {
let peer_state = inner.lock().unwrap();
!peer_state.outbound_channels_by_intercept_scid.is_empty()
})
Expand Down
2 changes: 1 addition & 1 deletion lightning-liquidity/src/lsps5/service.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -596,7 +596,7 @@ where
// (other than lsps5.webhook_registered) close in time.
if notification.method != WebhookNotificationMethod::LSPS5WebhookRegistered {
let rate_limit_applies = peer_state.webhooks().iter().any(|(_, webhook)| {
webhook.last_notification_sent.as_ref().map_or(false, |last_sent| {
webhook.last_notification_sent.as_ref().is_some_and(|last_sent| {
now.duration_since(&last_sent) < NOTIFICATION_COOLDOWN_TIME
})
});
Expand Down
8 changes: 4 additions & 4 deletions lightning-liquidity/src/manager.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,12 +770,12 @@ where
let lsps2_has_active_requests = self
.lsps2_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(lsps1_service)]
let lsps1_has_active_requests = self
.lsps1_service_handler
.as_ref()
.map_or(false, |h| h.has_active_requests(sender_node_id));
.is_some_and(|h| h.has_active_requests(sender_node_id));
#[cfg(not(lsps1_service))]
let lsps1_has_active_requests = false;

Expand DownExpand Up@@ -918,7 +918,7 @@ where
fn provided_node_features(&self) -> NodeFeatures {
let mut features = NodeFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);

if advertise_service {
features
Expand All@@ -932,7 +932,7 @@ where
fn provided_init_features(&self, _their_node_id: PublicKey) -> InitFeatures {
let mut features = InitFeatures::empty();

let advertise_service = self.service_config.as_ref().map_or(false, |c| c.advertise_service);
let advertise_service = self.service_config.as_ref().is_some_and(|c| c.advertise_service);
if advertise_service {
features
.set_optional_custom_bit(LSPS_FEATURE_BIT)
Expand Down
1 change: 1 addition & 0 deletions lightning-macros/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Proc macros used by LDK
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
1 change: 1 addition & 0 deletions lightning-net-tokio/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ Implementation of the rust-lightning network stack using Tokio.
For Rust-Lightning clients which wish to make direct connections to Lightning P2P nodes, this is a simple alternative to implementing the required network stack, especially for those already using Tokio.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions lightning-persister/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for LDK data persistence and retrieval.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
10 changes: 5 additions & 5 deletions lightning-persister/src/utils.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(secondary_namespace),
PrintableString(key)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -37,7 +37,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.", operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}

if !is_valid_kvstore_str(primary_namespace)
Expand All@@ -50,7 +50,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!("Failed to {} {}/{}/{}: primary namespace, secondary namespace, and key must be valid.",
operation,
PrintableString(primary_namespace), PrintableString(secondary_namespace), PrintableString(key));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
} else {
if primary_namespace.is_empty() && !secondary_namespace.is_empty() {
Expand All@@ -60,7 +60,7 @@ pub(crate) fn check_namespace_key_validity(
let msg = format!(
"Failed to {} {}/{}: primary namespace may not be empty if a non-empty secondary namespace is given.",
operation, PrintableString(primary_namespace), PrintableString(secondary_namespace));
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
if !is_valid_kvstore_str(primary_namespace) || !is_valid_kvstore_str(secondary_namespace) {
debug_assert!(
Expand All@@ -76,7 +76,7 @@ pub(crate) fn check_namespace_key_validity(
PrintableString(primary_namespace),
PrintableString(secondary_namespace)
);
return Err(std::io::Error::new(std::io::ErrorKind::Other, msg));
return Err(std::io::Error::other(msg));
}
}

Expand Down
1 change: 1 addition & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ authors = ["Arik Sosman <git@arik.io>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning"
edition = "2021"
rust-version = "1.75"
description = """
Utility to process gossip routing data from Rapid Gossip Sync Server.
"""
Expand Down
11 changes: 11 additions & 0 deletions lightning-tests/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = "Tests for LDK crates"
edition = "2021"
rust-version = "1.75"

[features]

Expand All@@ -20,3 +21,13 @@ lightning_0_0_125 = { package = "lightning", version = "0.0.125", features = ["_
bitcoin = { version = "0.32.2", default-features = false }

[dev-dependencies]

[lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(taproot)",
]
1 change: 1 addition & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ description = """
Utilities for syncing LDK via the transaction-based `Confirm` interface.
"""
edition = "2021"
rust-version = "1.75"

[package.metadata.docs.rs]
all-features = true
Expand Down
Loading
Loading