mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: remove optimism feature (#14545)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
115
Makefile
115
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 && \
|
||||
|
||||
Reference in New Issue
Block a user