feat(l1, l2): remove unused dependencies#6413
feat(l1, l2): remove unused dependencies#6413kevaundray wants to merge 2 commits intolambdaclass:mainfrom
Conversation
Greptile SummaryThis PR performs a dependency cleanup across 25 Confidence Score: 2/5Not safe to merge as-is — the The overwhelming majority of changes are correct, clean dependency removals with no functional impact. However, one concrete compilation error is introduced:
|
| Filename | Overview |
|---|---|
| crates/l2/Cargo.toml | Removes ethrex-guest-program entirely, but sequencer still uses it under #[cfg(feature = "sp1")] — breaks --features sp1 builds. |
| crates/vm/levm/Cargo.toml | Removes datatest-stable, walkdir, sha3, bitvec, serde_json, lazy_static that were incorrectly listed as regular deps despite having no usage in non-test source; also drops unused dev-deps (hex, colored, spinoff). |
| crates/common/Cargo.toml | Removes tinyvec, sha3, url, k256 from main deps; correctly moves k256 to [dev-dependencies] since it is only used inside a #[test] block. |
| crates/l2/common/Cargo.toml | Removes ethrex-rlp, ethrex-trie, ethrex-vm, sha3, hex — none of which are used in the crate's source files. |
| crates/networking/p2p/Cargo.toml | Removes unused async-trait, serde_json from main deps and hex-literal from dev-deps; confirmed none are referenced in p2p source files. |
| crates/vm/Cargo.toml | Removes ethrex-trie, lazy_static, rkyv, bincode, ethereum-types — all confirmed absent from the crate's source files. |
| crates/storage/Cargo.toml | Removes async-trait, ethereum-types, hex from main deps and hex, hex-literal, tempfile from dev-deps; none used in storage source. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[cmd/ethrex --features sp1] -->|enables| B[ethrex-prover/sp1]
A -->|enables| C[ethrex-l2/sp1]
B -->|direct dep| D[ethrex-guest-program]
C -->|sp1 = dep:sp1-sdk\nNO ethrex-guest-program| E{ethrex-l2}
E -->|cfg feature sp1| F[l1_proof_sender.rs\nuse ethrex_guest_program::ZKVM_SP1_PROGRAM_ELF]
F -->|❌ ethrex-guest-program\nnot a declared dep| G[Compilation Error]
style G fill:#ff4444,color:#fff
style F fill:#ffaa00,color:#000
Prompt To Fix All With AI
This is a comment left during a code review.
Path: crates/l2/Cargo.toml
Line: 76-78
Comment:
**Missing `ethrex-guest-program` dependency breaks `sp1` feature compilation**
`ethrex-guest-program` has been completely removed as a dependency from this crate, but `crates/l2/sequencer/l1_proof_sender.rs` still imports from it under `#[cfg(feature = "sp1")]`:
```rust
#[cfg(feature = "sp1")]
use ethrex_guest_program::ZKVM_SP1_PROGRAM_ELF;
```
Since `cmd/ethrex/Cargo.toml` has `sp1 = ["ethrex-prover/sp1", "ethrex-l2/sp1"]`, building the `cmd/ethrex` binary with `--features sp1` will enable `ethrex-l2/sp1`, which will trigger the `#[cfg(feature = "sp1")]` block in `l1_proof_sender.rs` — but `ethrex_guest_program` is no longer a declared dependency of `ethrex-l2`, causing a compilation failure.
The fix is to either:
1. Re-add `ethrex-guest-program` as an **optional** dependency tied to the `sp1` feature, e.g.:
```toml
ethrex-guest-program = { path = "../guest-program", optional = true }
[features]
sp1 = ["dep:ethrex-guest-program", "dep:sp1-sdk"]
```
2. Or remove the `ethrex_guest_program` usage from `l1_proof_sender.rs` if it truly is no longer needed.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "commit" | Re-trigger Greptile
| [features] | ||
| default = ["l2"] | ||
|
|
There was a problem hiding this comment.
Missing
ethrex-guest-program dependency breaks sp1 feature compilation
ethrex-guest-program has been completely removed as a dependency from this crate, but crates/l2/sequencer/l1_proof_sender.rs still imports from it under #[cfg(feature = "sp1")]:
#[cfg(feature = "sp1")]
use ethrex_guest_program::ZKVM_SP1_PROGRAM_ELF;Since cmd/ethrex/Cargo.toml has sp1 = ["ethrex-prover/sp1", "ethrex-l2/sp1"], building the cmd/ethrex binary with --features sp1 will enable ethrex-l2/sp1, which will trigger the #[cfg(feature = "sp1")] block in l1_proof_sender.rs — but ethrex_guest_program is no longer a declared dependency of ethrex-l2, causing a compilation failure.
The fix is to either:
- Re-add
ethrex-guest-programas an optional dependency tied to thesp1feature, e.g.:ethrex-guest-program = { path = "../guest-program", optional = true } [features] sp1 = ["dep:ethrex-guest-program", "dep:sp1-sdk"]
- Or remove the
ethrex_guest_programusage froml1_proof_sender.rsif it truly is no longer needed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/l2/Cargo.toml
Line: 76-78
Comment:
**Missing `ethrex-guest-program` dependency breaks `sp1` feature compilation**
`ethrex-guest-program` has been completely removed as a dependency from this crate, but `crates/l2/sequencer/l1_proof_sender.rs` still imports from it under `#[cfg(feature = "sp1")]`:
```rust
#[cfg(feature = "sp1")]
use ethrex_guest_program::ZKVM_SP1_PROGRAM_ELF;
```
Since `cmd/ethrex/Cargo.toml` has `sp1 = ["ethrex-prover/sp1", "ethrex-l2/sp1"]`, building the `cmd/ethrex` binary with `--features sp1` will enable `ethrex-l2/sp1`, which will trigger the `#[cfg(feature = "sp1")]` block in `l1_proof_sender.rs` — but `ethrex_guest_program` is no longer a declared dependency of `ethrex-l2`, causing a compilation failure.
The fix is to either:
1. Re-add `ethrex-guest-program` as an **optional** dependency tied to the `sp1` feature, e.g.:
```toml
ethrex-guest-program = { path = "../guest-program", optional = true }
[features]
sp1 = ["dep:ethrex-guest-program", "dep:sp1-sdk"]
```
2. Or remove the `ethrex_guest_program` usage from `l1_proof_sender.rs` if it truly is no longer needed.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Pull request overview
Removes unused Rust dependencies across several workspace crates (plus corresponding lockfile cleanup) based on cargo machete --with-metadata and cargo udeps, aiming to reduce compile times and dependency surface area.
Changes:
- Pruned unused deps from multiple
Cargo.tomlmanifests (tooling, common, VM, storage, networking, L2). - Updated multiple
Cargo.lockfiles to reflect the reduced dependency graph. - Adjusted
ethrex-l2feature definitions (sp1,risc0,l2) alongside dependency removals.
Reviewed changes
Copilot reviewed 17 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tooling/repl/Cargo.toml | Removes unused ethereum-types from REPL tooling crate. |
| tooling/monitor/Cargo.toml | Removes unused TUI/error-reporting dependencies from monitor tooling crate. |
| tooling/Cargo.lock | Lockfile updated after tooling dependency pruning. |
| test/Cargo.toml | Removes unused tempfile from test crate. |
| crates/vm/levm/runner/Cargo.toml | Removes unused json5 from LEVM runner crate. |
| crates/vm/levm/bench/revm_comparison/Cargo.lock | Lockfile updated after bench dependency pruning. |
| crates/vm/levm/Cargo.toml | Removes multiple unused deps/dev-deps from ethrex-levm. |
| crates/vm/Cargo.toml | Removes unused dependencies from ethrex-vm. |
| crates/storage/Cargo.toml | Removes unused deps/dev-deps from ethrex-storage. |
| crates/networking/p2p/Cargo.toml | Removes unused deps/dev-deps from ethrex-p2p. |
| crates/l2/tee/quote-gen/Cargo.lock | Lockfile updated after dependency pruning for quote generator. |
| crates/l2/storage/Cargo.toml | Removes unused deps from L2 storage crate. |
| crates/l2/sdk/Cargo.toml | Removes unused eyre from L2 SDK crate. |
| crates/l2/common/Cargo.toml | Removes unused deps from L2 common crate. |
| crates/l2/Cargo.toml | Removes unused deps and modifies feature wiring for L2 crate. |
| crates/guest-program/bin/zisk/Cargo.lock | Lockfile updated after guest-program bin dependency pruning. |
| crates/guest-program/bin/sp1/Cargo.lock | Lockfile updated after guest-program bin dependency pruning. |
| crates/guest-program/bin/risc0/Cargo.lock | Lockfile updated after guest-program bin dependency pruning. |
| crates/guest-program/bin/openvm/Cargo.lock | Lockfile updated after guest-program bin dependency pruning. |
| crates/common/trie/Cargo.toml | Removes unused deps from trie crate. |
| crates/common/rlp/Cargo.toml | Removes unused deps from RLP crate. |
| crates/common/Cargo.toml | Removes unused deps; moves k256 to dev-dependencies. |
| crates/blockchain/Cargo.toml | Removes unused deps/dev-deps from blockchain crate. |
| cmd/ethrex/Cargo.toml | Removes unused clap_complete from CLI crate. |
| Cargo.lock | Workspace lockfile updated after dependency graph changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sp1 = ["dep:sp1-sdk"] | ||
| risc0 = [] | ||
|
|
||
| rocksdb = [] | ||
|
|
||
| metrics = ["ethrex-blockchain/metrics"] | ||
|
|
||
| l2 = ["ethrex-guest-program/l2"] | ||
| l2 = [] |
There was a problem hiding this comment.
ethrex-l2 still references ethrex_guest_program behind the sp1 feature (e.g. sequencer/l1_proof_sender.rs imports ethrex_guest_program::ZKVM_SP1_PROGRAM_ELF). With ethrex-guest-program removed from [dependencies] and sp1 no longer enabling it, building ethrex-l2 with --features sp1 will fail. Re-add ethrex-guest-program as an optional dependency and include it in the sp1 (and any other relevant) feature(s), or remove/relocate the ethrex_guest_program usage from this crate.
Head branch was pushed to by a user without write access
8161372 to
3a8b060
Compare
## Motivation Continuation of #6413. Used `cargo machete --with-metadata` and `cargo udeps` to check for unused deps, filtering out false positives manually. ## Description Cherry-picked from #6413 onto current main with merge conflicts resolved (guest program Cargo.lock files). ## Checklist - [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR includes breaking changes to the `Store` requiring a re-sync. --------- Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
|
Superseded by #6421 |
Continuation of #6413. Used `cargo machete --with-metadata` and `cargo udeps` to check for unused deps, filtering out false positives manually. Cherry-picked from #6413 onto current main with merge conflicts resolved (guest program Cargo.lock files). - [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR includes breaking changes to the `Store` requiring a re-sync. --------- Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
Motivation
Used
cargo machete --with-metadataandcargo udepsto check for unused deps. There were some false positives with cargo machete that I had to manually filter out.Description
Checklist
STORE_SCHEMA_VERSION(crates/storage/lib.rs) if the PR includes breaking changes to theStorerequiring a re-sync.Closes #issue_number