Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove optimism feature from optimism crate #11136

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
name: Run tests
run: |
cargo nextest run \
--locked -p reth-optimism-node --features "optimism"
--locked -p reth-optimism-node

integration-success:
name: integration success
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
with:
cache-on-failure: true
- run: cargo hack check --workspace --exclude op-reth
- run: cargo check -p op-reth --features "optimism"
- run: cargo check -p op-reth

msrv:
name: MSRV / ${{ matrix.network }}
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ install: ## Build and install the reth binary under `~/.cargo/bin`.
.PHONY: install-op
install-op: ## Build and install the op-reth binary under `~/.cargo/bin`.
cargo install --path crates/optimism/bin --bin op-reth --force --locked \
--features "optimism,$(FEATURES)" \
--features "$(FEATURES)" \
--profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS)

Expand All @@ -67,14 +67,14 @@ build-debug: ## Build the reth binary into `target/debug` directory.

.PHONY: build-op
build-op: ## Build the op-reth binary into `target` directory.
cargo build --bin op-reth --features "optimism,$(FEATURES)" --profile "$(PROFILE)" --manifest-path crates/optimism/bin/Cargo.toml
cargo build --bin op-reth --features "$(FEATURES)" --profile "$(PROFILE)" --manifest-path crates/optimism/bin/Cargo.toml

# Builds the reth binary natively.
build-native-%:
cargo build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)"

op-build-native-%:
cargo build --bin op-reth --target $* --features "optimism,$(FEATURES)" --profile "$(PROFILE)" --manifest-path crates/optimism/bin/Cargo.toml
cargo build --bin op-reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)" --manifest-path crates/optimism/bin/Cargo.toml

# The following commands use `cross` to build a cross-compile.
#
Expand Down Expand Up @@ -106,7 +106,7 @@ build-%:

op-build-%:
RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \
cross build --bin op-reth --target $* --features "optimism,$(FEATURES)" --profile "$(PROFILE)" --manifest-path crates/optimism/bin/Cargo.toml
cross build --bin op-reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)" --manifest-path crates/optimism/bin/Cargo.toml

# Unfortunately we can't easily use cross to build for Darwin because of licensing issues.
# If we wanted to, we would need to build a custom Docker image with the SDK available.
Expand Down Expand Up @@ -148,7 +148,7 @@ build-release-tarballs: ## Create a series of `.tar.gz` files in the BIN_DIR dir
##@ Test

UNIT_TEST_ARGS := --locked --workspace --features 'jemalloc-prof' -E 'kind(lib)' -E 'kind(bin)' -E 'kind(proc-macro)'
UNIT_TEST_ARGS_OP := --locked --workspace --features 'jemalloc-prof,optimism' -E 'kind(lib)' -E 'kind(bin)' -E 'kind(proc-macro)'
UNIT_TEST_ARGS_OP := --locked --workspace --features 'jemalloc-prof' -E 'kind(lib)' -E 'kind(bin)' -E 'kind(proc-macro)'
COV_FILE := lcov.info

.PHONY: test-unit
Expand Down Expand Up @@ -314,7 +314,7 @@ maxperf: ## Builds `reth` with the most aggressive optimisations.

.PHONY: maxperf-op
maxperf-op: ## Builds `op-reth` with the most aggressive optimisations.
RUSTFLAGS="-C target-cpu=native" cargo build --profile maxperf --features jemalloc,asm-keccak,optimism --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml
RUSTFLAGS="-C target-cpu=native" cargo build --profile maxperf --features jemalloc,asm-keccak --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml

.PHONY: maxperf-no-asm
maxperf-no-asm: ## Builds `reth` with the most aggressive optimisations, minus the "asm-keccak" feature.
Expand Down Expand Up @@ -343,7 +343,7 @@ lint-op-reth:
--examples \
--tests \
--benches \
--features "optimism $(BIN_OTHER_FEATURES)" \
--features "$(BIN_OTHER_FEATURES)" \
-- -D warnings

lint-other-targets:
Expand Down Expand Up @@ -394,7 +394,7 @@ fix-lint-op-reth:
--examples \
--tests \
--benches \
--features "optimism $(BIN_OTHER_FEATURES)" \
--features "$(BIN_OTHER_FEATURES)" \
--fix \
--allow-staged \
--allow-dirty \
Expand Down Expand Up @@ -446,7 +446,7 @@ test-op-reth:
--lib --examples \
--tests \
--benches \
--features "optimism $(BIN_OTHER_FEATURES)"
--features "$(BIN_OTHER_FEATURES)"

