From b45478c08c70dcb880e2a21633cdebb4a374d596 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 13 Feb 2025 13:51:05 +0100 Subject: [PATCH] Revert "Disable default features for `reth-storage-api` in workspace manifest" (#14471) --- Cargo.lock | 1 - Cargo.toml | 2 +- crates/chain-state/Cargo.toml | 2 +- crates/ethereum/payload/Cargo.toml | 2 +- crates/ethereum/reth/Cargo.toml | 1 - crates/net/downloaders/Cargo.toml | 2 +- crates/net/network/Cargo.toml | 2 +- crates/node/core/Cargo.toml | 2 +- crates/node/events/Cargo.toml | 2 +- crates/optimism/reth/Cargo.toml | 1 - crates/optimism/txpool/Cargo.toml | 2 +- crates/revm/Cargo.toml | 1 - crates/rpc/rpc-engine-api/Cargo.toml | 2 +- crates/rpc/rpc-eth-types/Cargo.toml | 2 +- crates/storage/provider/Cargo.toml | 2 +- crates/storage/storage-api/Cargo.toml | 5 ----- crates/storage/storage-api/src/chain_info.rs | 13 ++++--------- crates/transaction-pool/Cargo.toml | 2 +- crates/trie/sparse/Cargo.toml | 2 +- 19 files changed, 17 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88da47ca57c1..11aef0d76513 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9445,7 +9445,6 @@ dependencies = [ "reth-trie", "reth-trie-db", "revm", - "tokio", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a9a061bcd6d9..5b0401fe6c8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -413,7 +413,7 @@ reth-stages-api = { path = "crates/stages/api" } reth-stages-types = { path = "crates/stages/types", default-features = false } reth-static-file = { path = "crates/static-file/static-file" } reth-static-file-types = { path = "crates/static-file/types", default-features = false } -reth-storage-api = { path = "crates/storage/storage-api", default-features = false } +reth-storage-api = { path = "crates/storage/storage-api" } reth-storage-errors = { path = "crates/storage/errors", default-features = false } reth-tasks = { path = "crates/tasks" } reth-testing-utils = { path = "testing/testing-utils" } diff --git a/crates/chain-state/Cargo.toml b/crates/chain-state/Cargo.toml index 922c702a680c..639b211d54ec 100644 --- a/crates/chain-state/Cargo.toml +++ b/crates/chain-state/Cargo.toml @@ -19,7 +19,7 @@ reth-execution-types.workspace = true reth-metrics.workspace = true reth-primitives.workspace = true reth-primitives-traits.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-trie.workspace = true # ethereum diff --git a/crates/ethereum/payload/Cargo.toml b/crates/ethereum/payload/Cargo.toml index c5c1d1ec4941..6bf9c812f8e1 100644 --- a/crates/ethereum/payload/Cargo.toml +++ b/crates/ethereum/payload/Cargo.toml @@ -18,7 +18,7 @@ reth-primitives-traits.workspace = true reth-revm.workspace = true reth-transaction-pool.workspace = true reth-payload-builder.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-payload-builder-primitives.workspace = true reth-payload-primitives.workspace = true reth-execution-types.workspace = true diff --git a/crates/ethereum/reth/Cargo.toml b/crates/ethereum/reth/Cargo.toml index a99f0a00c1e5..ffaf51217445 100644 --- a/crates/ethereum/reth/Cargo.toml +++ b/crates/ethereum/reth/Cargo.toml @@ -44,7 +44,6 @@ std = [ "reth-chainspec/std", "reth-ethereum-primitives/std", "reth-primitives-traits/std", - "reth-storage-api/std", "reth-consensus?/std", "reth-consensus-common?/std", "alloy-rpc-types-eth?/std", diff --git a/crates/net/downloaders/Cargo.toml b/crates/net/downloaders/Cargo.toml index e8b8c94aee22..a74fcfe84b2d 100644 --- a/crates/net/downloaders/Cargo.toml +++ b/crates/net/downloaders/Cargo.toml @@ -19,7 +19,7 @@ reth-network-p2p.workspace = true reth-network-peers.workspace = true reth-primitives.workspace = true reth-primitives-traits.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-tasks.workspace = true # optional deps for the test-utils feature diff --git a/crates/net/network/Cargo.toml b/crates/net/network/Cargo.toml index 3e33e472872f..39bbb9f0e103 100644 --- a/crates/net/network/Cargo.toml +++ b/crates/net/network/Cargo.toml @@ -29,7 +29,7 @@ reth-eth-wire-types.workspace = true reth-ecies.workspace = true reth-tasks.workspace = true reth-transaction-pool.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-tokio-util.workspace = true reth-consensus.workspace = true reth-network-peers = { workspace = true, features = ["net"] } diff --git a/crates/node/core/Cargo.toml b/crates/node/core/Cargo.toml index 65105f6fd8a1..07473eb07e90 100644 --- a/crates/node/core/Cargo.toml +++ b/crates/node/core/Cargo.toml @@ -19,7 +19,7 @@ reth-primitives-traits = { workspace = true, features = ["rayon"] } reth-cli-util.workspace = true reth-db = { workspace = true, features = ["mdbx"] } reth-storage-errors.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-network = { workspace = true, features = ["serde"] } reth-network-p2p.workspace = true reth-rpc-eth-types.workspace = true diff --git a/crates/node/events/Cargo.toml b/crates/node/events/Cargo.toml index a357bf8542db..0b57fa0110c6 100644 --- a/crates/node/events/Cargo.toml +++ b/crates/node/events/Cargo.toml @@ -12,7 +12,7 @@ workspace = true [dependencies] # reth -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-network-api.workspace = true reth-stages.workspace = true reth-prune-types.workspace = true diff --git a/crates/optimism/reth/Cargo.toml b/crates/optimism/reth/Cargo.toml index 9394d690d431..f5a2933c9b84 100644 --- a/crates/optimism/reth/Cargo.toml +++ b/crates/optimism/reth/Cargo.toml @@ -43,7 +43,6 @@ std = [ "reth-primitives-traits/std", "reth-consensus?/std", "reth-consensus-common?/std", - "reth-storage-api?/std", ] arbitrary = [ "std", diff --git a/crates/optimism/txpool/Cargo.toml b/crates/optimism/txpool/Cargo.toml index 019e6773c30d..09569854fc50 100644 --- a/crates/optimism/txpool/Cargo.toml +++ b/crates/optimism/txpool/Cargo.toml @@ -21,7 +21,7 @@ alloy-rpc-types-eth.workspace = true # reth reth-chainspec.workspace = true reth-primitives-traits.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-transaction-pool.workspace = true # revm diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index da11e9d8a60b..e001b138d17a 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -39,7 +39,6 @@ std = [ "alloy-consensus/std", "reth-ethereum-forks/std", "reth-storage-errors/std", - "reth-storage-api/std", ] witness = ["dep:reth-trie"] test-utils = [ diff --git a/crates/rpc/rpc-engine-api/Cargo.toml b/crates/rpc/rpc-engine-api/Cargo.toml index 8dccf35b17f8..d21f8dc5c9d6 100644 --- a/crates/rpc/rpc-engine-api/Cargo.toml +++ b/crates/rpc/rpc-engine-api/Cargo.toml @@ -15,7 +15,7 @@ workspace = true # reth reth-chainspec.workspace = true reth-rpc-api.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-payload-builder.workspace = true reth-payload-builder-primitives.workspace = true reth-payload-primitives.workspace = true diff --git a/crates/rpc/rpc-eth-types/Cargo.toml b/crates/rpc/rpc-eth-types/Cargo.toml index cc27534fcb53..f306eefbd89e 100644 --- a/crates/rpc/rpc-eth-types/Cargo.toml +++ b/crates/rpc/rpc-eth-types/Cargo.toml @@ -20,7 +20,7 @@ reth-execution-types.workspace = true reth-metrics.workspace = true reth-primitives = { workspace = true, features = ["secp256k1"] } reth-primitives-traits.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-revm.workspace = true reth-rpc-server-types.workspace = true reth-rpc-types-compat.workspace = true diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index e9a246265a6c..cb9c6b97669b 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -20,7 +20,7 @@ reth-primitives-traits = { workspace = true, features = ["reth-codec"] } reth-fs-util.workspace = true reth-errors.workspace = true reth-storage-errors.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-network-p2p.workspace = true reth-db = { workspace = true, features = ["mdbx"] } reth-db-api.workspace = true diff --git a/crates/storage/storage-api/Cargo.toml b/crates/storage/storage-api/Cargo.toml index bb1b0b30c42d..cd3bb6763150 100644 --- a/crates/storage/storage-api/Cargo.toml +++ b/crates/storage/storage-api/Cargo.toml @@ -33,13 +33,8 @@ alloy-primitives.workspace = true alloy-consensus.workspace = true alloy-rpc-types-engine.workspace = true -# misc - auto_impl.workspace = true -# `no_std` -tokio = { workspace = true, features = ["time"] } - [features] default = ["std"] std = [ diff --git a/crates/storage/storage-api/src/chain_info.rs b/crates/storage/storage-api/src/chain_info.rs index 6ac6e71f6b4a..77b5e5cebc78 100644 --- a/crates/storage/storage-api/src/chain_info.rs +++ b/crates/storage/storage-api/src/chain_info.rs @@ -1,12 +1,5 @@ use alloy_rpc_types_engine::ForkchoiceState; use reth_primitives_traits::SealedHeader; -#[cfg(feature = "std")] -use std::time::Instant; -#[cfg_attr(feature = "std", allow(unused_imports))] -#[cfg(feature = "std")] -use tokio::time as _; -#[cfg(not(feature = "std"))] -use tokio::time::Instant; /// A type that can track updates related to fork choice updates. pub trait CanonChainTracker: Send + Sync { @@ -18,14 +11,16 @@ pub trait CanonChainTracker: Send + Sync { /// Returns the last time a fork choice update was received from the CL /// ([`CanonChainTracker::on_forkchoice_update_received`]) - fn last_received_update_timestamp(&self) -> Option; + #[cfg(feature = "std")] + fn last_received_update_timestamp(&self) -> Option; /// Notify the tracker about a transition configuration exchange. fn on_transition_configuration_exchanged(&self); /// Returns the last time a transition configuration was exchanged with the CL /// ([`CanonChainTracker::on_transition_configuration_exchanged`]) - fn last_exchanged_transition_configuration_timestamp(&self) -> Option; + #[cfg(feature = "std")] + fn last_exchanged_transition_configuration_timestamp(&self) -> Option; /// Sets the canonical head of the chain. fn set_canonical_head(&self, header: SealedHeader); diff --git a/crates/transaction-pool/Cargo.toml b/crates/transaction-pool/Cargo.toml index 26d2e9397cc0..08435c9009c5 100644 --- a/crates/transaction-pool/Cargo.toml +++ b/crates/transaction-pool/Cargo.toml @@ -20,7 +20,7 @@ reth-primitives = { workspace = true, features = ["c-kzg", "secp256k1"] } reth-primitives-traits.workspace = true reth-execution-types.workspace = true reth-fs-util.workspace = true -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-tasks.workspace = true revm-primitives.workspace = true revm-interpreter.workspace = true diff --git a/crates/trie/sparse/Cargo.toml b/crates/trie/sparse/Cargo.toml index 1378a59c23ff..908d03950e9f 100644 --- a/crates/trie/sparse/Cargo.toml +++ b/crates/trie/sparse/Cargo.toml @@ -29,7 +29,7 @@ thiserror.workspace = true [dev-dependencies] reth-primitives-traits = { workspace = true, features = ["arbitrary"] } reth-provider = { workspace = true, features = ["test-utils"] } -reth-storage-api = { workspace = true, features = ["std"] } +reth-storage-api.workspace = true reth-testing-utils.workspace = true reth-trie = { workspace = true, features = ["test-utils"] } reth-trie-common = { workspace = true, features = ["test-utils", "arbitrary"] }