diff --git a/Cargo.lock b/Cargo.lock index 2559a1f08..522729f89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -532,7 +532,6 @@ dependencies = [ "humantime", "hyper 0.14.30", "ibc-types", - "once_cell", "pin-project-lite", "prost", "reqwest", @@ -606,7 +605,6 @@ dependencies = [ "hyper 0.14.30", "insta", "itertools 0.12.1", - "once_cell", "pin-project-lite", "prost", "rand 0.8.5", @@ -660,7 +658,6 @@ dependencies = [ "itoa", "jsonrpsee", "moka", - "once_cell", "pbjson-types", "pin-project-lite", "prost", @@ -688,7 +685,6 @@ version = "0.1.0" dependencies = [ "figment", "names", - "once_cell", "regex", "serde", ] @@ -890,7 +886,6 @@ dependencies = [ "itertools 0.12.1", "itoa", "k256", - "once_cell", "pbjson-types", "pin-project-lite", "prost", diff --git a/Cargo.toml b/Cargo.toml index 649ba90f0..5225f0842 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,6 @@ insta = "1.36.1" itertools = "0.12.1" itoa = "1.0.10" jsonrpsee = { version = "0.20" } -once_cell = "1.17.1" pbjson-types = "0.6" # Note that when updating the penumbra versions, vendored types in `proto/sequencerapis/astria_vendored` may need to be updated as well. # can update to a tagged release when https://github.com/penumbra-zone/penumbra/pull/4822 is included diff --git a/crates/astria-bridge-withdrawer/Cargo.toml b/crates/astria-bridge-withdrawer/Cargo.toml index b3b6c5351..b54d61c6f 100644 --- a/crates/astria-bridge-withdrawer/Cargo.toml +++ b/crates/astria-bridge-withdrawer/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-bridge-withdrawer" version = "0.3.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" @@ -21,7 +21,6 @@ ethers = { workspace = true, features = ["ws"] } hyper = { workspace = true } humantime = { workspace = true } ibc-types = { workspace = true } -once_cell = { workspace = true } pin-project-lite = { workspace = true } prost = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/crates/astria-bridge-withdrawer/tests/blackbox/helpers/test_bridge_withdrawer.rs b/crates/astria-bridge-withdrawer/tests/blackbox/helpers/test_bridge_withdrawer.rs index 3b2a8a33e..dbb8a53b1 100644 --- a/crates/astria-bridge-withdrawer/tests/blackbox/helpers/test_bridge_withdrawer.rs +++ b/crates/astria-bridge-withdrawer/tests/blackbox/helpers/test_bridge_withdrawer.rs @@ -2,6 +2,7 @@ use std::{ io::Write as _, mem, net::SocketAddr, + sync::LazyLock, time::Duration, }; @@ -37,7 +38,6 @@ use ibc_types::core::{ channel::ChannelId, client::Height as IbcHeight, }; -use once_cell::sync::Lazy; use sequencer_client::{ Address, NonceResponse, @@ -74,7 +74,7 @@ pub(crate) const DEFAULT_IBC_DENOM: &str = "transfer/channel-0/utia"; pub(crate) const SEQUENCER_CHAIN_ID: &str = "test-sequencer"; const ASTRIA_ADDRESS_PREFIX: &str = "astria"; -static TELEMETRY: Lazy<()> = Lazy::new(|| { +static TELEMETRY: LazyLock<()> = LazyLock::new(|| { if std::env::var_os("TEST_LOG").is_some() { let filter_directives = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".into()); telemetry::configure() @@ -251,7 +251,7 @@ impl TestBridgeWithdrawerConfig { ethereum_config, asset_denom, } = self; - Lazy::force(&TELEMETRY); + LazyLock::force(&TELEMETRY); // sequencer signer key let keyfile = NamedTempFile::new().unwrap(); diff --git a/crates/astria-cli/Cargo.toml b/crates/astria-cli/Cargo.toml index 107b3f576..0886cb5c5 100644 --- a/crates/astria-cli/Cargo.toml +++ b/crates/astria-cli/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-cli" version = "0.4.1" edition = "2021" -rust-version = "1.74.1" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-composer/Cargo.toml b/crates/astria-composer/Cargo.toml index 28fc349e7..c17567aaa 100644 --- a/crates/astria-composer/Cargo.toml +++ b/crates/astria-composer/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-composer" version = "0.8.3" edition = "2021" -rust-version = "1.76" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" @@ -30,7 +30,6 @@ humantime = { workspace = true } hyper = { workspace = true } hex = { workspace = true } itertools = { workspace = true } -once_cell = { workspace = true } pin-project-lite = { workspace = true } prost = { workspace = true } reqwest = { workspace = true, features = ["json"] } diff --git a/crates/astria-composer/src/executor/tests.rs b/crates/astria-composer/src/executor/tests.rs index bb0e4af53..bf0f8d9ee 100644 --- a/crates/astria-composer/src/executor/tests.rs +++ b/crates/astria-composer/src/executor/tests.rs @@ -4,6 +4,7 @@ use std::{ IpAddr, SocketAddr, }, + sync::LazyLock, time::Duration, }; @@ -20,7 +21,6 @@ use astria_core::{ protocol::transaction::v1alpha1::action::SequenceAction, }; use astria_eyre::eyre; -use once_cell::sync::Lazy; use prost::{ bytes::Bytes, Message as _, @@ -72,7 +72,7 @@ use crate::{ Config, }; -static TELEMETRY: Lazy<()> = Lazy::new(|| { +static TELEMETRY: LazyLock<()> = LazyLock::new(|| { // This config can be meaningless - it's only used inside `try_init` to init the metrics, but we // haven't configured telemetry to provide metrics here. let config = Config { @@ -121,7 +121,7 @@ fn sequence_action() -> SequenceAction { /// Start a mock sequencer server and mount a mock for the `accounts/nonce` query. async fn setup() -> (MockServer, Config, NamedTempFile) { - Lazy::force(&TELEMETRY); + LazyLock::force(&TELEMETRY); let server = MockServer::start().await; let keyfile = NamedTempFile::new().unwrap(); diff --git a/crates/astria-composer/src/rollup.rs b/crates/astria-composer/src/rollup.rs index 310fcb98b..962e237f5 100644 --- a/crates/astria-composer/src/rollup.rs +++ b/crates/astria-composer/src/rollup.rs @@ -1,8 +1,10 @@ //! Parsing strings of the form `::` -use std::fmt; +use std::{ + fmt, + sync::LazyLock, +}; -use once_cell::sync::Lazy; use regex::Regex; #[derive(Debug)] @@ -33,7 +35,7 @@ impl std::error::Error for ParseError {} impl Rollup { pub(super) fn parse(from: &str) -> Result { - static ROLLUP_RE: Lazy = Lazy::new(|| { + static ROLLUP_RE: LazyLock = LazyLock::new(|| { Regex::new( r"(?x) ^(?P[[:alnum:]-]+?) diff --git a/crates/astria-composer/tests/blackbox/helper/mod.rs b/crates/astria-composer/tests/blackbox/helper/mod.rs index 8b564b300..ecd509044 100644 --- a/crates/astria-composer/tests/blackbox/helper/mod.rs +++ b/crates/astria-composer/tests/blackbox/helper/mod.rs @@ -5,6 +5,7 @@ use std::{ IpAddr, SocketAddr, }, + sync::LazyLock, time::Duration, }; @@ -28,7 +29,6 @@ use astria_core::{ }; use astria_eyre::eyre; use ethers::prelude::Transaction; -use once_cell::sync::Lazy; use telemetry::metrics; use tempfile::NamedTempFile; use tendermint_rpc::{ @@ -50,7 +50,7 @@ use wiremock::{ pub mod mock_sequencer; -static TELEMETRY: Lazy<()> = Lazy::new(|| { +static TELEMETRY: LazyLock<()> = LazyLock::new(|| { // This config can be meaningless - it's only used inside `try_init` to init the metrics, but we // haven't configured telemetry to provide metrics here. let config = Config { @@ -107,7 +107,7 @@ pub struct TestComposer { /// There is no explicit error handling in favour of panicking loudly /// and early. pub async fn spawn_composer(rollup_ids: &[&str]) -> TestComposer { - Lazy::force(&TELEMETRY); + LazyLock::force(&TELEMETRY); let mut rollup_nodes = HashMap::new(); let mut rollups = String::new(); diff --git a/crates/astria-conductor/Cargo.toml b/crates/astria-conductor/Cargo.toml index 602536a60..bb2cbc7a0 100644 --- a/crates/astria-conductor/Cargo.toml +++ b/crates/astria-conductor/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-conductor" version = "0.20.1" edition = "2021" -rust-version = "1.76" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" @@ -83,7 +83,6 @@ config = { package = "astria-config", path = "../astria-config", features = [ celestia-tendermint = { workspace = true } insta = { workspace = true, features = ["json"] } -once_cell = { workspace = true } wiremock = { workspace = true } chrono = "0.4.35" diff --git a/crates/astria-conductor/tests/blackbox/helpers/mod.rs b/crates/astria-conductor/tests/blackbox/helpers/mod.rs index 4cf983517..04d1c6aee 100644 --- a/crates/astria-conductor/tests/blackbox/helpers/mod.rs +++ b/crates/astria-conductor/tests/blackbox/helpers/mod.rs @@ -1,4 +1,7 @@ -use std::time::Duration; +use std::{ + sync::LazyLock, + time::Duration, +}; use astria_conductor::{ conductor, @@ -25,7 +28,6 @@ use celestia_types::{ nmt::Namespace, Blob, }; -use once_cell::sync::Lazy; use prost::Message; use sequencer_client::{ tendermint, @@ -52,7 +54,7 @@ pub const SEQUENCER_CHAIN_ID: &str = "test_sequencer-1000"; pub const INITIAL_SOFT_HASH: [u8; 64] = [1; 64]; pub const INITIAL_FIRM_HASH: [u8; 64] = [1; 64]; -static TELEMETRY: Lazy<()> = Lazy::new(|| { +static TELEMETRY: LazyLock<()> = LazyLock::new(|| { astria_eyre::install().unwrap(); if std::env::var_os("TEST_LOG").is_some() { let filter_directives = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".into()); @@ -82,7 +84,7 @@ pub async fn spawn_conductor(execution_commit_level: CommitLevel) -> TestConduct environment does not stall the runtime: the test could be configured using \ `#[tokio::test(flavor = \"multi_thread\", worker_threads = 1)]`" ); - Lazy::force(&TELEMETRY); + LazyLock::force(&TELEMETRY); let mock_grpc = MockGrpc::spawn().await; let mock_http = wiremock::MockServer::start().await; diff --git a/crates/astria-config/Cargo.toml b/crates/astria-config/Cargo.toml index 89a476cf3..6672b7528 100644 --- a/crates/astria-config/Cargo.toml +++ b/crates/astria-config/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-config" version = "0.1.0" edition = "2021" -rust-version = "1.71.1" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" @@ -14,7 +14,6 @@ homepage = "https://astria.org" figment = { version = "0.10.8", features = ["env"] } names = { version = "0.14", optional = true, default-features = false } -once_cell = { workspace = true, optional = true } regex = { workspace = true, optional = true } serde = { workspace = true } @@ -22,4 +21,4 @@ serde = { workspace = true } serde = { workspace = true, features = ["derive"] } [features] -tests = ["figment/test", "dep:names", "dep:once_cell", "dep:regex"] +tests = ["figment/test", "dep:names", "dep:regex"] diff --git a/crates/astria-config/src/tests.rs b/crates/astria-config/src/tests.rs index 6411f4881..4165d98ce 100644 --- a/crates/astria-config/src/tests.rs +++ b/crates/astria-config/src/tests.rs @@ -29,8 +29,9 @@ //! } //! ``` +use std::sync::LazyLock; + use figment::Jail; -use once_cell::sync::Lazy; use regex::Regex; use crate::{ @@ -38,7 +39,7 @@ use crate::{ _internal, }; -static TEST_PREFIX: Lazy = Lazy::new(|| { +static TEST_PREFIX: LazyLock = LazyLock::new(|| { use names::{ Generator, Name, @@ -47,8 +48,8 @@ static TEST_PREFIX: Lazy = Lazy::new(|| { }); fn populate_environment_from_example(jail: &mut Jail, unique_test_prefix: &str, example_env: &str) { - static RE_START: Lazy = Lazy::new(|| Regex::new(r"^[[:space:]]+").unwrap()); - static RE_END: Lazy = Lazy::new(|| Regex::new(r"[[:space:]]+$").unwrap()); + static RE_START: LazyLock = LazyLock::new(|| Regex::new(r"^[[:space:]]+").unwrap()); + static RE_END: LazyLock = LazyLock::new(|| Regex::new(r"[[:space:]]+$").unwrap()); for line in example_env.lines() { if let Some((key, val)) = line.trim().split_once('=') { @@ -71,7 +72,7 @@ fn populate_environment_from_example(jail: &mut Jail, unique_test_prefix: &str, /// Panics if a config `C` could not be created from `example_env`. #[track_caller] pub fn example_env_config_is_up_to_date(example_env: &str) { - let unique_test_prefix = Lazy::force(&TEST_PREFIX); + let unique_test_prefix = LazyLock::force(&TEST_PREFIX); let full_test_prefix = format!("{unique_test_prefix}_{}", C::PREFIX); Jail::expect_with(|jail| { diff --git a/crates/astria-core/Cargo.toml b/crates/astria-core/Cargo.toml index 3c40345d5..cd08623c1 100644 --- a/crates/astria-core/Cargo.toml +++ b/crates/astria-core/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-core" version = "0.1.0" edition = "2021" -rust-version = "1.76" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-merkle/Cargo.toml b/crates/astria-merkle/Cargo.toml index 922689da4..9f2a4c4b5 100644 --- a/crates/astria-merkle/Cargo.toml +++ b/crates/astria-merkle/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-merkle" version = "0.1.0" edition = "2021" -rust-version = "1.71.1" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-client/Cargo.toml b/crates/astria-sequencer-client/Cargo.toml index 5921d6a28..1fa879ff1 100644 --- a/crates/astria-sequencer-client/Cargo.toml +++ b/crates/astria-sequencer-client/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-client" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.76" +rust-version = "1.81.0" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-relayer/Cargo.toml b/crates/astria-sequencer-relayer/Cargo.toml index a2fcb71fb..2e4a8f5e5 100644 --- a/crates/astria-sequencer-relayer/Cargo.toml +++ b/crates/astria-sequencer-relayer/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-relayer" version = "0.16.2" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.76" +rust-version = "1.81.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" @@ -77,7 +77,6 @@ celestia-tendermint = { workspace = true } celestia-types = { workspace = true } hyper = { workspace = true } itertools = { workspace = true } -once_cell = { workspace = true } rand_core = { version = "0.6", features = ["getrandom"] } tempfile = { workspace = true } tendermint-rpc = { workspace = true, features = ["http-client"] } diff --git a/crates/astria-sequencer-relayer/tests/blackbox/helpers/test_sequencer_relayer.rs b/crates/astria-sequencer-relayer/tests/blackbox/helpers/test_sequencer_relayer.rs index 041e6a488..b1d57f9a4 100644 --- a/crates/astria-sequencer-relayer/tests/blackbox/helpers/test_sequencer_relayer.rs +++ b/crates/astria-sequencer-relayer/tests/blackbox/helpers/test_sequencer_relayer.rs @@ -10,6 +10,7 @@ use std::{ io::Write, mem, net::SocketAddr, + sync::LazyLock, time::Duration, }; @@ -28,7 +29,6 @@ use astria_sequencer_relayer::{ use http::StatusCode; use isahc::AsyncReadResponseExt; use itertools::Itertools; -use once_cell::sync::Lazy; use serde::Deserialize; use serde_json::json; use telemetry::metrics; @@ -123,7 +123,7 @@ const STATUS_RESPONSE: &str = r#" } }"#; -static TELEMETRY: Lazy<()> = Lazy::new(|| { +static TELEMETRY: LazyLock<()> = LazyLock::new(|| { astria_eyre::install().unwrap(); if std::env::var_os("TEST_LOG").is_some() { let filter_directives = std::env::var("RUST_LOG") @@ -675,7 +675,7 @@ impl TestSequencerRelayerConfig { "the sequencer relayer must be run on a multi-threaded runtime, e.g. the test could \ be configured using `#[tokio::test(flavor = \"multi_thread\", worker_threads = 1)]`" ); - Lazy::force(&TELEMETRY); + LazyLock::force(&TELEMETRY); let celestia_app = MockCelestiaAppServer::spawn(self.celestia_chain_id.clone()).await; let celestia_app_grpc_endpoint = format!("http://{}", celestia_app.local_addr); diff --git a/crates/astria-sequencer-utils/Cargo.toml b/crates/astria-sequencer-utils/Cargo.toml index 9a06b1cd0..9f0bed5d9 100644 --- a/crates/astria-sequencer-utils/Cargo.toml +++ b/crates/astria-sequencer-utils/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-utils" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.74.1" +rust-version = "1.81.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer/Cargo.toml b/crates/astria-sequencer/Cargo.toml index 60a35107f..373e0e8de 100644 --- a/crates/astria-sequencer/Cargo.toml +++ b/crates/astria-sequencer/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer" version = "0.17.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.76" +rust-version = "1.81.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-telemetry/Cargo.toml b/crates/astria-telemetry/Cargo.toml index 0b7e04e8d..f724959a3 100644 --- a/crates/astria-telemetry/Cargo.toml +++ b/crates/astria-telemetry/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-telemetry" version = "0.1.0" edition = "2021" -rust-version = "1.72.1" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-test-utils/Cargo.toml b/crates/astria-test-utils/Cargo.toml index 88f41814d..854cdd4b0 100644 --- a/crates/astria-test-utils/Cargo.toml +++ b/crates/astria-test-utils/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-test-utils" version = "0.1.0" edition = "2021" -rust-version = "1.71.1" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria"