chore: msrv 1.88 (#17782)

This commit is contained in:
Matthias Seitz
2025-08-10 17:51:26 +02:00
committed by GitHub
parent d8f9f05e2c
commit 5f0d33425e
20 changed files with 30 additions and 30 deletions

View File

@@ -118,7 +118,7 @@ jobs:
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.86" # MSRV
toolchain: "1.88" # MSRV
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -1,7 +1,7 @@
[workspace.package]
version = "1.6.0"
edition = "2021"
rust-version = "1.86"
rust-version = "1.88"
license = "MIT OR Apache-2.0"
homepage = "https://paradigmxyz.github.io/reth"
repository = "https://github.com/paradigmxyz/reth"

View File

@@ -1,5 +1,5 @@
# Use the Rust 1.86 image based on Debian Bookworm
FROM rust:1.86-bookworm AS builder
# Use the Rust 1.88 image based on Debian Bookworm
FROM rust:1.88-bookworm AS builder
# Install specific version of libclang-dev
RUN apt-get update && apt-get install -y libclang-dev=1:14.0-55.7~deb12u1

View File

@@ -89,7 +89,7 @@ When updating this, also update:
- .github/workflows/lint.yml
-->
The Minimum Supported Rust Version (MSRV) of this project is [1.86.0](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/).
The Minimum Supported Rust Version (MSRV) of this project is [1.88.0](https://blog.rust-lang.org/2025/06/26/Rust-1.88.0/).
See the docs for detailed instructions on how to [build from source](https://paradigmxyz.github.io/reth/installation/source).

View File

@@ -1,4 +1,4 @@
msrv = "1.86"
msrv = "1.88"
too-large-for-stack = 128
doc-valid-idents = [
"P2P",

View File

@@ -894,14 +894,14 @@ pub enum NewCanonicalChain<N: NodePrimitives = EthPrimitives> {
impl<N: NodePrimitives<SignedTx: SignedTransaction>> NewCanonicalChain<N> {
/// Returns the length of the new chain.
pub fn new_block_count(&self) -> usize {
pub const fn new_block_count(&self) -> usize {
match self {
Self::Commit { new } | Self::Reorg { new, .. } => new.len(),
}
}
/// Returns the length of the reorged chain.
pub fn reorged_block_count(&self) -> usize {
pub const fn reorged_block_count(&self) -> usize {
match self {
Self::Commit { .. } => 0,
Self::Reorg { old, .. } => old.len(),

View File

@@ -195,7 +195,7 @@ where
I: EngineTypes,
{
/// Get the number of nodes in the environment
pub fn node_count(&self) -> usize {
pub const fn node_count(&self) -> usize {
self.node_clients.len()
}

View File

@@ -56,7 +56,7 @@ impl EraGroup {
}
/// Check if this is a genesis era - no blocks yet
pub fn is_genesis(&self) -> bool {
pub const fn is_genesis(&self) -> bool {
self.blocks.is_empty() && self.slot_index.is_none()
}
@@ -89,7 +89,7 @@ impl SlotIndex {
}
/// Get the number of slots covered by this index
pub fn slot_count(&self) -> usize {
pub const fn slot_count(&self) -> usize {
self.offsets.len()
}

View File

@@ -201,7 +201,7 @@ impl<T> ExecutionOutcome<T> {
}
/// Transform block number to the index of block.
pub fn block_number_to_index(&self, block_number: BlockNumber) -> Option<usize> {
pub const fn block_number_to_index(&self, block_number: BlockNumber) -> Option<usize> {
if self.first_block > block_number {
return None
}
@@ -240,12 +240,12 @@ impl<T> ExecutionOutcome<T> {
}
/// Is execution outcome empty.
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
self.len() == 0
}
/// Number of blocks in the execution outcome.
pub fn len(&self) -> usize {
pub const fn len(&self) -> usize {
self.receipts.len()
}
@@ -255,7 +255,7 @@ impl<T> ExecutionOutcome<T> {
}
/// Return last block of the execution outcome
pub fn last_block(&self) -> BlockNumber {
pub const fn last_block(&self) -> BlockNumber {
(self.first_block + self.len() as u64).saturating_sub(1)
}

View File

@@ -449,7 +449,7 @@ struct OrderedBodiesResponse<B: Block> {
impl<B: Block> OrderedBodiesResponse<B> {
#[inline]
fn len(&self) -> usize {
const fn len(&self) -> usize {
self.resp.len()
}

View File

@@ -437,7 +437,7 @@ impl ChunkedFileReader {
/// Calculates the number of bytes to read from the chain file. Returns a tuple of the chunk
/// length and the remaining file length.
fn chunk_len(&self) -> u64 {
const fn chunk_len(&self) -> u64 {
let Self { chunk_byte_len, file_byte_len, .. } = *self;
let file_byte_len = file_byte_len + self.chunk.len() as u64;

View File

@@ -61,7 +61,7 @@ impl TestBodiesClient {
/// empty_response_mod == 0`.
pub(crate) fn should_respond_empty(&self) -> bool {
if let Some(empty_response_mod) = self.empty_response_mod {
self.times_requested.load(Ordering::Relaxed) % empty_response_mod == 0
self.times_requested.load(Ordering::Relaxed).is_multiple_of(empty_response_mod)
} else {
false
}

View File

@@ -228,7 +228,7 @@ impl NewPooledTransactionHashes {
}
/// Returns true if the message is empty
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
match self {
Self::Eth66(msg) => msg.0.is_empty(),
Self::Eth68(msg) => msg.hashes.is_empty(),
@@ -236,7 +236,7 @@ impl NewPooledTransactionHashes {
}
/// Returns the number of hashes in the message
pub fn len(&self) -> usize {
pub const fn len(&self) -> usize {
match self {
Self::Eth66(msg) => msg.0.len(),
Self::Eth68(msg) => msg.hashes.len(),

View File

@@ -238,13 +238,13 @@ impl SharedCapabilities {
/// Returns the number of shared capabilities.
#[inline]
pub fn len(&self) -> usize {
pub const fn len(&self) -> usize {
self.0.len()
}
/// Returns true if there are no shared capabilities.
#[inline]
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
self.0.is_empty()
}
}

View File

@@ -185,7 +185,7 @@ pub struct ListFilter {
impl ListFilter {
/// If `search` has a list of bytes, then filter for rows that have this sequence.
pub fn has_search(&self) -> bool {
pub const fn has_search(&self) -> bool {
!self.search.is_empty()
}

View File

@@ -18,7 +18,7 @@ pub struct ClientVersion {
impl ClientVersion {
/// Returns `true` if no version fields are set.
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
self.version.is_empty() && self.git_sha.is_empty() && self.build_timestamp.is_empty()
}
}

View File

@@ -772,7 +772,7 @@ mod tests {
// Create a filter that only returns transactions with even nonces
let filter =
BestTransactionFilter::new(best, |tx: &Arc<ValidPoolTransaction<MockTransaction>>| {
tx.nonce() % 2 == 0
tx.nonce().is_multiple_of(2)
});
// Verify that the filter only returns transactions with even nonces

View File

@@ -230,7 +230,7 @@ impl<T: PoolTransaction> AllPoolEventsBroadcaster<T> {
/// Returns true if there are no listeners installed.
#[inline]
fn is_empty(&self) -> bool {
const fn is_empty(&self) -> bool {
self.senders.is_empty()
}
}
@@ -246,7 +246,7 @@ struct PoolEventBroadcaster {
impl PoolEventBroadcaster {
/// Returns `true` if there are no more listeners remaining.
fn is_empty(&self) -> bool {
const fn is_empty(&self) -> bool {
self.senders.is_empty()
}

View File

@@ -668,7 +668,7 @@ pub struct AllPoolTransactions<T: PoolTransaction> {
impl<T: PoolTransaction> AllPoolTransactions<T> {
/// Returns the combined number of all transactions.
pub fn count(&self) -> usize {
pub const fn count(&self) -> usize {
self.pending.len() + self.queued.len()
}

View File

@@ -141,12 +141,12 @@ impl PrefixSetMut {
}
/// Returns the number of elements in the set.
pub fn len(&self) -> usize {
pub const fn len(&self) -> usize {
self.keys.len()
}
/// Returns `true` if the set is empty.
pub fn is_empty(&self) -> bool {
pub const fn is_empty(&self) -> bool {
self.keys.is_empty()
}