test-other-targets:
cargo test \
Expand Down
2 changes: 1 addition & 1 deletion crates/chainspec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ default = ["std"]
optimism = [
"serde",
"dep:op-alloy-rpc-types",
"reth-optimism-forks",
"dep:reth-optimism-forks",
]
std = []
arbitrary = [
Expand Down
1 change: 0 additions & 1 deletion crates/optimism/bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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"]

[[bin]]
name = "op-reth"
Expand Down
2 changes: 0 additions & 2 deletions crates/optimism/bin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![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_node_builder::{engine_tree_config::TreeConfig, EngineNodeLauncher};
Expand Down
15 changes: 4 additions & 11 deletions crates/optimism/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ reth-db = { workspace = true, features = ["mdbx"] }
reth-db-api.workspace = true
reth-db-common.workspace = true
reth-downloaders.workspace = true
reth-provider.workspace = true
reth-provider = { workspace = true, features = ["optimism"] }
reth-prune.workspace = true
reth-stages.workspace = true
reth-static-file.workspace = true
reth-execution-types.workspace = true
reth-node-core.workspace = true
reth-optimism-node.workspace = true
reth-primitives.workspace = true
reth-node-core = { workspace = true, features = ["optimism"] }
reth-primitives = { workspace = true, features = ["optimism"] }

## optimism
reth-optimism-primitives.workspace = true
Expand All @@ -38,6 +37,7 @@ reth-network-p2p.workspace = true
reth-errors.workspace = true
reth-config.workspace = true
reth-optimism-evm.workspace = true
reth-optimism-node.workspace = true
reth-cli.workspace = true
reth-cli-runner.workspace = true
reth-node-builder.workspace = true
Expand Down Expand Up @@ -69,13 +69,6 @@ reth-db-common.workspace = true
reth-cli-commands.workspace = true

[features]
optimism = [
"reth-primitives/optimism",
"reth-optimism-evm/optimism",
"reth-provider/optimism",
"reth-node-core/optimism",
"reth-optimism-node/optimism",
]
asm-keccak = [
"alloy-primitives/asm-keccak",
"reth-node-core/asm-keccak",
Expand Down
3 changes: 0 additions & 3 deletions crates/optimism/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
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(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;
Expand Down
5 changes: 1 addition & 4 deletions crates/optimism/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true
reth-chainspec.workspace = true
reth-consensus-common.workspace = true
reth-consensus.workspace = true
reth-primitives.workspace = true
reth-primitives = { workspace = true, features = ["optimism"] }
reth-trie-common.workspace = true

# op-reth
Expand All @@ -31,6 +31,3 @@ tracing.workspace = true
[dev-dependencies]
alloy-primitives.workspace = true
reth-optimism-chainspec.workspace = true

[features]
optimism = ["reth-primitives/optimism"]
2 changes: 0 additions & 2 deletions crates/optimism/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

use alloy_primitives::{B64, U256};
use reth_chainspec::EthereumHardforks;
Expand Down
14 changes: 3 additions & 11 deletions crates/optimism/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ workspace = true
reth-chainspec.workspace = true
reth-ethereum-forks.workspace = true
reth-evm.workspace = true
reth-primitives.workspace = true
reth-revm.workspace = true
reth-primitives = { workspace = true, features = ["optimism"] }
reth-revm = { workspace = true, features = ["optimism"] }
reth-execution-errors.workspace = true
reth-execution-types.workspace = true
reth-execution-types = { workspace = true, features = ["optimism"] }
reth-prune-types.workspace = true

# ethereum
Expand All @@ -44,11 +44,3 @@ reth-revm = { workspace = true, features = ["test-utils"] }
reth-optimism-chainspec.workspace = true
alloy-genesis.workspace = true
alloy-consensus.workspace = true

[features]
optimism = [
"reth-primitives/optimism",
"reth-execution-types/optimism",
"reth-optimism-consensus/optimism",
"reth-revm/optimism",
]
2 changes: 0 additions & 2 deletions crates/optimism/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

use alloy_primitives::{Address, U256};
use reth_evm::{ConfigureEvm, ConfigureEvmEnv, NextBlockEnvAttributes};
Expand Down
26 changes: 7 additions & 19 deletions crates/optimism/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ workspace = true

[dependencies]
# reth
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-chainspec = { workspace = true, features = ["optimism"] }
reth-primitives = { workspace = true, features = ["optimism"] }
reth-payload-builder.workspace = true
reth-auto-seal-consensus.workspace = true
reth-auto-seal-consensus = { workspace = true, features = ["optimism"] }
reth-basic-payload-builder.workspace = true
reth-consensus.workspace = true
reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-rpc-types-compat = { workspace = true, features = ["optimism"] }
reth-node-api.workspace = true
reth-node-builder.workspace = true
reth-tracing.workspace = true
reth-provider.workspace = true
reth-provider = { workspace = true, features = ["optimism"] }
reth-transaction-pool.workspace = true
reth-network.workspace = true
reth-evm.workspace = true
reth-revm.workspace = true
reth-beacon-consensus.workspace = true
reth-revm = { workspace = true, features = ["optimism"] }
reth-beacon-consensus = { workspace = true, features = ["optimism"] }
reth-discv5.workspace = true
reth-rpc-eth-types.workspace = true
reth-rpc-eth-api.workspace = true
Expand Down Expand Up @@ -77,17 +77,5 @@ alloy-primitives.workspace = true
alloy-genesis.workspace = true

[features]
optimism = [
"reth-chainspec/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-rpc-types-compat/optimism",
"reth-optimism-evm/optimism",
"reth-optimism-payload-builder/optimism",
"reth-beacon-consensus/optimism",
"reth-revm/optimism",
"reth-auto-seal-consensus/optimism",
"reth-optimism-rpc/optimism"
]
asm-keccak = ["reth-primitives/asm-keccak"]
test-utils = ["reth-node-builder/test-utils"]
2 changes: 0 additions & 2 deletions crates/optimism/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

/// CLI argument parsing for the optimism node.
pub mod args;
Expand Down
2 changes: 0 additions & 2 deletions crates/optimism/node/tests/e2e/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#![allow(missing_docs)]

#[cfg(feature = "optimism")]
mod p2p;

#[cfg(feature = "optimism")]
mod utils;

const fn main() {}
1 change: 0 additions & 1 deletion crates/optimism/node/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(missing_docs)]

#[cfg(feature = "optimism")]
mod builder;

const fn main() {}
22 changes: 6 additions & 16 deletions crates/optimism/payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ workspace = true

[dependencies]
# reth
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-revm.workspace = true
reth-chainspec = { workspace = true, features = ["optimism"] }
reth-primitives = { workspace = true, features = ["optimism"] }
reth-revm = { workspace = true, features = ["optimism"] }
reth-transaction-pool.workspace = true
reth-provider.workspace = true
reth-rpc-types-compat.workspace = true
reth-provider = { workspace = true, features = ["optimism"] }
reth-rpc-types-compat = { workspace = true, features = ["optimism"] }
reth-evm.workspace = true
reth-execution-types.workspace = true
reth-payload-builder.workspace = true
Expand All @@ -45,14 +45,4 @@ alloy-rpc-types-engine.workspace = true
# misc
tracing.workspace = true
thiserror.workspace = true
sha2.workspace = true

[features]
optimism = [
"reth-chainspec/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-rpc-types-compat/optimism",
"reth-optimism-evm/optimism",
"reth-revm/optimism",
]
sha2.workspace = true
3 changes: 0 additions & 3 deletions crates/optimism/payload/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +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(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::OptimismPayloadBuilder;
Expand Down
17 changes: 4 additions & 13 deletions crates/optimism/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ workspace = true
[dependencies]
# reth
reth-evm.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
reth-rpc-eth-api.workspace = true
reth-primitives = { workspace = true, features = ["optimism"] }
reth-provider = { workspace = true, features = ["optimism"] }
reth-rpc-eth-api = { workspace = true, features = ["optimism"] }
reth-rpc-eth-types.workspace = true
reth-rpc-server-types.workspace = true
reth-tasks = { workspace = true, features = ["rayon"] }
Expand All @@ -41,7 +41,7 @@ alloy-rpc-types.workspace = true
op-alloy-network.workspace = true
op-alloy-rpc-types.workspace = true
op-alloy-consensus.workspace = true
revm.workspace = true
revm = { workspace = true, features = ["optimism"] }

# async
parking_lot.workspace = true
Expand All @@ -59,12 +59,3 @@ derive_more.workspace = true

[dev-dependencies]
reth-optimism-chainspec.workspace = true

[features]
optimism = [
"reth-optimism-evm/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-rpc-eth-api/optimism",
"revm/optimism",
]
Loading
Loading