diff --git a/.config/zepter.yaml b/.config/zepter.yaml index d6b4e95ea..4ad896e16 100644 --- a/.config/zepter.yaml +++ b/.config/zepter.yaml @@ -12,7 +12,7 @@ workflows: # Check that `A` activates the features of `B`. "propagate-feature", # These are the features to check: - "--features=std,optimism,op,dev,asm-keccak,jemalloc,jemalloc-prof,tracy-allocator,serde-bincode-compat,serde,test-utils,arbitrary,bench", + "--features=std,op,dev,asm-keccak,jemalloc,jemalloc-prof,tracy-allocator,serde-bincode-compat,serde,test-utils,arbitrary,bench", # Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually. "--left-side-feature-missing=ignore", # Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on. diff --git a/.github/assets/check_wasm.sh b/.github/assets/check_wasm.sh index dbc0dd094..e28b27ee9 100755 --- a/.github/assets/check_wasm.sh +++ b/.github/assets/check_wasm.sh @@ -45,6 +45,8 @@ exclude_crates=( reth-optimism-payload-builder reth-optimism-rpc reth-optimism-chain-registry + reth-optimism-consensus + reth-optimism-evm reth-rpc reth-rpc-api reth-rpc-api-testing-util diff --git a/.github/workflows/compact.yml b/.github/workflows/compact.yml index 37a1588c1..06ddec20c 100644 --- a/.github/workflows/compact.yml +++ b/.github/workflows/compact.yml @@ -23,7 +23,7 @@ jobs: matrix: bin: - cargo run --bin reth --features "dev" - - cargo run --bin op-reth --features "optimism dev" --manifest-path crates/optimism/bin/Cargo.toml + - cargo run --bin op-reth --features "dev" --manifest-path crates/optimism/bin/Cargo.toml steps: - uses: rui314/setup-mold@v1 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2156710fb..11bb48c85 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,7 +48,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 diff --git a/.github/workflows/kurtosis-op.yml b/.github/workflows/kurtosis-op.yml index 85a8e706c..c9b7c01cb 100644 --- a/.github/workflows/kurtosis-op.yml +++ b/.github/workflows/kurtosis-op.yml @@ -21,7 +21,7 @@ jobs: with: image_tag: ghcr.io/paradigmxyz/op-reth:kurtosis-ci binary_name: op-reth - cargo_features: optimism,asm-keccak + cargo_features: asm-keccak cargo_package: crates/optimism/bin/Cargo.toml test: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6b3c165aa..bb4766d58 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,11 +18,8 @@ jobs: matrix: include: - type: ethereum - args: --bin reth --workspace --lib --examples --tests --benches --locked + args: --workspace --lib --examples --tests --benches --locked features: "ethereum asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs" - - type: optimism - args: --bin op-reth --workspace --lib --examples --tests --benches --locked - features: "optimism asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs" - type: book args: --manifest-path book/sources/Cargo.toml --workspace --bins features: "" @@ -108,20 +105,17 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - run: cargo hack check --workspace --exclude op-reth - - run: cargo check -p op-reth --features "optimism" + - run: cargo hack check --workspace msrv: - name: MSRV / ${{ matrix.network }} + name: MSRV runs-on: ubuntu-latest timeout-minutes: 30 strategy: matrix: include: - binary: reth - network: ethereum - binary: op-reth - network: optimism steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 @@ -131,7 +125,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - run: cargo build --bin "${{ matrix.binary }}" --workspace --features "${{ matrix.network }}" + - run: cargo build --bin "${{ matrix.binary }}" --workspace env: RUSTFLAGS: -D warnings diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 4a9992c7e..823e31668 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -35,11 +35,11 @@ jobs: partition: 2 total_partitions: 2 - type: optimism - args: --features "asm-keccak optimism" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum" + args: --features "asm-keccak" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum" partition: 1 total_partitions: 2 - type: optimism - args: --features "asm-keccak optimism" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum" + args: --features "asm-keccak" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum" partition: 2 total_partitions: 2 - type: book @@ -94,15 +94,12 @@ jobs: - run: cargo nextest run --release -p ef-tests --features "asm-keccak ef-tests" doc: - name: doc tests (${{ matrix.network }}) + name: doc tests runs-on: group: Reth env: RUST_BACKTRACE: 1 timeout-minutes: 30 - strategy: - matrix: - network: ["ethereum", "optimism"] steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 @@ -111,7 +108,7 @@ jobs: with: cache-on-failure: true - name: Run doctests - run: cargo test --doc --workspace --features "${{ matrix.network }}" + run: cargo test --doc --workspace --all-features unit-success: name: unit success diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d79c49379..caadacfbe 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -46,4 +46,4 @@ jobs: - name: mingw-w64 run: sudo apt-get install -y mingw-w64 - name: Check OP-Reth - run: cargo check -p op-reth --features optimism --target x86_64-pc-windows-gnu + run: cargo check -p op-reth --target x86_64-pc-windows-gnu diff --git a/Cargo.lock b/Cargo.lock index 0f0aabc3e..4a7cabc30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7253,7 +7253,6 @@ dependencies = [ "reth-node-api", "reth-node-builder", "reth-node-core", - "reth-optimism-primitives", "reth-payload-builder", "reth-payload-builder-primitives", "reth-payload-primitives", diff --git a/DockerfileOp b/DockerfileOp index dbfb0ce2d..51a567317 100644 --- a/DockerfileOp +++ b/DockerfileOp @@ -20,10 +20,10 @@ ENV BUILD_PROFILE=$BUILD_PROFILE ARG RUSTFLAGS="" ENV RUSTFLAGS="$RUSTFLAGS" -RUN cargo chef cook --profile $BUILD_PROFILE --features "optimism" --recipe-path recipe.json --manifest-path /app/crates/optimism/bin/Cargo.toml +RUN cargo chef cook --profile $BUILD_PROFILE --recipe-path recipe.json --manifest-path /app/crates/optimism/bin/Cargo.toml COPY . . -RUN cargo build --profile $BUILD_PROFILE --bin op-reth --features "optimism" --manifest-path /app/crates/optimism/bin/Cargo.toml +RUN cargo build --profile $BUILD_PROFILE --bin op-reth --manifest-path /app/crates/optimism/bin/Cargo.toml RUN ls -la /app/target/$BUILD_PROFILE/op-reth RUN cp /app/target/$BUILD_PROFILE/op-reth /app/op-reth diff --git a/Makefile b/Makefile index 2d3078bac..8d1e5180a 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,6 @@ EF_TESTS_DIR := ./testing/ef-tests/ethereum-tests # The docker image name DOCKER_IMAGE_NAME ?= ghcr.io/paradigmxyz/reth -# Features in reth/op-reth binary crate other than "ethereum" and "optimism" -BIN_OTHER_FEATURES := asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs - ##@ Help .PHONY: help @@ -54,7 +51,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) @@ -97,14 +94,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. # @@ -136,7 +133,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. @@ -178,7 +175,6 @@ 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)' COV_FILE := lcov.info .PHONY: test-unit @@ -186,21 +182,12 @@ test-unit: ## Run unit tests. cargo install cargo-nextest --locked cargo nextest run $(UNIT_TEST_ARGS) -.PHONY: test-unit-op -test-unit-op: ## Run unit tests (with optimism feature flag enabled). - cargo install cargo-nextest --locked - cargo nextest run $(UNIT_TEST_ARGS_OP) .PHONY: cov-unit cov-unit: ## Run unit tests with coverage. rm -f $(COV_FILE) cargo llvm-cov nextest --lcov --output-path $(COV_FILE) $(UNIT_TEST_ARGS) -.PHONY: cov-unit-op -cov-unit-op: ## Run unit tests with coverage (with optimism feature flag enabled). - rm -f $(COV_FILE) - cargo llvm-cov nextest --lcov --output-path $(COV_FILE) $(UNIT_TEST_ARGS_OP) - .PHONY: cov-report-html cov-report-html: cov-unit ## Generate a HTML coverage report and open it in the browser. cargo llvm-cov report --html @@ -364,7 +351,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. @@ -374,29 +361,7 @@ maxperf-no-asm: ## Builds `reth` with the most aggressive optimisations, minus t fmt: cargo +nightly fmt -lint-reth: - cargo +nightly clippy \ - --workspace \ - --bin "reth" \ - --lib \ - --examples \ - --tests \ - --benches \ - --features "ethereum $(BIN_OTHER_FEATURES)" \ - -- -D warnings - -lint-op-reth: - cargo +nightly clippy \ - --workspace \ - --bin "op-reth" \ - --lib \ - --examples \ - --tests \ - --benches \ - --features "optimism $(BIN_OTHER_FEATURES)" \ - -- -D warnings - -lint-other-targets: +clippy: cargo +nightly clippy \ --workspace \ --lib \ @@ -436,41 +401,11 @@ ensure-dprint: lint: make fmt && \ - make lint-reth && \ - make lint-op-reth && \ - make lint-other-targets && \ + make clippy && \ make lint-codespell && \ make lint-toml -fix-lint-reth: - cargo +nightly clippy \ - --workspace \ - --bin "reth" \ - --lib \ - --examples \ - --tests \ - --benches \ - --features "ethereum $(BIN_OTHER_FEATURES)" \ - --fix \ - --allow-staged \ - --allow-dirty \ - -- -D warnings - -fix-lint-op-reth: - cargo +nightly clippy \ - --workspace \ - --bin "op-reth" \ - --lib \ - --examples \ - --tests \ - --benches \ - --features "optimism $(BIN_OTHER_FEATURES)" \ - --fix \ - --allow-staged \ - --allow-dirty \ - -- -D warnings - -fix-lint-other-targets: +clippy-fix: cargo +nightly clippy \ --workspace \ --lib \ @@ -484,9 +419,7 @@ fix-lint-other-targets: -- -D warnings fix-lint: - make fix-lint-reth && \ - make fix-lint-op-reth && \ - make fix-lint-other-targets && \ + make clippy-fix && \ make fmt .PHONY: rustdocs @@ -499,43 +432,21 @@ rustdocs: ## Runs `cargo docs` to generate the Rust documents in the `target/doc cargo +nightly docs \ --document-private-items -test-reth: - cargo test \ - --workspace \ - --bin "reth" \ - --lib \ - --examples \ - --tests \ - --benches \ - --features "ethereum $(BIN_OTHER_FEATURES)" - -test-op-reth: +test: cargo test \ --workspace \ --bin "op-reth" \ --lib --examples \ --tests \ --benches \ - --features "optimism $(BIN_OTHER_FEATURES)" - -test-other-targets: - cargo test \ - --workspace \ - --lib \ - --examples \ - --tests \ - --benches \ --all-features test-doc: - cargo test --doc --workspace --features "ethereum" - cargo test --doc --workspace --features "optimism" + cargo test --doc --workspace --all-features test: - make test-reth && \ - make test-op-reth && \ - make test-doc && \ - make test-other-targets + make test && \ + make test-doc pr: make lint && \ diff --git a/bin/reth-bench/Cargo.toml b/bin/reth-bench/Cargo.toml index 3fc7a8952..3e891890a 100644 --- a/bin/reth-bench/Cargo.toml +++ b/bin/reth-bench/Cargo.toml @@ -91,8 +91,6 @@ min-info-logs = ["tracing/release_max_level_info"] min-debug-logs = ["tracing/release_max_level_debug"] min-trace-logs = ["tracing/release_max_level_trace"] -optimism = ["reth-node-core/optimism"] - # no-op feature flag for switching between the `optimism` and default functionality in CI matrices ethereum = [] diff --git a/crates/e2e-test-utils/Cargo.toml b/crates/e2e-test-utils/Cargo.toml index 1df1a20f8..9600977c7 100644 --- a/crates/e2e-test-utils/Cargo.toml +++ b/crates/e2e-test-utils/Cargo.toml @@ -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 diff --git a/crates/engine/util/Cargo.toml b/crates/engine/util/Cargo.toml index 5010f261c..e07864d4b 100644 --- a/crates/engine/util/Cargo.toml +++ b/crates/engine/util/Cargo.toml @@ -51,8 +51,3 @@ itertools.workspace = true # tracing tracing.workspace = true - -[features] -optimism = [ - "reth-provider/optimism", -] diff --git a/crates/evm/execution-types/Cargo.toml b/crates/evm/execution-types/Cargo.toml index 19a75c3ed..b860dd893 100644 --- a/crates/evm/execution-types/Cargo.toml +++ b/crates/evm/execution-types/Cargo.toml @@ -37,7 +37,6 @@ reth-ethereum-primitives.workspace = true [features] default = ["std"] -optimism = [] serde = [ "dep:serde", "rand/serde", diff --git a/crates/net/downloaders/Cargo.toml b/crates/net/downloaders/Cargo.toml index 56ca9197d..40bc2e6f5 100644 --- a/crates/net/downloaders/Cargo.toml +++ b/crates/net/downloaders/Cargo.toml @@ -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", diff --git a/crates/node/core/Cargo.toml b/crates/node/core/Cargo.toml index 07473eb07..fe488afc3 100644 --- a/crates/node/core/Cargo.toml +++ b/crates/node/core/Cargo.toml @@ -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"] diff --git a/crates/node/core/src/args/network.rs b/crates/node/core/src/args/network.rs index cb784e5fd..d97ba2faf 100644 --- a/crates/node/core/src/args/network.rs +++ b/crates/node/core/src/args/network.rs @@ -594,7 +594,6 @@ mod tests { } } - #[cfg(not(feature = "optimism"))] #[test] fn network_args_default_sanity_test() { let default_args = NetworkArgs::default(); diff --git a/crates/optimism/bin/Cargo.toml b/crates/optimism/bin/Cargo.toml index 4d136c370..61b4c9beb 100644 --- a/crates/optimism/bin/Cargo.toml +++ b/crates/optimism/bin/Cargo.toml @@ -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", diff --git a/crates/optimism/bin/src/lib.rs b/crates/optimism/bin/src/lib.rs index 9f257b8be..2a452c016 100644 --- a/crates/optimism/bin/src/lib.rs +++ b/crates/optimism/bin/src/lib.rs @@ -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 { diff --git a/crates/optimism/bin/src/main.rs b/crates/optimism/bin/src/main.rs index 06a578681..07cdf841c 100644 --- a/crates/optimism/bin/src/main.rs +++ b/crates/optimism/bin/src/main.rs @@ -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}; diff --git a/crates/optimism/cli/Cargo.toml b/crates/optimism/cli/Cargo.toml index 89912c8c0..81d5bc59d 100644 --- a/crates/optimism/cli/Cargo.toml +++ b/crates/optimism/cli/Cargo.toml @@ -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", diff --git a/crates/optimism/cli/src/lib.rs b/crates/optimism/cli/src/lib.rs index 76c4d9a74..c2050af4a 100644 --- a/crates/optimism/cli/src/lib.rs +++ b/crates/optimism/cli/src/lib.rs @@ -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; diff --git a/crates/optimism/consensus/Cargo.toml b/crates/optimism/consensus/Cargo.toml index 393ea6be2..3a0d15901 100644 --- a/crates/optimism/consensus/Cargo.toml +++ b/crates/optimism/consensus/Cargo.toml @@ -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", -] diff --git a/crates/optimism/consensus/src/lib.rs b/crates/optimism/consensus/src/lib.rs index 59d33cf8e..c39e84569 100644 --- a/crates/optimism/consensus/src/lib.rs +++ b/crates/optimism/consensus/src/lib.rs @@ -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; diff --git a/crates/optimism/evm/Cargo.toml b/crates/optimism/evm/Cargo.toml index a49826a1c..846e1903a 100644 --- a/crates/optimism/evm/Cargo.toml +++ b/crates/optimism/evm/Cargo.toml @@ -83,8 +83,3 @@ std = [ "revm-database/std", "revm-optimism/std", ] -optimism = [ - "reth-execution-types/optimism", - "reth-optimism-consensus/optimism", - "reth-optimism-primitives/optimism", -] diff --git a/crates/optimism/evm/src/lib.rs b/crates/optimism/evm/src/lib.rs index 13374bbbe..5f5989e61 100644 --- a/crates/optimism/evm/src/lib.rs +++ b/crates/optimism/evm/src/lib.rs @@ -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; diff --git a/crates/optimism/node/Cargo.toml b/crates/optimism/node/Cargo.toml index 245846a5f..79a3906a3 100644 --- a/crates/optimism/node/Cargo.toml +++ b/crates/optimism/node/Cargo.toml @@ -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", diff --git a/crates/optimism/node/src/lib.rs b/crates/optimism/node/src/lib.rs index 729ef65c2..222298681 100644 --- a/crates/optimism/node/src/lib.rs +++ b/crates/optimism/node/src/lib.rs @@ -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; diff --git a/crates/optimism/node/tests/e2e/main.rs b/crates/optimism/node/tests/e2e/main.rs index 7f4b22ba7..3fb8201b2 100644 --- a/crates/optimism/node/tests/e2e/main.rs +++ b/crates/optimism/node/tests/e2e/main.rs @@ -1,6 +1,5 @@ #![allow(missing_docs)] -#[cfg(feature = "optimism")] mod p2p; const fn main() {} diff --git a/crates/optimism/node/tests/it/main.rs b/crates/optimism/node/tests/it/main.rs index d0533fc45..fbd49d4c1 100644 --- a/crates/optimism/node/tests/it/main.rs +++ b/crates/optimism/node/tests/it/main.rs @@ -1,9 +1,7 @@ #![allow(missing_docs)] -#[cfg(feature = "optimism")] mod builder; -#[cfg(feature = "optimism")] mod priority; const fn main() {} diff --git a/crates/optimism/payload/Cargo.toml b/crates/optimism/payload/Cargo.toml index 935bea058..5fa4e9ac0 100644 --- a/crates/optimism/payload/Cargo.toml +++ b/crates/optimism/payload/Cargo.toml @@ -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", -] diff --git a/crates/optimism/payload/src/lib.rs b/crates/optimism/payload/src/lib.rs index 2bb66f0cf..659dc2350 100644 --- a/crates/optimism/payload/src/lib.rs +++ b/crates/optimism/payload/src/lib.rs @@ -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; diff --git a/crates/optimism/primitives/Cargo.toml b/crates/optimism/primitives/Cargo.toml index b531303d6..3f33436f4 100644 --- a/crates/optimism/primitives/Cargo.toml +++ b/crates/optimism/primitives/Cargo.toml @@ -121,4 +121,3 @@ arbitrary = [ "alloy-rpc-types-eth?/arbitrary", "alloy-serde?/arbitrary", ] -optimism = [] diff --git a/crates/optimism/primitives/src/lib.rs b/crates/optimism/primitives/src/lib.rs index 926ca0878..741eae0f0 100644 --- a/crates/optimism/primitives/src/lib.rs +++ b/crates/optimism/primitives/src/lib.rs @@ -36,7 +36,6 @@ pub type OpBlockBody = ::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; diff --git a/crates/optimism/reth/Cargo.toml b/crates/optimism/reth/Cargo.toml index 485fd5f3d..edc5b2546 100644 --- a/crates/optimism/reth/Cargo.toml +++ b/crates/optimism/reth/Cargo.toml @@ -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", -] diff --git a/crates/optimism/reth/src/lib.rs b/crates/optimism/reth/src/lib.rs index 3d75b0e19..d6b64153a 100644 --- a/crates/optimism/reth/src/lib.rs +++ b/crates/optimism/reth/src/lib.rs @@ -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)] diff --git a/crates/optimism/rpc/Cargo.toml b/crates/optimism/rpc/Cargo.toml index 75fca7e33..7a78af7f2 100644 --- a/crates/optimism/rpc/Cargo.toml +++ b/crates/optimism/rpc/Cargo.toml @@ -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", diff --git a/crates/optimism/rpc/src/lib.rs b/crates/optimism/rpc/src/lib.rs index be17084a9..b92e0c106 100644 --- a/crates/optimism/rpc/src/lib.rs +++ b/crates/optimism/rpc/src/lib.rs @@ -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; diff --git a/crates/optimism/storage/Cargo.toml b/crates/optimism/storage/Cargo.toml index 708ae151a..4583f1367 100644 --- a/crates/optimism/storage/Cargo.toml +++ b/crates/optimism/storage/Cargo.toml @@ -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", -] diff --git a/crates/optimism/storage/src/lib.rs b/crates/optimism/storage/src/lib.rs index 3f13133dd..0d7fa5310 100644 --- a/crates/optimism/storage/src/lib.rs +++ b/crates/optimism/storage/src/lib.rs @@ -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 { diff --git a/crates/optimism/txpool/Cargo.toml b/crates/optimism/txpool/Cargo.toml index 4af571263..8f5d489ac 100644 --- a/crates/optimism/txpool/Cargo.toml +++ b/crates/optimism/txpool/Cargo.toml @@ -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", -] diff --git a/crates/optimism/txpool/src/lib.rs b/crates/optimism/txpool/src/lib.rs index 793fa7a28..efbcb0e53 100644 --- a/crates/optimism/txpool/src/lib.rs +++ b/crates/optimism/txpool/src/lib.rs @@ -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}; diff --git a/crates/storage/db-api/Cargo.toml b/crates/storage/db-api/Cargo.toml index 3a3dc7482..ddd806de7 100644 --- a/crates/storage/db-api/Cargo.toml +++ b/crates/storage/db-api/Cargo.toml @@ -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", diff --git a/crates/storage/db-api/src/models/mod.rs b/crates/storage/db-api/src/models/mod.rs index 7a4cbe669..59a32a053 100644 --- a/crates/storage/db-api/src/models/mod.rs +++ b/crates/storage/db-api/src/models/mod.rs @@ -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::*; diff --git a/crates/storage/db/Cargo.toml b/crates/storage/db/Cargo.toml index ff1276346..35b2b4a2c 100644 --- a/crates/storage/db/Cargo.toml +++ b/crates/storage/db/Cargo.toml @@ -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", diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index 9a084932a..4b5c9f623 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -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", diff --git a/examples/custom-beacon-withdrawals/Cargo.toml b/examples/custom-beacon-withdrawals/Cargo.toml index 1ec27c671..d58da7d2c 100644 --- a/examples/custom-beacon-withdrawals/Cargo.toml +++ b/examples/custom-beacon-withdrawals/Cargo.toml @@ -19,6 +19,3 @@ alloy-eips.workspace = true alloy-consensus.workspace = true eyre.workspace = true - -[features] -optimism = []