chore: remove optimism feature (#14545)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Arsenii Kulikov
2025-02-18 03:53:50 +04:00
committed by GitHub
parent 482f4557eb
commit 1804bbea6e
48 changed files with 45 additions and 292 deletions

View File

@ -33,9 +33,6 @@ reth-network-peers.workspace = true
reth-engine-local.workspace = true
reth-tasks.workspace = true
# currently need to enable this for workspace level
reth-optimism-primitives = { workspace = true, features = ["arbitrary", "serde", "serde-bincode-compat"] }
# rpc
jsonrpsee.workspace = true
url.workspace = true

View File

@ -51,8 +51,3 @@ itertools.workspace = true
# tracing
tracing.workspace = true
[features]
optimism = [
"reth-provider/optimism",
]

View File

@ -37,7 +37,6 @@ reth-ethereum-primitives.workspace = true
[features]
default = ["std"]
optimism = []
serde = [
"dep:serde",
"rand/serde",

View File

@ -72,12 +72,6 @@ rand.workspace = true
tempfile.workspace = true
[features]
optimism = [
"reth-db?/optimism",
"reth-db-api?/optimism",
"reth-provider/optimism",
]
test-utils = [
"tempfile",
"reth-db-api",

View File

@ -72,7 +72,6 @@ proptest.workspace = true
tokio.workspace = true
[features]
optimism = ["reth-db/optimism"]
# Features for vergen to generate correct env vars
jemalloc = ["reth-cli-util/jemalloc"]
asm-keccak = ["reth-primitives/asm-keccak", "alloy-primitives/asm-keccak"]

View File

@ -594,7 +594,6 @@ mod tests {
}
}
#[cfg(not(feature = "optimism"))]
#[test]
fn network_args_default_sanity_test() {
let default_args = NetworkArgs::default();

View File

@ -35,16 +35,6 @@ tracy-allocator = ["reth-cli-util/tracy-allocator"]
asm-keccak = ["reth-optimism-cli/asm-keccak", "reth-optimism-node/asm-keccak"]
optimism = [
"reth-optimism-cli/optimism",
"reth-optimism-node/optimism",
"reth-optimism-consensus/optimism",
"reth-optimism-evm/optimism",
"reth-optimism-payload-builder/optimism",
"reth-optimism-rpc/optimism",
"reth-optimism-primitives/optimism",
]
dev = [
"reth-optimism-cli/dev",
"reth-optimism-primitives/arbitrary",

View File

@ -24,8 +24,6 @@
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
/// Re-exported from `reth_optimism_cli`.
pub mod cli {

View File

@ -1,6 +1,4 @@
#![allow(missing_docs, rustdoc::missing_crate_level_docs)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
use clap::Parser;
use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};

View File

@ -46,14 +46,14 @@ reth-tracing.workspace = true
# eth
alloy-eips.workspace = true
alloy-consensus = { workspace = true, optional = true }
alloy-consensus.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
# misc
futures-util.workspace = true
derive_more = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
derive_more.workspace = true
serde.workspace = true
clap = { workspace = true, features = ["derive", "env"] }
tokio = { workspace = true, features = ["sync", "macros", "time", "rt-multi-thread"] }
@ -63,7 +63,7 @@ eyre.workspace = true
# reth test-vectors
proptest = { workspace = true, optional = true }
op-alloy-consensus = { workspace = true, optional = true }
op-alloy-consensus.workspace = true
[dev-dependencies]
tempfile.workspace = true
@ -72,22 +72,6 @@ reth-db-common.workspace = true
reth-cli-commands.workspace = true
[features]
optimism = [
"op-alloy-consensus",
"alloy-consensus",
"dep:derive_more",
"dep:serde",
"reth-optimism-evm/optimism",
"reth-node-core/optimism",
"reth-optimism-node/optimism",
"reth-execution-types/optimism",
"reth-db/optimism",
"reth-db-api/optimism",
"reth-optimism-primitives/optimism",
"reth-downloaders/optimism",
"reth-provider/optimism",
"reth-optimism-consensus/optimism",
]
asm-keccak = [
"alloy-primitives/asm-keccak",
"reth-node-core/asm-keccak",
@ -105,11 +89,12 @@ dev = [
"dep:proptest",
"reth-cli-commands/arbitrary",
]
serde = [
"alloy-consensus?/serde",
"alloy-consensus/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"op-alloy-consensus?/serde",
"op-alloy-consensus/serde",
"reth-execution-types/serde",
"reth-provider/serde",
"reth-optimism-primitives/serde",

View File

@ -5,10 +5,8 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(all(not(test), feature = "optimism"), warn(unused_crate_dependencies))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
/// Optimism chain specification parser.
pub mod chainspec;

View File

@ -27,7 +27,7 @@ reth-trie-common.workspace = true
reth-optimism-forks.workspace = true
reth-optimism-chainspec.workspace = true
# TODO: remove this after feature cleanup
reth-optimism-primitives = { workspace = true, features = ["serde"] }
reth-optimism-primitives = { workspace = true, features = ["serde", "reth-codec"] }
# ethereum
alloy-eips.workspace = true
@ -79,9 +79,3 @@ std = [
"thiserror/std",
"reth-execution-types/std",
]
optimism = [
"reth-optimism-primitives/optimism",
"reth-execution-types/optimism",
"reth-optimism-node/optimism",
"reth-provider/optimism",
]

View File

@ -7,8 +7,6 @@
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
extern crate alloc;

View File

@ -83,8 +83,3 @@ std = [
"revm-database/std",
"revm-optimism/std",
]
optimism = [
"reth-execution-types/optimism",
"reth-optimism-consensus/optimism",
"reth-optimism-primitives/optimism",
]

View File

@ -7,8 +7,6 @@
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
extern crate alloc;

View File

@ -13,8 +13,8 @@ workspace = true
[dependencies]
# reth
reth-chainspec.workspace = true
reth-db.workspace = true
reth-engine-local.workspace = true
reth-db = { workspace = true, features = ["op"] }
reth-engine-local = { workspace = true, features = ["op"] }
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-payload-builder.workspace = true
@ -43,7 +43,7 @@ reth-optimism-txpool.workspace = true
reth-optimism-chainspec.workspace = true
reth-optimism-consensus.workspace = true
reth-optimism-forks.workspace = true
reth-optimism-primitives = { workspace = true, features = ["serde", "serde-bincode-compat"] }
reth-optimism-primitives = { workspace = true, features = ["serde", "serde-bincode-compat", "reth-codec"] }
# revm with required optimism features
revm = { workspace = true, features = ["secp256k1", "blst", "c-kzg"] }
@ -87,19 +87,6 @@ futures.workspace = true
[features]
default = ["reth-codec"]
optimism = [
"reth-provider/optimism",
"reth-optimism-evm/optimism",
"reth-optimism-payload-builder/optimism",
"reth-optimism-rpc/optimism",
"reth-engine-local/op",
"reth-optimism-consensus/optimism",
"reth-db/optimism",
"reth-optimism-node/optimism",
"reth-node-core/optimism",
"reth-optimism-primitives/optimism",
"reth-optimism-txpool/optimism",
]
asm-keccak = [
"reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak",

View File

@ -9,8 +9,6 @@
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
/// CLI argument parsing for the optimism node.
pub mod args;

View File

@ -1,6 +1,5 @@
#![allow(missing_docs)]
#[cfg(feature = "optimism")]
mod p2p;
const fn main() {}

View File

@ -1,9 +1,7 @@
#![allow(missing_docs)]
#[cfg(feature = "optimism")]
mod builder;
#[cfg(feature = "optimism")]
mod priority;
const fn main() {}

View File

@ -51,12 +51,3 @@ derive_more.workspace = true
tracing.workspace = true
thiserror.workspace = true
sha2.workspace = true
[features]
optimism = [
"reth-provider/optimism",
"reth-optimism-evm/optimism",
"reth-execution-types/optimism",
"reth-optimism-consensus/optimism",
"reth-optimism-primitives/optimism",
]

View File

@ -5,11 +5,9 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(all(not(test), feature = "optimism"), warn(unused_crate_dependencies))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![allow(clippy::useless_let_if_seq)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
pub mod builder;
pub use builder::OpPayloadBuilder;

View File

@ -121,4 +121,3 @@ arbitrary = [
"alloy-rpc-types-eth?/arbitrary",
"alloy-serde?/arbitrary",
]
optimism = []

View File

@ -36,7 +36,6 @@ pub type OpBlockBody = <OpBlock as reth_primitives_traits::Block>::Body;
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct OpPrimitives;
#[cfg(feature = "optimism")]
impl reth_primitives_traits::NodePrimitives for OpPrimitives {
type Block = OpBlock;
type BlockHeader = alloy_consensus::Header;

View File

@ -82,12 +82,3 @@ network = ["dep:reth-network"]
provider = ["storage-api", "dep:reth-provider", "dep:reth-db"]
storage-api = ["dep:reth-storage-api"]
trie = ["dep:reth-trie"]
optimism = [
"reth-db?/optimism",
"reth-optimism-consensus?/optimism",
"reth-optimism-evm?/optimism",
"reth-optimism-node?/optimism",
"reth-optimism-primitives/optimism",
"reth-optimism-rpc?/optimism",
"reth-provider?/optimism",
]

View File

@ -9,8 +9,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(unused_crate_dependencies)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
/// Re-exported ethereum types
#[doc(inline)]

View File

@ -76,14 +76,6 @@ derive_more = { workspace = true, features = ["constructor"] }
reth-optimism-chainspec.workspace = true
[features]
optimism = [
"reth-optimism-evm/optimism",
"reth-provider/optimism",
"reth-optimism-consensus/optimism",
"reth-optimism-payload-builder/optimism",
"reth-optimism-primitives/optimism",
"reth-optimism-txpool/optimism",
]
client = [
"jsonrpsee/client",
"jsonrpsee/async-client",

View File

@ -5,10 +5,8 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(all(not(test), feature = "optimism"), warn(unused_crate_dependencies))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
pub mod engine;
pub mod error;

View File

@ -18,9 +18,3 @@ reth-codecs.workspace = true
reth-db-api.workspace = true
reth-prune-types.workspace = true
reth-stages-types.workspace = true
[features]
optimism = [
"reth-codecs/op",
"reth-db-api/optimism",
]

View File

@ -6,8 +6,6 @@
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
#[cfg(test)]
mod tests {

View File

@ -48,10 +48,3 @@ parking_lot.workspace = true
[dev-dependencies]
reth-optimism-chainspec.workspace = true
reth-provider = { workspace = true, features = ["test-utils"] }
[features]
optimism = [
"reth-optimism-evm/optimism",
"reth-optimism-primitives/optimism",
"reth-provider/optimism",
]

View File

@ -5,10 +5,8 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(all(not(test), feature = "optimism"), warn(unused_crate_dependencies))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
mod validator;
pub use validator::{OpL1BlockInfo, OpTransactionValidator};

View File

@ -86,11 +86,6 @@ arbitrary = [
"alloy-consensus/arbitrary",
"reth-optimism-primitives?/arbitrary",
]
optimism = [
"reth-codecs/op",
"reth-optimism-primitives?/optimism",
"op",
]
op = [
"dep:reth-optimism-primitives",
"reth-codecs/op",

View File

@ -319,7 +319,6 @@ mod tests {
//
// this check is to ensure we do not inadvertently add too many fields to a struct which would
// expand the flags field and break backwards compatibility
#[cfg(not(feature = "optimism"))]
#[test]
fn test_ensure_backwards_compatibility() {
use super::*;

View File

@ -90,7 +90,6 @@ arbitrary = [
"alloy-consensus/arbitrary",
"reth-primitives-traits/arbitrary",
]
optimism = ["reth-db-api/optimism"]
op = [
"reth-db-api/op",
"reth-primitives-traits/op",

View File

@ -87,12 +87,6 @@ eyre.workspace = true
alloy-consensus.workspace = true
[features]
optimism = [
"reth-execution-types/optimism",
"reth-codecs/op",
"reth-db/optimism",
"reth-db-api/optimism",
]
serde = [
"dashmap/serde",
"notify/serde",