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

@ -12,7 +12,7 @@ workflows:
# Check that `A` activates the features of `B`. # Check that `A` activates the features of `B`.
"propagate-feature", "propagate-feature",
# These are the features to check: # 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. # 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", "--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. # Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.

View File

@ -45,6 +45,8 @@ exclude_crates=(
reth-optimism-payload-builder reth-optimism-payload-builder
reth-optimism-rpc reth-optimism-rpc
reth-optimism-chain-registry reth-optimism-chain-registry
reth-optimism-consensus
reth-optimism-evm
reth-rpc reth-rpc
reth-rpc-api reth-rpc-api
reth-rpc-api-testing-util reth-rpc-api-testing-util

View File

@ -23,7 +23,7 @@ jobs:
matrix: matrix:
bin: bin:
- cargo run --bin reth --features "dev" - 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: steps:
- uses: rui314/setup-mold@v1 - uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable

View File

@ -48,7 +48,7 @@ jobs:
name: Run tests name: Run tests
run: | run: |
cargo nextest run \ cargo nextest run \
--locked -p reth-optimism-node --features "optimism" --locked -p reth-optimism-node
integration-success: integration-success:
name: integration success name: integration success

View File

@ -21,7 +21,7 @@ jobs:
with: with:
image_tag: ghcr.io/paradigmxyz/op-reth:kurtosis-ci image_tag: ghcr.io/paradigmxyz/op-reth:kurtosis-ci
binary_name: op-reth binary_name: op-reth
cargo_features: optimism,asm-keccak cargo_features: asm-keccak
cargo_package: crates/optimism/bin/Cargo.toml cargo_package: crates/optimism/bin/Cargo.toml
test: test:

View File

@ -18,11 +18,8 @@ jobs:
matrix: matrix:
include: include:
- type: ethereum - 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" 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 - type: book
args: --manifest-path book/sources/Cargo.toml --workspace --bins args: --manifest-path book/sources/Cargo.toml --workspace --bins
features: "" features: ""
@ -108,20 +105,17 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with: with:
cache-on-failure: true cache-on-failure: true
- run: cargo hack check --workspace --exclude op-reth - run: cargo hack check --workspace
- run: cargo check -p op-reth --features "optimism"
msrv: msrv:
name: MSRV / ${{ matrix.network }} name: MSRV
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
strategy: strategy:
matrix: matrix:
include: include:
- binary: reth - binary: reth
network: ethereum
- binary: op-reth - binary: op-reth
network: optimism
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: rui314/setup-mold@v1 - uses: rui314/setup-mold@v1
@ -131,7 +125,7 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with: with:
cache-on-failure: true cache-on-failure: true
- run: cargo build --bin "${{ matrix.binary }}" --workspace --features "${{ matrix.network }}" - run: cargo build --bin "${{ matrix.binary }}" --workspace
env: env:
RUSTFLAGS: -D warnings RUSTFLAGS: -D warnings

View File

@ -35,11 +35,11 @@ jobs:
partition: 2 partition: 2
total_partitions: 2 total_partitions: 2
- type: optimism - 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 partition: 1
total_partitions: 2 total_partitions: 2
- type: optimism - 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 partition: 2
total_partitions: 2 total_partitions: 2
- type: book - type: book
@ -94,15 +94,12 @@ jobs:
- run: cargo nextest run --release -p ef-tests --features "asm-keccak ef-tests" - run: cargo nextest run --release -p ef-tests --features "asm-keccak ef-tests"
doc: doc:
name: doc tests (${{ matrix.network }}) name: doc tests
runs-on: runs-on:
group: Reth group: Reth
env: env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
timeout-minutes: 30 timeout-minutes: 30
strategy:
matrix:
network: ["ethereum", "optimism"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: rui314/setup-mold@v1 - uses: rui314/setup-mold@v1
@ -111,7 +108,7 @@ jobs:
with: with:
cache-on-failure: true cache-on-failure: true
- name: Run doctests - name: Run doctests
run: cargo test --doc --workspace --features "${{ matrix.network }}" run: cargo test --doc --workspace --all-features
unit-success: unit-success:
name: unit success name: unit success

View File

@ -46,4 +46,4 @@ jobs:
- name: mingw-w64 - name: mingw-w64
run: sudo apt-get install -y mingw-w64 run: sudo apt-get install -y mingw-w64
- name: Check OP-Reth - 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

1
Cargo.lock generated
View File

@ -7253,7 +7253,6 @@ dependencies = [
"reth-node-api", "reth-node-api",
"reth-node-builder", "reth-node-builder",
"reth-node-core", "reth-node-core",
"reth-optimism-primitives",
"reth-payload-builder", "reth-payload-builder",
"reth-payload-builder-primitives", "reth-payload-builder-primitives",
"reth-payload-primitives", "reth-payload-primitives",

View File

@ -20,10 +20,10 @@ ENV BUILD_PROFILE=$BUILD_PROFILE
ARG RUSTFLAGS="" ARG RUSTFLAGS=""
ENV RUSTFLAGS="$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 . . 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 ls -la /app/target/$BUILD_PROFILE/op-reth
RUN cp /app/target/$BUILD_PROFILE/op-reth /app/op-reth RUN cp /app/target/$BUILD_PROFILE/op-reth /app/op-reth

115
Makefile
View File

@ -33,9 +33,6 @@ EF_TESTS_DIR := ./testing/ef-tests/ethereum-tests
# The docker image name # The docker image name
DOCKER_IMAGE_NAME ?= ghcr.io/paradigmxyz/reth 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 ##@ Help
.PHONY: help .PHONY: help
@ -54,7 +51,7 @@ install: ## Build and install the reth binary under `~/.cargo/bin`.
.PHONY: install-op .PHONY: install-op
install-op: ## Build and install the op-reth binary under `~/.cargo/bin`. install-op: ## Build and install the op-reth binary under `~/.cargo/bin`.
cargo install --path crates/optimism/bin --bin op-reth --force --locked \ cargo install --path crates/optimism/bin --bin op-reth --force --locked \
--features "optimism $(FEATURES)" \ --features "$(FEATURES)" \
--profile "$(PROFILE)" \ --profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS) $(CARGO_INSTALL_EXTRA_FLAGS)
@ -97,14 +94,14 @@ build-debug: ## Build the reth binary into `target/debug` directory.
.PHONY: build-op .PHONY: build-op
build-op: ## Build the op-reth binary into `target` directory. 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. # Builds the reth binary natively.
build-native-%: build-native-%:
cargo build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)" cargo build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)"
op-build-native-%: 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. # The following commands use `cross` to build a cross-compile.
# #
@ -136,7 +133,7 @@ build-%:
op-build-%: op-build-%:
RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \ 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. # 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. # 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 ##@ Test
UNIT_TEST_ARGS := --locked --workspace --features 'jemalloc-prof' -E 'kind(lib)' -E 'kind(bin)' -E 'kind(proc-macro)' 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 COV_FILE := lcov.info
.PHONY: test-unit .PHONY: test-unit
@ -186,21 +182,12 @@ test-unit: ## Run unit tests.
cargo install cargo-nextest --locked cargo install cargo-nextest --locked
cargo nextest run $(UNIT_TEST_ARGS) 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 .PHONY: cov-unit
cov-unit: ## Run unit tests with coverage. cov-unit: ## Run unit tests with coverage.
rm -f $(COV_FILE) rm -f $(COV_FILE)
cargo llvm-cov nextest --lcov --output-path $(COV_FILE) $(UNIT_TEST_ARGS) 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 .PHONY: cov-report-html
cov-report-html: cov-unit ## Generate a HTML coverage report and open it in the browser. cov-report-html: cov-unit ## Generate a HTML coverage report and open it in the browser.
cargo llvm-cov report --html cargo llvm-cov report --html
@ -364,7 +351,7 @@ maxperf: ## Builds `reth` with the most aggressive optimisations.
.PHONY: maxperf-op .PHONY: maxperf-op
maxperf-op: ## Builds `op-reth` with the most aggressive optimisations. 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 .PHONY: maxperf-no-asm
maxperf-no-asm: ## Builds `reth` with the most aggressive optimisations, minus the "asm-keccak" feature. 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: fmt:
cargo +nightly fmt cargo +nightly fmt
lint-reth: clippy:
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:
cargo +nightly clippy \ cargo +nightly clippy \
--workspace \ --workspace \
--lib \ --lib \
@ -436,41 +401,11 @@ ensure-dprint:
lint: lint:
make fmt && \ make fmt && \
make lint-reth && \ make clippy && \
make lint-op-reth && \
make lint-other-targets && \
make lint-codespell && \ make lint-codespell && \
make lint-toml make lint-toml
fix-lint-reth: clippy-fix:
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:
cargo +nightly clippy \ cargo +nightly clippy \
--workspace \ --workspace \
--lib \ --lib \
@ -484,9 +419,7 @@ fix-lint-other-targets:
-- -D warnings -- -D warnings
fix-lint: fix-lint:
make fix-lint-reth && \ make clippy-fix && \
make fix-lint-op-reth && \
make fix-lint-other-targets && \
make fmt make fmt
.PHONY: rustdocs .PHONY: rustdocs
@ -499,43 +432,21 @@ rustdocs: ## Runs `cargo docs` to generate the Rust documents in the `target/doc
cargo +nightly docs \ cargo +nightly docs \
--document-private-items --document-private-items
test-reth: test:
cargo test \
--workspace \
--bin "reth" \
--lib \
--examples \
--tests \
--benches \
--features "ethereum $(BIN_OTHER_FEATURES)"
test-op-reth:
cargo test \ cargo test \
--workspace \ --workspace \
--bin "op-reth" \ --bin "op-reth" \
--lib --examples \ --lib --examples \
--tests \ --tests \
--benches \ --benches \
--features "optimism $(BIN_OTHER_FEATURES)"
test-other-targets:
cargo test \
--workspace \
--lib \
--examples \
--tests \
--benches \
--all-features --all-features
test-doc: test-doc:
cargo test --doc --workspace --features "ethereum" cargo test --doc --workspace --all-features
cargo test --doc --workspace --features "optimism"
test: test:
make test-reth && \ make test && \
make test-op-reth && \ make test-doc
make test-doc && \
make test-other-targets
pr: pr:
make lint && \ make lint && \

View File

@ -91,8 +91,6 @@ min-info-logs = ["tracing/release_max_level_info"]
min-debug-logs = ["tracing/release_max_level_debug"] min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"] 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 # no-op feature flag for switching between the `optimism` and default functionality in CI matrices
ethereum = [] ethereum = []

View File

@ -33,9 +33,6 @@ reth-network-peers.workspace = true
reth-engine-local.workspace = true reth-engine-local.workspace = true
reth-tasks.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 # rpc
jsonrpsee.workspace = true jsonrpsee.workspace = true
url.workspace = true url.workspace = true

View File

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

View File

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

View File

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

View File

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

View File

@ -594,7 +594,6 @@ mod tests {
} }
} }
#[cfg(not(feature = "optimism"))]
#[test] #[test]
fn network_args_default_sanity_test() { fn network_args_default_sanity_test() {
let default_args = NetworkArgs::default(); 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"] 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 = [ dev = [
"reth-optimism-cli/dev", "reth-optimism-cli/dev",
"reth-optimism-primitives/arbitrary", "reth-optimism-primitives/arbitrary",

View File

@ -24,8 +24,6 @@
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)] )]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![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`. /// Re-exported from `reth_optimism_cli`.
pub mod cli { pub mod cli {

View File

@ -1,6 +1,4 @@
#![allow(missing_docs, rustdoc::missing_crate_level_docs)] #![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 clap::Parser;
use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli}; use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};

View File

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

View File

@ -5,10 +5,8 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256", html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" 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))] #![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. /// Optimism chain specification parser.
pub mod chainspec; pub mod chainspec;

View File

@ -27,7 +27,7 @@ reth-trie-common.workspace = true
reth-optimism-forks.workspace = true reth-optimism-forks.workspace = true
reth-optimism-chainspec.workspace = true reth-optimism-chainspec.workspace = true
# TODO: remove this after feature cleanup # TODO: remove this after feature cleanup
reth-optimism-primitives = { workspace = true, features = ["serde"] } reth-optimism-primitives = { workspace = true, features = ["serde", "reth-codec"] }
# ethereum # ethereum
alloy-eips.workspace = true alloy-eips.workspace = true
@ -79,9 +79,3 @@ std = [
"thiserror/std", "thiserror/std",
"reth-execution-types/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(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
extern crate alloc; extern crate alloc;

View File

@ -83,8 +83,3 @@ std = [
"revm-database/std", "revm-database/std",
"revm-optimism/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(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
extern crate alloc; extern crate alloc;

View File

@ -13,8 +13,8 @@ workspace = true
[dependencies] [dependencies]
# reth # reth
reth-chainspec.workspace = true reth-chainspec.workspace = true
reth-db.workspace = true reth-db = { workspace = true, features = ["op"] }
reth-engine-local.workspace = true reth-engine-local = { workspace = true, features = ["op"] }
reth-primitives.workspace = true reth-primitives.workspace = true
reth-primitives-traits.workspace = true reth-primitives-traits.workspace = true
reth-payload-builder.workspace = true reth-payload-builder.workspace = true
@ -43,7 +43,7 @@ reth-optimism-txpool.workspace = true
reth-optimism-chainspec.workspace = true reth-optimism-chainspec.workspace = true
reth-optimism-consensus.workspace = true reth-optimism-consensus.workspace = true
reth-optimism-forks.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 with required optimism features
revm = { workspace = true, features = ["secp256k1", "blst", "c-kzg"] } revm = { workspace = true, features = ["secp256k1", "blst", "c-kzg"] }
@ -87,19 +87,6 @@ futures.workspace = true
[features] [features]
default = ["reth-codec"] 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 = [ asm-keccak = [
"reth-primitives/asm-keccak", "reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak", "alloy-primitives/asm-keccak",

View File

@ -9,8 +9,6 @@
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)] )]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![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. /// CLI argument parsing for the optimism node.
pub mod args; pub mod args;

View File

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

View File

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

View File

@ -51,12 +51,3 @@ derive_more.workspace = true
tracing.workspace = true tracing.workspace = true
thiserror.workspace = true thiserror.workspace = true
sha2.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", html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" 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))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![allow(clippy::useless_let_if_seq)] #![allow(clippy::useless_let_if_seq)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
pub mod builder; pub mod builder;
pub use builder::OpPayloadBuilder; pub use builder::OpPayloadBuilder;

View File

@ -121,4 +121,3 @@ arbitrary = [
"alloy-rpc-types-eth?/arbitrary", "alloy-rpc-types-eth?/arbitrary",
"alloy-serde?/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))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct OpPrimitives; pub struct OpPrimitives;
#[cfg(feature = "optimism")]
impl reth_primitives_traits::NodePrimitives for OpPrimitives { impl reth_primitives_traits::NodePrimitives for OpPrimitives {
type Block = OpBlock; type Block = OpBlock;
type BlockHeader = alloy_consensus::Header; type BlockHeader = alloy_consensus::Header;

View File

@ -82,12 +82,3 @@ network = ["dep:reth-network"]
provider = ["storage-api", "dep:reth-provider", "dep:reth-db"] provider = ["storage-api", "dep:reth-provider", "dep:reth-db"]
storage-api = ["dep:reth-storage-api"] storage-api = ["dep:reth-storage-api"]
trie = ["dep:reth-trie"] 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(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![allow(unused_crate_dependencies)] #![allow(unused_crate_dependencies)]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
/// Re-exported ethereum types /// Re-exported ethereum types
#[doc(inline)] #[doc(inline)]

View File

@ -76,14 +76,6 @@ derive_more = { workspace = true, features = ["constructor"] }
reth-optimism-chainspec.workspace = true reth-optimism-chainspec.workspace = true
[features] [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 = [ client = [
"jsonrpsee/client", "jsonrpsee/client",
"jsonrpsee/async-client", "jsonrpsee/async-client",

View File

@ -5,10 +5,8 @@
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256", html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" 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))] #![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 engine;
pub mod error; pub mod error;

View File

@ -18,9 +18,3 @@ reth-codecs.workspace = true
reth-db-api.workspace = true reth-db-api.workspace = true
reth-prune-types.workspace = true reth-prune-types.workspace = true
reth-stages-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/" issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)] )]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {

View File

@ -48,10 +48,3 @@ parking_lot.workspace = true
[dev-dependencies] [dev-dependencies]
reth-optimism-chainspec.workspace = true reth-optimism-chainspec.workspace = true
reth-provider = { workspace = true, features = ["test-utils"] } 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", html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" 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))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
// The `optimism` feature must be enabled to use this crate.
#![cfg(feature = "optimism")]
mod validator; mod validator;
pub use validator::{OpL1BlockInfo, OpTransactionValidator}; pub use validator::{OpL1BlockInfo, OpTransactionValidator};

View File

@ -86,11 +86,6 @@ arbitrary = [
"alloy-consensus/arbitrary", "alloy-consensus/arbitrary",
"reth-optimism-primitives?/arbitrary", "reth-optimism-primitives?/arbitrary",
] ]
optimism = [
"reth-codecs/op",
"reth-optimism-primitives?/optimism",
"op",
]
op = [ op = [
"dep:reth-optimism-primitives", "dep:reth-optimism-primitives",
"reth-codecs/op", "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 // 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 // expand the flags field and break backwards compatibility
#[cfg(not(feature = "optimism"))]
#[test] #[test]
fn test_ensure_backwards_compatibility() { fn test_ensure_backwards_compatibility() {
use super::*; use super::*;

View File

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

View File

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

View File

@ -19,6 +19,3 @@ alloy-eips.workspace = true
alloy-consensus.workspace = true alloy-consensus.workspace = true
eyre.workspace = true eyre.workspace = true
[features]
optimism = []