Skip to content

Commit

Permalink
chore: remove optimism feature (#14545)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
klkvr and mattsse authored Feb 17, 2025
1 parent 482f455 commit 1804bbe
Show file tree
Hide file tree
Showing 48 changed files with 45 additions and 292 deletions.
2 changes: 1 addition & 1 deletion .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions .github/assets/check_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kurtosis-op.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions DockerfileOp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
115 changes: 13 additions & 102 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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.
#
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -178,29 +175,19 @@ 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
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
Expand Down Expand Up @@ -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.
Expand All @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand All @@ -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 && \
Expand Down
2 changes: 0 additions & 2 deletions bin/reth-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down
3 changes: 0 additions & 3 deletions crates/e2e-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 1804bbe

Please sign in to comment.