diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0a36d5fc084e..9020f7c74df7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -87,7 +87,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: "1.79" # MSRV + toolchain: "1.80" # MSRV - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true @@ -130,7 +130,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: "1.79" # MSRV + toolchain: "1.80" # MSRV - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true diff --git a/Cargo.lock b/Cargo.lock index 245c1d06d21a..abc58bc60007 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2914,7 +2914,6 @@ version = "0.0.0" dependencies = [ "eyre", "futures", - "once_cell", "reth-chainspec", "reth-discv4", "reth-ecies", @@ -7466,7 +7465,6 @@ name = "reth-metrics-derive" version = "1.0.3" dependencies = [ "metrics", - "once_cell", "proc-macro2", "quote", "regex", @@ -7834,7 +7832,6 @@ dependencies = [ "metrics-exporter-prometheus", "metrics-process", "metrics-util", - "once_cell", "procfs", "reqwest", "reth-chainspec", @@ -8791,7 +8788,6 @@ dependencies = [ "derive_more", "itertools 0.13.0", "metrics", - "once_cell", "proptest", "proptest-arbitrary-interop", "rayon", @@ -8851,7 +8847,6 @@ dependencies = [ "derive_more", "itertools 0.13.0", "metrics", - "once_cell", "proptest", "proptest-arbitrary-interop", "rayon", diff --git a/Cargo.toml b/Cargo.toml index 86b92cb7127a..ddb0e801ca95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace.package] version = "1.0.3" edition = "2021" -rust-version = "1.79" +rust-version = "1.80" license = "MIT OR Apache-2.0" homepage = "https://paradigmxyz.github.io/reth" repository = "https://github.com/paradigmxyz/reth" @@ -448,7 +448,7 @@ itertools = "0.13" linked_hash_set = "0.1" modular-bitfield = "0.11.2" nybbles = "0.2.1" -once_cell = "1.17" +once_cell = "1.19" parking_lot = "0.12" paste = "1.0" rand = "0.8.5" diff --git a/README.md b/README.md index ad98ba8529f3..1f1b73c633db 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ When updating this, also update: - .github/workflows/lint.yml --> -The Minimum Supported Rust Version (MSRV) of this project is [1.79.0](https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html). +The Minimum Supported Rust Version (MSRV) of this project is [1.80.0](https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html). See the book for detailed instructions on how to [build from source](https://paradigmxyz.github.io/reth/installation/source.html). diff --git a/clippy.toml b/clippy.toml index 865dfc7c95a5..a6afa98d99c0 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,2 +1,2 @@ -msrv = "1.79" +msrv = "1.80" too-large-for-stack = 128 diff --git a/crates/ethereum-forks/Cargo.toml b/crates/ethereum-forks/Cargo.toml index c0c0f83fe756..6398e3e260f6 100644 --- a/crates/ethereum-forks/Cargo.toml +++ b/crates/ethereum-forks/Cargo.toml @@ -16,6 +16,7 @@ workspace = true alloy-chains.workspace = true alloy-primitives = { workspace = true, features = ["serde", "rand", "rlp"] } alloy-rlp = { workspace = true, features = ["arrayvec", "derive"] } +once_cell.workspace = true # used for forkid crc = "3" @@ -23,7 +24,6 @@ crc = "3" # misc serde = { workspace = true, features = ["derive"], optional = true } thiserror-no-std = { workspace = true, default-features = false } -once_cell.workspace = true dyn-clone.workspace = true rustc-hash = { workspace = true, optional = true } diff --git a/crates/metrics/metrics-derive/Cargo.toml b/crates/metrics/metrics-derive/Cargo.toml index 732e3d543344..509dec73057c 100644 --- a/crates/metrics/metrics-derive/Cargo.toml +++ b/crates/metrics/metrics-derive/Cargo.toml @@ -18,7 +18,6 @@ proc-macro2.workspace = true syn = { workspace = true, features = ["extra-traits"] } quote.workspace = true regex = "1.6.0" -once_cell.workspace = true [dev-dependencies] metrics.workspace = true diff --git a/crates/metrics/metrics-derive/src/expand.rs b/crates/metrics/metrics-derive/src/expand.rs index ac0efd4f3e7a..430b86973fda 100644 --- a/crates/metrics/metrics-derive/src/expand.rs +++ b/crates/metrics/metrics-derive/src/expand.rs @@ -1,6 +1,6 @@ -use once_cell::sync::Lazy; use quote::{quote, ToTokens}; use regex::Regex; +use std::sync::LazyLock; use syn::{ punctuated::Punctuated, Attribute, Data, DeriveInput, Error, Expr, Field, Lit, LitBool, LitStr, Meta, MetaNameValue, Result, Token, @@ -11,8 +11,8 @@ use crate::{metric::Metric, with_attrs::WithAttrs}; /// Metric name regex according to Prometheus data model /// /// See -static METRIC_NAME_RE: Lazy = - Lazy::new(|| Regex::new(r"^[a-zA-Z_:.][a-zA-Z0-9_:.]*$").unwrap()); +static METRIC_NAME_RE: LazyLock = + LazyLock::new(|| Regex::new(r"^[a-zA-Z_:.][a-zA-Z0-9_:.]*$").unwrap()); /// Supported metrics separators const SUPPORTED_SEPARATORS: &[&str] = &[".", "_", ":"]; diff --git a/crates/metrics/metrics-derive/tests/metrics.rs b/crates/metrics/metrics-derive/tests/metrics.rs index d5ed81a73722..5c79b0a3d387 100644 --- a/crates/metrics/metrics-derive/tests/metrics.rs +++ b/crates/metrics/metrics-derive/tests/metrics.rs @@ -1,10 +1,12 @@ use metrics::{ Counter, Gauge, Histogram, Key, KeyName, Label, Metadata, Recorder, SharedString, Unit, }; -use once_cell::sync::Lazy; use reth_metrics_derive::Metrics; use serial_test::serial; -use std::{collections::HashMap, sync::Mutex}; +use std::{ + collections::HashMap, + sync::{LazyLock, Mutex}, +}; #[allow(dead_code)] #[derive(Metrics)] @@ -58,7 +60,7 @@ struct DynamicScopeMetrics { skipped_field_e: u128, } -static RECORDER: Lazy = Lazy::new(TestRecorder::new); +static RECORDER: LazyLock = LazyLock::new(TestRecorder::new); fn test_describe(scope: &str) { assert_eq!(RECORDER.metrics_len(), 4); diff --git a/crates/node/metrics/Cargo.toml b/crates/node/metrics/Cargo.toml index aaa2cb3fcd86..74333cf4fba9 100644 --- a/crates/node/metrics/Cargo.toml +++ b/crates/node/metrics/Cargo.toml @@ -20,8 +20,6 @@ metrics-util.workspace = true tokio.workspace = true -once_cell.workspace = true - jsonrpsee = { workspace = true, features = ["server"] } http.workspace = true tower.workspace = true diff --git a/crates/node/metrics/src/recorder.rs b/crates/node/metrics/src/recorder.rs index 05047992faae..a7421ab355c0 100644 --- a/crates/node/metrics/src/recorder.rs +++ b/crates/node/metrics/src/recorder.rs @@ -3,7 +3,7 @@ use eyre::WrapErr; use metrics_exporter_prometheus::{PrometheusBuilder, PrometheusHandle}; use metrics_util::layers::{PrefixLayer, Stack}; -use once_cell::sync::Lazy; +use std::sync::LazyLock; /// Installs the Prometheus recorder as the global recorder. pub fn install_prometheus_recorder() -> &'static PrometheusHandle { @@ -12,8 +12,8 @@ pub fn install_prometheus_recorder() -> &'static PrometheusHandle { /// The default Prometheus recorder handle. We use a global static to ensure that it is only /// installed once. -static PROMETHEUS_RECORDER_HANDLE: Lazy = - Lazy::new(|| PrometheusRecorder::install().unwrap()); +static PROMETHEUS_RECORDER_HANDLE: LazyLock = + LazyLock::new(|| PrometheusRecorder::install().unwrap()); /// Prometheus recorder installer #[derive(Debug)] diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 36329510c023..c14bb5a203a4 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -42,9 +42,9 @@ c-kzg = { workspace = true, features = ["serde"], optional = true } bytes.workspace = true derive_more.workspace = true modular-bitfield = { workspace = true, optional = true } -once_cell.workspace = true rayon.workspace = true serde.workspace = true +once_cell.workspace = true tempfile = { workspace = true, optional = true } thiserror-no-std = { workspace = true, default-features = false, optional = true } zstd = { workspace = true, features = ["experimental"], optional = true } diff --git a/crates/trie/db/Cargo.toml b/crates/trie/db/Cargo.toml index 8b7893a2fc1c..83ef66aabb35 100644 --- a/crates/trie/db/Cargo.toml +++ b/crates/trie/db/Cargo.toml @@ -68,7 +68,6 @@ tokio = { workspace = true, default-features = false, features = [ "macros", ] } tokio-stream.workspace = true -once_cell.workspace = true serde_json.workspace = true similar-asserts.workspace = true criterion.workspace = true diff --git a/crates/trie/db/tests/proof.rs b/crates/trie/db/tests/proof.rs index fbc40254bab7..e41ac2739af1 100644 --- a/crates/trie/db/tests/proof.rs +++ b/crates/trie/db/tests/proof.rs @@ -1,4 +1,3 @@ -use once_cell::sync::Lazy; use reth_chainspec::{Chain, ChainSpec, HOLESKY, MAINNET}; use reth_db_api::database::Database; use reth_primitives::{ @@ -11,7 +10,10 @@ use reth_storage_errors::provider::ProviderResult; use reth_trie::{proof::Proof, Nibbles, StateRoot}; use reth_trie_common::{AccountProof, StorageProof}; use reth_trie_db::{DatabaseProof, DatabaseStateRoot}; -use std::{str::FromStr, sync::Arc}; +use std::{ + str::FromStr, + sync::{Arc, LazyLock}, +}; /* World State (sampled from ) @@ -24,7 +26,7 @@ use std::{str::FromStr, sync::Arc}; All expected testspec results were obtained from querying proof RPC on the running geth instance `geth init crates/trie/testdata/proof-genesis.json && geth --http`. */ -static TEST_SPEC: Lazy> = Lazy::new(|| { +static TEST_SPEC: LazyLock> = LazyLock::new(|| { ChainSpec { chain: Chain::from_id(12345), genesis: serde_json::from_str(include_str!("../../trie/testdata/proof-genesis.json")) diff --git a/crates/trie/trie/Cargo.toml b/crates/trie/trie/Cargo.toml index f77a5d9712a9..54e7d6e9d2ac 100644 --- a/crates/trie/trie/Cargo.toml +++ b/crates/trie/trie/Cargo.toml @@ -62,7 +62,6 @@ tokio = { workspace = true, default-features = false, features = [ "macros", ] } tokio-stream.workspace = true -once_cell.workspace = true serde_json.workspace = true similar-asserts.workspace = true criterion.workspace = true diff --git a/examples/manual-p2p/Cargo.toml b/examples/manual-p2p/Cargo.toml index ca792a364bf4..2303bfbfeac6 100644 --- a/examples/manual-p2p/Cargo.toml +++ b/examples/manual-p2p/Cargo.toml @@ -20,4 +20,3 @@ futures.workspace = true tokio.workspace = true eyre.workspace = true -once_cell.workspace = true diff --git a/examples/manual-p2p/src/main.rs b/examples/manual-p2p/src/main.rs index c23802d26e51..edaaf8584897 100644 --- a/examples/manual-p2p/src/main.rs +++ b/examples/manual-p2p/src/main.rs @@ -9,7 +9,6 @@ use std::time::Duration; use futures::StreamExt; -use once_cell::sync::Lazy; use reth_chainspec::{Chain, MAINNET}; use reth_discv4::{DiscoveryUpdate, Discv4, Discv4ConfigBuilder, DEFAULT_DISCOVERY_ADDRESS}; use reth_ecies::stream::ECIESStream; @@ -20,12 +19,13 @@ use reth_network::config::rng_secret_key; use reth_network_peers::{mainnet_nodes, pk2id, NodeRecord}; use reth_primitives::{EthereumHardfork, Head, MAINNET_GENESIS_HASH}; use secp256k1::{SecretKey, SECP256K1}; +use std::sync::LazyLock; use tokio::net::TcpStream; type AuthedP2PStream = P2PStream>; type AuthedEthStream = EthStream>>; -pub static MAINNET_BOOT_NODES: Lazy> = Lazy::new(mainnet_nodes); +pub static MAINNET_BOOT_NODES: LazyLock> = LazyLock::new(mainnet_nodes); #[tokio::main] async fn main() -> eyre::Result<()> {