diff --git a/Cargo.lock b/Cargo.lock index 4d6f599a22f..69781d6c091 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3304,7 +3304,6 @@ dependencies = [ "eyre", "hex", "itertools 0.14.0", - "lazy_static", "local-ip-address", "rand 0.8.5", "rayon", @@ -3378,7 +3377,6 @@ dependencies = [ "hex", "hex-literal", "kzg-rs", - "lazy_static", "libc", "once_cell", "rayon", @@ -3471,7 +3469,6 @@ dependencies = [ "guest_program", "hex", "jsonwebtoken 9.3.1", - "lazy_static", "rand 0.8.5", "ratatui", "reqwest 0.12.24", @@ -3561,7 +3558,6 @@ dependencies = [ "hex", "k256", "lambdaworks-math 0.13.0", - "lazy_static", "malachite 0.6.1", "p256", "ripemd", @@ -3616,7 +3612,6 @@ dependencies = [ "hex-literal", "hmac", "indexmap 2.12.0", - "lazy_static", "prometheus 0.14.0", "rand 0.8.5", "rayon", @@ -3679,7 +3674,6 @@ dependencies = [ "ethereum-types 0.15.1", "hex", "hex-literal", - "lazy_static", "snap", "thiserror 2.0.17", "tinyvec", @@ -3741,7 +3735,6 @@ dependencies = [ "eyre", "hex", "itertools 0.13.0", - "lazy_static", "reqwest 0.12.24", "secp256k1", "serde", @@ -3832,7 +3825,6 @@ dependencies = [ "hasher", "hex", "hex-literal", - "lazy_static", "proptest", "rand 0.8.5", "rkyv", @@ -3860,7 +3852,6 @@ dependencies = [ "ethrex-levm", "ethrex-rlp", "ethrex-trie", - "lazy_static", "rkyv", "serde", "thiserror 2.0.17", diff --git a/Cargo.toml b/Cargo.toml index 2e55b2ebdb2..2558181eed9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,6 @@ thiserror = "2.0.9" hex = "0.4.3" hex-literal = "0.4.1" crc32fast = "1.4.2" -lazy_static = "1.5.0" sha2 = "0.10.8" tokio-util = { version = "0.7.15", features = ["rt"] } jsonwebtoken = "9.3.0" diff --git a/cmd/ethrex/Cargo.toml b/cmd/ethrex/Cargo.toml index 47b51f87129..d421c704b8e 100644 --- a/cmd/ethrex/Cargo.toml +++ b/cmd/ethrex/Cargo.toml @@ -46,7 +46,6 @@ rand = "0.8.5" rayon.workspace = true local-ip-address = "0.6" tokio-util.workspace = true -lazy_static.workspace = true secp256k1.workspace = true reqwest.workspace = true thiserror.workspace = true diff --git a/cmd/ethrex/l2/deployer.rs b/cmd/ethrex/l2/deployer.rs index 8bf30c6e4e2..1ca9011d5f7 100644 --- a/cmd/ethrex/l2/deployer.rs +++ b/cmd/ethrex/l2/deployer.rs @@ -4,6 +4,7 @@ use std::{ path::PathBuf, process::{Command, Stdio}, str::FromStr, + sync::LazyLock, }; use bytes::Bytes; @@ -568,9 +569,8 @@ pub async fn deploy_l1_contracts( Ok(contract_addresses) } -lazy_static::lazy_static! { - static ref SALT: std::sync::Mutex = std::sync::Mutex::new(H256::zero()); -} +static SALT: LazyLock> = + LazyLock::new(|| std::sync::Mutex::new(H256::zero())); async fn deploy_contracts( eth_client: &EthClient, diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 4854e6e774e..80b29cc9e35 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -26,7 +26,6 @@ libc = "0.2" crc32fast.workspace = true bytes.workspace = true hex.workspace = true -lazy_static.workspace = true rayon.workspace = true url.workspace = true rkyv.workspace = true diff --git a/crates/common/rlp/Cargo.toml b/crates/common/rlp/Cargo.toml index d1754a97d86..d75fa1a53fb 100644 --- a/crates/common/rlp/Cargo.toml +++ b/crates/common/rlp/Cargo.toml @@ -10,7 +10,6 @@ tinyvec = "1.6.0" thiserror.workspace = true bytes.workspace = true hex.workspace = true -lazy_static.workspace = true ethereum-types.workspace = true snap.workspace = true diff --git a/crates/common/trie/Cargo.toml b/crates/common/trie/Cargo.toml index 3542a75a0fe..4192c655462 100644 --- a/crates/common/trie/Cargo.toml +++ b/crates/common/trie/Cargo.toml @@ -21,7 +21,6 @@ serde_json = "1.0.117" rocksdb = { workspace = true, optional = true } smallvec = { version = "1.10.0", features = ["const_generics", "union"] } digest = "0.10.6" -lazy_static.workspace = true crossbeam.workspace = true rustc-hash.workspace = true rkyv.workspace = true diff --git a/crates/common/trie/trie.rs b/crates/common/trie/trie.rs index 1a62852c083..ab0bca60991 100644 --- a/crates/common/trie/trie.rs +++ b/crates/common/trie/trie.rs @@ -17,7 +17,7 @@ use ethrex_rlp::constants::RLP_NULL; use ethrex_rlp::encode::RLPEncode; use rustc_hash::FxHashSet; use std::collections::BTreeMap; -use std::sync::{Arc, Mutex}; +use std::sync::{Arc, LazyLock, Mutex}; pub use self::db::{InMemoryTrieDB, TrieDB}; pub use self::logger::{TrieLogger, TrieWitness}; @@ -32,14 +32,9 @@ pub use self::error::{ExtensionNodeErrorData, InconsistentTreeError, TrieError}; use self::{node::LeafNode, trie_iter::TrieIterator}; use ethrex_rlp::decode::RLPDecode; -use lazy_static::lazy_static; -lazy_static! { - // Hash value for an empty trie, equal to keccak(RLP_NULL) - pub static ref EMPTY_TRIE_HASH: H256 = H256( - keccak_hash([RLP_NULL]), - ); -} +// Hash value for an empty trie, equal to keccak(RLP_NULL) +pub static EMPTY_TRIE_HASH: LazyLock = LazyLock::new(|| H256(keccak_hash([RLP_NULL]))); /// RLP-encoded trie path pub type PathRLP = Vec; diff --git a/crates/common/types/genesis.rs b/crates/common/types/genesis.rs index 393c2302865..a8cba085e03 100644 --- a/crates/common/types/genesis.rs +++ b/crates/common/types/genesis.rs @@ -9,6 +9,7 @@ use std::{ collections::{BTreeMap, HashMap}, io::{BufReader, Error}, path::Path, + sync::LazyLock, }; use tracing::warn; @@ -266,18 +267,16 @@ pub struct ChainConfig { pub enable_verkle_at_genesis: bool, } -lazy_static::lazy_static! { - pub static ref NETWORK_NAMES: HashMap = { - HashMap::from([ - (1, "mainnet"), - (11155111, "sepolia"), - (17000, "holesky"), - (560048, "hoodi"), - (9, "L1 local devnet"), - (65536999, "L2 local devnet"), - ]) - }; -} +pub static NETWORK_NAMES: LazyLock> = LazyLock::new(|| { + HashMap::from([ + (1, "mainnet"), + (11155111, "sepolia"), + (17000, "holesky"), + (560048, "hoodi"), + (9, "L1 local devnet"), + (65536999, "L2 local devnet"), + ]) +}); #[repr(u8)] #[derive(Debug, PartialEq, Eq, PartialOrd, Default, Hash, Clone, Copy, Serialize, Deserialize)] diff --git a/crates/l2/Cargo.toml b/crates/l2/Cargo.toml index 9cb4375cae4..25f1de441bf 100644 --- a/crates/l2/Cargo.toml +++ b/crates/l2/Cargo.toml @@ -44,7 +44,6 @@ futures.workspace = true directories = "5.0.1" bincode = "1.3.3" serde_with.workspace = true -lazy_static.workspace = true aligned-sdk.workspace = true ethers = "2.0" chrono = "0.4.41" diff --git a/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock b/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock index 9bb35b34770..daad980af50 100644 --- a/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock +++ b/crates/l2/prover/src/guest_program/src/sp1/Cargo.lock @@ -957,7 +957,6 @@ dependencies = [ "ethrex-trie", "hex", "kzg-rs", - "lazy_static", "libc", "once_cell", "rayon", @@ -1020,7 +1019,6 @@ dependencies = [ "ethrex-rlp", "k256", "lambdaworks-math", - "lazy_static", "malachite", "p256", "ripemd", @@ -1053,7 +1051,6 @@ dependencies = [ "bytes", "ethereum-types", "hex", - "lazy_static", "snap", "thiserror", "tinyvec", @@ -1103,7 +1100,6 @@ dependencies = [ "ethrex-rlp", "ethrex-threadpool", "hex", - "lazy_static", "rkyv", "rustc-hash", "serde", @@ -1127,7 +1123,6 @@ dependencies = [ "ethrex-levm", "ethrex-rlp", "ethrex-trie", - "lazy_static", "rkyv", "serde", "thiserror", diff --git a/crates/l2/sdk/Cargo.toml b/crates/l2/sdk/Cargo.toml index 24460c22b24..cce4d2b51b0 100644 --- a/crates/l2/sdk/Cargo.toml +++ b/crates/l2/sdk/Cargo.toml @@ -25,7 +25,6 @@ ethrex-rlp.workspace = true bytes.workspace = true reqwest.workspace = true eyre.workspace = true -lazy_static.workspace = true [lib] name = "ethrex_l2_sdk" diff --git a/crates/networking/p2p/Cargo.toml b/crates/networking/p2p/Cargo.toml index a3ac7a756ca..3b91a312402 100644 --- a/crates/networking/p2p/Cargo.toml +++ b/crates/networking/p2p/Cargo.toml @@ -25,7 +25,6 @@ tokio-util = { workspace = true, features = ["codec", "net"] } bytes.workspace = true hex.workspace = true thiserror.workspace = true -lazy_static.workspace = true snap.workspace = true serde.workspace = true secp256k1.workspace = true diff --git a/crates/networking/p2p/snap.rs b/crates/networking/p2p/snap.rs index b5c73105173..c9d4f76e38e 100644 --- a/crates/networking/p2p/snap.rs +++ b/crates/networking/p2p/snap.rs @@ -189,25 +189,30 @@ mod tests { // Hive `AccounRange` Tests // Requests & invariantes taken from https://github.com/ethereum/go-ethereum/blob/3e567b8b2901611f004b5a6070a9b6d286be128d/cmd/devp2p/internal/ethtest/snap.go#L69 - use lazy_static::lazy_static; - - lazy_static! { - // Constant values for hive `AccountRange` tests - static ref HASH_MIN: H256 = H256::zero(); - static ref HASH_MAX: H256 = - H256::from_str("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",) - .unwrap(); - static ref HASH_FIRST: H256 = - H256::from_str("0x005e94bf632e80cde11add7d3447cd4ca93a5f2205d9874261484ae180718bd6") - .unwrap(); - static ref HASH_SECOND: H256 = - H256::from_str("0x00748bacab20da9ae19dd26a33bd10bbf825e28b3de84fc8fe1d15a21645067f") - .unwrap(); - static ref HASH_FIRST_MINUS_500: H256 = H256::from_uint(&((*HASH_FIRST).into_uint() - 500)); - static ref HASH_FIRST_MINUS_450: H256 = H256::from_uint(&((*HASH_FIRST).into_uint() - 450)); - static ref HASH_FIRST_MINUS_ONE: H256 = H256::from_uint(&((*HASH_FIRST).into_uint() - 1)); - static ref HASH_FIRST_PLUS_ONE: H256 = H256::from_uint(&((*HASH_FIRST).into_uint() + 1)); - } + use std::sync::LazyLock; + + // Constant values for hive `AccountRange` tests + static HASH_MIN: LazyLock = LazyLock::new(H256::zero); + static HASH_MAX: LazyLock = LazyLock::new(|| { + H256::from_str("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") + .unwrap() + }); + static HASH_FIRST: LazyLock = LazyLock::new(|| { + H256::from_str("0x005e94bf632e80cde11add7d3447cd4ca93a5f2205d9874261484ae180718bd6") + .unwrap() + }); + static HASH_SECOND: LazyLock = LazyLock::new(|| { + H256::from_str("0x00748bacab20da9ae19dd26a33bd10bbf825e28b3de84fc8fe1d15a21645067f") + .unwrap() + }); + static HASH_FIRST_MINUS_500: LazyLock = + LazyLock::new(|| H256::from_uint(&((*HASH_FIRST).into_uint() - 500))); + static HASH_FIRST_MINUS_450: LazyLock = + LazyLock::new(|| H256::from_uint(&((*HASH_FIRST).into_uint() - 450))); + static HASH_FIRST_MINUS_ONE: LazyLock = + LazyLock::new(|| H256::from_uint(&((*HASH_FIRST).into_uint() - 1))); + static HASH_FIRST_PLUS_ONE: LazyLock = + LazyLock::new(|| H256::from_uint(&((*HASH_FIRST).into_uint() + 1))); #[tokio::test] async fn hive_account_range_a() -> Result<(), StoreError> { diff --git a/crates/networking/p2p/sync.rs b/crates/networking/p2p/sync.rs index f7adcc900f7..caefb4d9af6 100644 --- a/crates/networking/p2p/sync.rs +++ b/crates/networking/p2p/sync.rs @@ -37,7 +37,7 @@ use std::{ cmp::min, collections::HashMap, sync::{ - Arc, + Arc, LazyLock, atomic::{AtomicBool, Ordering}, }, }; @@ -61,13 +61,16 @@ const BYTECODE_CHUNK_SIZE: usize = 50_000; const MISSING_SLOTS_PERCENTAGE: f64 = 0.8; #[cfg(feature = "sync-test")] -lazy_static::lazy_static! { - static ref EXECUTE_BATCH_SIZE: usize = std::env::var("EXECUTE_BATCH_SIZE").map(|var| var.parse().expect("Execute batch size environmental variable is not a number")).unwrap_or(EXECUTE_BATCH_SIZE_DEFAULT); -} +static EXECUTE_BATCH_SIZE: LazyLock = LazyLock::new(|| { + std::env::var("EXECUTE_BATCH_SIZE") + .map(|var| { + var.parse() + .expect("Execute batch size environmental variable is not a number") + }) + .unwrap_or(EXECUTE_BATCH_SIZE_DEFAULT) +}); #[cfg(not(feature = "sync-test"))] -lazy_static::lazy_static! { - static ref EXECUTE_BATCH_SIZE: usize = EXECUTE_BATCH_SIZE_DEFAULT; -} +static EXECUTE_BATCH_SIZE: LazyLock = LazyLock::new(|| EXECUTE_BATCH_SIZE_DEFAULT); #[derive(Debug, PartialEq, Clone, Default)] pub enum SyncMode { diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index 748f9680f69..e14c50f2bc8 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -15,7 +15,6 @@ ethrex-rlp.workspace = true derive_more = { version = "1.0.0", features = ["full"] } bytes.workspace = true thiserror.workspace = true -lazy_static.workspace = true tracing.workspace = true serde.workspace = true rkyv.workspace = true diff --git a/crates/vm/levm/Cargo.toml b/crates/vm/levm/Cargo.toml index 193686e7f93..97453c9d163 100644 --- a/crates/vm/levm/Cargo.toml +++ b/crates/vm/levm/Cargo.toml @@ -6,7 +6,6 @@ authors.workspace = true documentation.workspace = true [dependencies] -lazy_static.workspace = true ethrex-common.workspace = true ethrex-crypto.workspace = true ethrex-rlp.workspace = true diff --git a/crates/vm/levm/src/constants.rs b/crates/vm/levm/src/constants.rs index 6c0eafac08b..f4ae96ceb49 100644 --- a/crates/vm/levm/src/constants.rs +++ b/crates/vm/levm/src/constants.rs @@ -90,6 +90,6 @@ pub const P256_N: P256Uint = NistP256::ORDER; pub const P256_A: P256FieldElement = P256FieldElement::from_u64(3).neg(); pub const P256_B_UINT: P256Uint = P256Uint::from_be_hex("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"); -lazy_static::lazy_static! { - pub static ref P256_B: P256FieldElement = P256FieldElement::from_uint(P256_B_UINT).unwrap(); -} + +pub static P256_B: LazyLock = + LazyLock::new(|| P256FieldElement::from_uint(P256_B_UINT).unwrap()); diff --git a/tooling/Cargo.lock b/tooling/Cargo.lock index 3355bd940af..2388016707d 100644 --- a/tooling/Cargo.lock +++ b/tooling/Cargo.lock @@ -310,13 +310,12 @@ dependencies = [ "clap 4.5.51", "clap_complete", "ethrex", - "ethrex-common 6.0.0", - "ethrex-rlp 6.0.0", + "ethrex-common 7.0.0", + "ethrex-rlp 7.0.0", "ethrex-rpc", - "ethrex-storage 6.0.0", + "ethrex-storage 7.0.0", "eyre", "hex", - "lazy_static", "reqwest 0.12.24", "serde", "serde_json", @@ -2569,14 +2568,13 @@ dependencies = [ "bytes", "datatest-stable", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-prover", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", "ethrex-vm", "guest_program", "hex", - "lazy_static", "regex", "serde", "serde_json", @@ -2593,10 +2591,10 @@ dependencies = [ "clap_complete", "colored", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-levm", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", "ethrex-vm", "hex", "itertools 0.13.0", @@ -2621,11 +2619,11 @@ dependencies = [ "clap_complete", "colored", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-l2-rpc", "ethrex-levm", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", "ethrex-vm", "hex", "prettytable-rs", @@ -3168,7 +3166,7 @@ dependencies = [ [[package]] name = "ethrex" -version = "6.0.0" +version = "7.0.0" dependencies = [ "anyhow", "bytes", @@ -3176,7 +3174,7 @@ dependencies = [ "clap_complete", "directories", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-config", "ethrex-crypto", "ethrex-dev", @@ -3186,16 +3184,15 @@ dependencies = [ "ethrex-metrics", "ethrex-p2p", "ethrex-prover", - "ethrex-rlp 6.0.0", + "ethrex-rlp 7.0.0", "ethrex-rpc", "ethrex-sdk", - "ethrex-storage 6.0.0", + "ethrex-storage 7.0.0", "ethrex-storage-rollup", "ethrex-vm", "eyre", "hex", "itertools 0.14.0", - "lazy_static", "local-ip-address", "rand 0.8.5", "rayon", @@ -3218,15 +3215,15 @@ dependencies = [ [[package]] name = "ethrex-blockchain" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bytes", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", "ethrex-metrics", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", - "ethrex-trie 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", + "ethrex-trie 7.0.0", "ethrex-vm", "hex", "rustc-hash 2.1.1", @@ -3266,17 +3263,16 @@ dependencies = [ [[package]] name = "ethrex-common" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bytes", "crc32fast", "ethereum-types 0.15.1", "ethrex-crypto", - "ethrex-rlp 6.0.0", - "ethrex-trie 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-trie 7.0.0", "hex", "kzg-rs", - "lazy_static", "libc", "once_cell", "rayon", @@ -3294,9 +3290,9 @@ dependencies = [ [[package]] name = "ethrex-config" -version = "6.0.0" +version = "7.0.0" dependencies = [ - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-p2p", "hex", "serde", @@ -3305,7 +3301,7 @@ dependencies = [ [[package]] name = "ethrex-crypto" -version = "6.0.0" +version = "7.0.0" dependencies = [ "c-kzg", "kzg-rs", @@ -3315,7 +3311,7 @@ dependencies = [ [[package]] name = "ethrex-dev" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bytes", "envy", @@ -3334,7 +3330,7 @@ dependencies = [ [[package]] name = "ethrex-l2" -version = "6.0.0" +version = "7.0.0" dependencies = [ "aligned-sdk", "axum 0.8.6", @@ -3349,7 +3345,7 @@ dependencies = [ "ethereum-types 0.15.1", "ethers", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-config", "ethrex-dev", "ethrex-l2-common", @@ -3357,18 +3353,17 @@ dependencies = [ "ethrex-levm", "ethrex-metrics", "ethrex-p2p", - "ethrex-rlp 6.0.0", + "ethrex-rlp 7.0.0", "ethrex-rpc", "ethrex-sdk", - "ethrex-storage 6.0.0", + "ethrex-storage 7.0.0", "ethrex-storage-rollup", - "ethrex-trie 6.0.0", + "ethrex-trie 7.0.0", "ethrex-vm", "futures", "guest_program", "hex", "jsonwebtoken 9.3.1", - "lazy_static", "rand 0.8.5", "ratatui", "reqwest 0.12.24", @@ -3391,15 +3386,15 @@ dependencies = [ [[package]] name = "ethrex-l2-common" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bytes", "ethereum-types 0.15.1", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", - "ethrex-trie 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", + "ethrex-trie 7.0.0", "ethrex-vm", "hex", "lambdaworks-crypto 0.13.0", @@ -3412,18 +3407,18 @@ dependencies = [ [[package]] name = "ethrex-l2-rpc" -version = "6.0.0" +version = "7.0.0" dependencies = [ "axum 0.8.6", "bytes", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-l2-common", "ethrex-p2p", - "ethrex-rlp 6.0.0", + "ethrex-rlp 7.0.0", "ethrex-rpc", - "ethrex-storage 6.0.0", + "ethrex-storage 7.0.0", "ethrex-storage-rollup", "hex", "reqwest 0.12.24", @@ -3441,7 +3436,7 @@ dependencies = [ [[package]] name = "ethrex-levm" -version = "6.0.0" +version = "7.0.0" dependencies = [ "ark-bn254", "ark-ec", @@ -3451,12 +3446,11 @@ dependencies = [ "bytes", "datatest-stable", "derive_more 1.0.0", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", - "ethrex-rlp 6.0.0", + "ethrex-rlp 7.0.0", "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "lambdaworks-math 0.13.0", - "lazy_static", "malachite", "p256", "ripemd", @@ -3472,10 +3466,10 @@ dependencies = [ [[package]] name = "ethrex-metrics" -version = "6.0.0" +version = "7.0.0" dependencies = [ "axum 0.8.6", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "prometheus 0.13.4", "serde", "serde_json", @@ -3487,7 +3481,7 @@ dependencies = [ [[package]] name = "ethrex-p2p" -version = "6.0.0" +version = "7.0.0" dependencies = [ "aes", "async-trait", @@ -3497,18 +3491,17 @@ dependencies = [ "ctr", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", "ethrex-storage-rollup", "ethrex-threadpool", - "ethrex-trie 6.0.0", + "ethrex-trie 7.0.0", "futures", "hex", "hmac", "indexmap 2.12.0", - "lazy_static", "prometheus 0.14.0", "rand 0.8.5", "rayon", @@ -3529,7 +3522,7 @@ dependencies = [ [[package]] name = "ethrex-prover" -version = "6.0.0" +version = "7.0.0" dependencies = [ "anyhow", "bincode", @@ -3537,12 +3530,12 @@ dependencies = [ "clap 4.5.51", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-l2", "ethrex-l2-common", - "ethrex-rlp 6.0.0", + "ethrex-rlp 7.0.0", "ethrex-sdk", - "ethrex-storage 6.0.0", + "ethrex-storage 7.0.0", "ethrex-vm", "guest_program", "hex", @@ -3576,12 +3569,11 @@ dependencies = [ [[package]] name = "ethrex-rlp" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bytes", "ethereum-types 0.15.1", "hex", - "lazy_static", "snap", "thiserror 2.0.17", "tinyvec", @@ -3589,7 +3581,7 @@ dependencies = [ [[package]] name = "ethrex-rpc" -version = "6.0.0" +version = "7.0.0" dependencies = [ "axum 0.8.6", "axum-extra", @@ -3597,12 +3589,13 @@ dependencies = [ "envy", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", + "ethrex-metrics", "ethrex-p2p", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", - "ethrex-trie 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", + "ethrex-trie 7.0.0", "ethrex-vm", "hex", "hex-literal", @@ -3626,20 +3619,19 @@ dependencies = [ [[package]] name = "ethrex-sdk" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bytes", "ethereum-types 0.15.1", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-l2-common", "ethrex-l2-rpc", - "ethrex-rlp 6.0.0", + "ethrex-rlp 7.0.0", "ethrex-rpc", "ethrex-sdk-contract-utils", "eyre", "hex", "itertools 0.13.0", - "lazy_static", "reqwest 0.12.24", "secp256k1 0.30.0", "serde", @@ -3651,7 +3643,7 @@ dependencies = [ [[package]] name = "ethrex-sdk-contract-utils" -version = "6.0.0" +version = "7.0.0" dependencies = [ "thiserror 2.0.17", "tracing", @@ -3682,18 +3674,19 @@ dependencies = [ [[package]] name = "ethrex-storage" -version = "6.0.0" +version = "7.0.0" dependencies = [ "anyhow", "async-trait", "bincode", "bytes", "ethereum-types 0.15.1", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", - "ethrex-rlp 6.0.0", - "ethrex-trie 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-trie 7.0.0", "hex", + "lru 0.16.2", "qfilter", "rayon", "rocksdb", @@ -3707,17 +3700,17 @@ dependencies = [ [[package]] name = "ethrex-storage-rollup" -version = "6.0.0" +version = "7.0.0" dependencies = [ "anyhow", "async-trait", "bincode", "ethereum-types 0.15.1", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-l2-common", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", - "ethrex-trie 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", + "ethrex-trie 7.0.0", "futures", "rkyv", "thiserror 2.0.17", @@ -3754,7 +3747,7 @@ dependencies = [ [[package]] name = "ethrex-trie" -version = "6.0.0" +version = "7.0.0" dependencies = [ "anyhow", "bytes", @@ -3762,10 +3755,9 @@ dependencies = [ "digest 0.10.7", "ethereum-types 0.15.1", "ethrex-crypto", - "ethrex-rlp 6.0.0", + "ethrex-rlp 7.0.0", "ethrex-threadpool", "hex", - "lazy_static", "rkyv", "rocksdb", "rustc-hash 2.1.1", @@ -3778,20 +3770,18 @@ dependencies = [ [[package]] name = "ethrex-vm" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bincode", "bytes", "derive_more 1.0.0", "dyn-clone", "ethereum-types 0.15.1", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", "ethrex-levm", - "ethrex-rlp 6.0.0", - "ethrex-trie 6.0.0", - "hex", - "lazy_static", + "ethrex-rlp 7.0.0", + "ethrex-trie 7.0.0", "rkyv", "serde", "thiserror 2.0.17", @@ -4302,16 +4292,16 @@ dependencies = [ [[package]] name = "guest_program" -version = "6.0.0" +version = "7.0.0" dependencies = [ "bytes", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-crypto", "ethrex-l2-common", - "ethrex-rlp 6.0.0", - "ethrex-storage 6.0.0", - "ethrex-trie 6.0.0", + "ethrex-rlp 7.0.0", + "ethrex-storage 7.0.0", + "ethrex-trie 7.0.0", "ethrex-vm", "hex", "rkyv", @@ -4439,6 +4429,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" dependencies = [ + "allocator-api2", + "equivalent", "foldhash 0.2.0", "serde", ] @@ -5454,6 +5446,7 @@ dependencies = [ "cc", "libc", "libz-sys", + "lz4-sys", ] [[package]] @@ -5557,7 +5550,7 @@ dependencies = [ "clap 4.5.51", "ethereum-types 0.15.1", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-l2-common", "ethrex-l2-rpc", "ethrex-rpc", @@ -5620,12 +5613,31 @@ dependencies = [ "hashbrown 0.15.5", ] +[[package]] +name = "lru" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f" +dependencies = [ + "hashbrown 0.16.0", +] + [[package]] name = "lru-slab" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" +[[package]] +name = "lz4-sys" +version = "1.11.1+lz4-1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "malachite" version = "0.6.1" @@ -5757,9 +5769,9 @@ dependencies = [ "clap 4.5.51", "ethrex-blockchain", "ethrex-common 1.0.0", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-storage 1.0.0", - "ethrex-storage 6.0.0", + "ethrex-storage 7.0.0", "tokio", ] @@ -7336,7 +7348,7 @@ dependencies = [ "indoc", "instability", "itertools 0.13.0", - "lru", + "lru 0.12.5", "paste", "strum 0.26.3", "unicode-segmentation", @@ -7466,7 +7478,7 @@ version = "4.0.0" dependencies = [ "ethrex", "ethrex-blockchain", - "ethrex-common 6.0.0", + "ethrex-common 7.0.0", "ethrex-config", "ethrex-l2-common", "ethrex-l2-rpc", @@ -9027,7 +9039,7 @@ dependencies = [ "hashbrown 0.14.5", "hex", "itertools 0.13.0", - "lru", + "lru 0.12.5", "num-bigint 0.4.6", "p3-baby-bear", "p3-bn254-fr", diff --git a/tooling/Cargo.toml b/tooling/Cargo.toml index 580ab52dd9b..96c619b145c 100644 --- a/tooling/Cargo.toml +++ b/tooling/Cargo.toml @@ -54,7 +54,6 @@ thiserror = "2.0.9" hex = "0.4.3" hex-literal = "0.4.1" crc32fast = "1.4.2" -lazy_static = "1.5.0" sha2 = "0.10.8" tokio-util = { version = "0.7.15", features = ["rt"] } jsonwebtoken = "9.3.0" diff --git a/tooling/archive_sync/Cargo.toml b/tooling/archive_sync/Cargo.toml index 0f5c63e2cff..2070ea67704 100644 --- a/tooling/archive_sync/Cargo.toml +++ b/tooling/archive_sync/Cargo.toml @@ -6,7 +6,6 @@ authors.workspace = true documentation.workspace = true [dependencies] -lazy_static.workspace = true ethrex-common.workspace = true ethrex-storage.workspace = true ethrex-rlp.workspace = true diff --git a/tooling/archive_sync/src/main.rs b/tooling/archive_sync/src/main.rs index 4ff5318d6fa..2b7ff8304c7 100644 --- a/tooling/archive_sync/src/main.rs +++ b/tooling/archive_sync/src/main.rs @@ -1,7 +1,3 @@ -lazy_static::lazy_static! { - static ref CLIENT: reqwest::Client = reqwest::Client::new(); -} - use clap::{ArgGroup, Parser}; use ethrex::initializers::open_store; use ethrex::utils::{default_datadir, init_datadir}; diff --git a/tooling/ef_tests/blockchain/Cargo.toml b/tooling/ef_tests/blockchain/Cargo.toml index e0151c35cae..b3da85db874 100644 --- a/tooling/ef_tests/blockchain/Cargo.toml +++ b/tooling/ef_tests/blockchain/Cargo.toml @@ -18,7 +18,6 @@ serde.workspace = true serde_json.workspace = true bytes.workspace = true hex.workspace = true -lazy_static.workspace = true tokio = { workspace = true, features = ["full"] } datatest-stable = "0.2.9" regex = "1.11.1" diff --git a/tooling/ef_tests/blockchain/fork.rs b/tooling/ef_tests/blockchain/fork.rs index 1b93f1f0d8b..939e713a9ea 100644 --- a/tooling/ef_tests/blockchain/fork.rs +++ b/tooling/ef_tests/blockchain/fork.rs @@ -1,98 +1,97 @@ use ethrex_common::{H160, types::ChainConfig}; -use lazy_static::lazy_static; use serde::Deserialize; use std::str::FromStr; +use std::sync::LazyLock; // Chain config for different forks as defined on https://ethereum.github.io/execution-spec-tests/v3.0.0/consuming_tests/common_types/#fork -lazy_static! { - pub static ref MERGE_CONFIG: ChainConfig = ChainConfig { - chain_id: 1_u64, - homestead_block: Some(0), - dao_fork_block: Some(0), - dao_fork_support: true, - eip150_block: Some(0), - eip155_block: Some(0), - eip158_block: Some(0), - byzantium_block: Some(0), - constantinople_block: Some(0), - petersburg_block: Some(0), - istanbul_block: Some(0), - muir_glacier_block: Some(0), - berlin_block: Some(0), - london_block: Some(0), - arrow_glacier_block: Some(0), - gray_glacier_block: Some(0), - merge_netsplit_block: Some(0), - terminal_total_difficulty: Some(0), - ..Default::default() - }; - pub static ref MERGE_TO_SHANGHAI_AT_15K_CONFIG: ChainConfig = ChainConfig { - shanghai_time: Some(0x3a98), - ..*MERGE_CONFIG - }; - pub static ref SHANGHAI_CONFIG: ChainConfig = ChainConfig { - shanghai_time: Some(0), - ..*MERGE_CONFIG - }; - pub static ref SHANGHAI_TO_CANCUN_AT_15K_CONFIG: ChainConfig = ChainConfig { +pub static MERGE_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + chain_id: 1_u64, + homestead_block: Some(0), + dao_fork_block: Some(0), + dao_fork_support: true, + eip150_block: Some(0), + eip155_block: Some(0), + eip158_block: Some(0), + byzantium_block: Some(0), + constantinople_block: Some(0), + petersburg_block: Some(0), + istanbul_block: Some(0), + muir_glacier_block: Some(0), + berlin_block: Some(0), + london_block: Some(0), + arrow_glacier_block: Some(0), + gray_glacier_block: Some(0), + merge_netsplit_block: Some(0), + terminal_total_difficulty: Some(0), + ..Default::default() +}); +pub static MERGE_TO_SHANGHAI_AT_15K_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + shanghai_time: Some(0x3a98), + ..*MERGE_CONFIG +}); +pub static SHANGHAI_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + shanghai_time: Some(0), + ..*MERGE_CONFIG +}); +pub static SHANGHAI_TO_CANCUN_AT_15K_CONFIG: LazyLock = + LazyLock::new(|| ChainConfig { cancun_time: Some(0x3a98), ..*SHANGHAI_CONFIG - }; - pub static ref CANCUN_CONFIG: ChainConfig = ChainConfig { - cancun_time: Some(0), - ..*SHANGHAI_CONFIG - }; - pub static ref CANCUN_TO_PRAGUE_AT_15K_CONFIG: ChainConfig = ChainConfig { + }); +pub static CANCUN_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + cancun_time: Some(0), + ..*SHANGHAI_CONFIG +}); +pub static CANCUN_TO_PRAGUE_AT_15K_CONFIG: LazyLock = LazyLock::new(|| { + ChainConfig { prague_time: Some(0x3a98), // Mainnet address deposit_contract_address: H160::from_str("0x00000000219ab540356cbb839cbe05303d7705fa") .unwrap(), ..*CANCUN_CONFIG - }; - pub static ref PRAGUE_CONFIG: ChainConfig = ChainConfig { - prague_time: Some(0), - ..*CANCUN_TO_PRAGUE_AT_15K_CONFIG - }; - - pub static ref PRAGUE_TO_OSAKA_AT_15K_CONFIG: ChainConfig = ChainConfig { - osaka_time: Some(0x3a98), - ..*PRAGUE_CONFIG - - }; + } +}); +pub static PRAGUE_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + prague_time: Some(0), + ..*CANCUN_TO_PRAGUE_AT_15K_CONFIG +}); - pub static ref OSAKA_CONFIG: ChainConfig = ChainConfig { - osaka_time: Some(0), - ..*PRAGUE_CONFIG - }; +pub static PRAGUE_TO_OSAKA_AT_15K_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + osaka_time: Some(0x3a98), + ..*PRAGUE_CONFIG +}); - pub static ref OSAKA_TO_BPO1_AT_15K_CONFIG: ChainConfig = ChainConfig { - bpo1_time: Some(0x3a98), - ..*OSAKA_CONFIG - }; +pub static OSAKA_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + osaka_time: Some(0), + ..*PRAGUE_CONFIG +}); - pub static ref BPO1_TO_BPO2_AT_15K_CONFIG: ChainConfig = ChainConfig { - bpo1_time: Some(0), - bpo2_time: Some(0x3a98), - ..*OSAKA_CONFIG - }; +pub static OSAKA_TO_BPO1_AT_15K_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + bpo1_time: Some(0x3a98), + ..*OSAKA_CONFIG +}); - pub static ref BPO2_TO_BPO3_AT_15K_CONFIG: ChainConfig = ChainConfig { - bpo2_time: Some(0), - bpo3_time: Some(0x3a98), - ..*OSAKA_CONFIG - }; - pub static ref BPO3_TO_BPO4_AT_15K_CONFIG: ChainConfig = ChainConfig { - bpo3_time: Some(0), - bpo4_time: Some(0x3a98), - ..*OSAKA_CONFIG - }; - pub static ref BPO4_TO_BPO5_AT_15K_CONFIG: ChainConfig = ChainConfig { - bpo4_time: Some(0), - bpo5_time: Some(0x3a98), - ..*OSAKA_CONFIG - }; +pub static BPO1_TO_BPO2_AT_15K_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + bpo1_time: Some(0), + bpo2_time: Some(0x3a98), + ..*OSAKA_CONFIG +}); -} +pub static BPO2_TO_BPO3_AT_15K_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + bpo2_time: Some(0), + bpo3_time: Some(0x3a98), + ..*OSAKA_CONFIG +}); +pub static BPO3_TO_BPO4_AT_15K_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + bpo3_time: Some(0), + bpo4_time: Some(0x3a98), + ..*OSAKA_CONFIG +}); +pub static BPO4_TO_BPO5_AT_15K_CONFIG: LazyLock = LazyLock::new(|| ChainConfig { + bpo4_time: Some(0), + bpo5_time: Some(0x3a98), + ..*OSAKA_CONFIG +}); /// Most of the fork variants are just for parsing the tests /// It's important for the pre-merge forks to be before Paris because we make a comparison for executing post-merge forks only.