ci: unused dependencies sanity check (#590)

* ci: add unused deps sanity check

* ci: fix unused deps issue template title

* ci: rename udeps job

* chore: formatting

* chore: make `cargo-udeps` ignore `aquamarine`

* deps: resolve unused deps

* ci: check every feature and target in udeps job
This commit is contained in:
Bjerg
2022-12-23 13:19:50 +01:00
committed by GitHub
parent 9d439d6fc8
commit 562e895f21
15 changed files with 74 additions and 42 deletions

View File

@ -0,0 +1,15 @@
---
title: "chore: some installed deps are not needed"
labels: C-debt, A-dependencies
---
Some dependencies specified in `Cargo.toml` are not needed.
Check the [unused dependencies sanity check]({{env.WORKFLOW_URL}}) workflow for details.
This issue was raised by the workflow at `.github/workflows/sanity.yml`.
> **Note**
> If this is a false positive, please refer to the [`cargo-udeps` docs][cargo-udeps-docs] on how to ignore the dependencies.
[cargo-udeps-docs]: https://github.com/est31/cargo-udeps#ignoring-some-of-the-dependencies

View File

@ -43,8 +43,6 @@ jobs:
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Update packages
run: cargo update
@ -60,3 +58,30 @@ jobs:
with:
update_existing: true
filename: .github/SANITY_DEPS_ISSUE_TEMPLATE.md
unused-deps:
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
# See also <https://github.com/foundry-rs/foundry/issues/3827>
runs-on: ubuntu-20.04
name: unused dependencies
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-udeps
run: cargo install cargo-udeps --locked
- name: Check for unused dependencies
run: cargo +nightly udeps --all-features --all-targets
- uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/SANITY_UNUSED_DEPS_ISSUE_TEMPLATE.md

20
Cargo.lock generated
View File

@ -2352,12 +2352,6 @@ dependencies = [
"libc",
]
[[package]]
name = "maplit"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
[[package]]
name = "matchers"
version = "0.1.0"
@ -3305,7 +3299,6 @@ dependencies = [
"reth-primitives",
"reth-provider",
"reth-rlp",
"reth-rpc",
"reth-stages",
"reth-transaction-pool",
"serde",
@ -3337,7 +3330,6 @@ version = "0.1.0"
dependencies = [
"async-trait",
"auto_impl",
"eyre",
"futures",
"reth-interfaces",
"reth-primitives",
@ -3362,7 +3354,6 @@ dependencies = [
"async-trait",
"bytes",
"criterion",
"eyre",
"futures",
"heapless",
"iai",
@ -3492,11 +3483,9 @@ version = "0.1.0"
dependencies = [
"async-trait",
"auto_impl",
"eyre",
"hash-db",
"hashbrown 0.13.1",
"plain_hasher",
"reth-consensus",
"reth-db",
"reth-interfaces",
"reth-primitives",
@ -3520,11 +3509,9 @@ dependencies = [
"auto_impl",
"bytes",
"futures",
"heapless",
"hex-literal",
"modular-bitfield",
"parity-scale-codec",
"postcard",
"rand 0.8.5",
"reth-codecs",
"reth-db",
@ -3599,7 +3586,6 @@ dependencies = [
"aquamarine",
"async-trait",
"bytes",
"either",
"enr 0.7.0",
"ethers-core",
"ethers-providers",
@ -3644,7 +3630,6 @@ dependencies = [
"hash-db",
"hex",
"hex-literal",
"maplit",
"modular-bitfield",
"parity-scale-codec",
"plain_hasher",
@ -3706,14 +3691,12 @@ dependencies = [
"rlp",
"secp256k1",
"smol_str",
"tracing",
]
[[package]]
name = "reth-rlp-derive"
version = "0.1.1"
dependencies = [
"bytes",
"proc-macro2",
"quote",
"syn",
@ -3777,7 +3760,6 @@ dependencies = [
"reth-eth-wire",
"reth-executor",
"reth-interfaces",
"reth-network",
"reth-primitives",
"reth-provider",
"reth-rlp",
@ -3786,7 +3768,6 @@ dependencies = [
"tokio",
"tokio-stream",
"tracing",
"tracing-futures",
]
[[package]]
@ -3816,7 +3797,6 @@ dependencies = [
"bitflags",
"fnv",
"futures-util",
"linked-hash-map",
"parking_lot 0.12.1",
"paste",
"rand 0.8.5",

View File

@ -17,7 +17,7 @@ reth-interfaces = { path = "../../crates/interfaces", features = ["test-utils"]
reth-transaction-pool = { path = "../../crates/transaction-pool" }
reth-consensus = { path = "../../crates/consensus", features = ["serde"] }
reth-executor = { path = "../../crates/executor" }
reth-rpc = {path = "../../crates/net/rpc"}
# reth-rpc = {path = "../../crates/net/rpc"}
reth-rlp = { path = "../../crates/common/rlp" }
reth-network = {path = "../../crates/net/network" }
reth-downloaders = {path = "../../crates/net/downloaders" }

View File

@ -10,7 +10,6 @@ repository = "https://github.com/paradigmxyz/reth"
proc-macro = true
[dependencies]
bytes = { version = "1", default-features = false }
syn = "1"
quote = "1"
proc-macro2 = "1"
proc-macro2 = "1"

View File

@ -16,7 +16,6 @@ enr = { version = "0.7", default-features = false, optional = true }
rlp = { version = "0.5.2", default-features = false, optional = true }
ethereum-types = { version = "0.14", features = ["codec"], optional = true }
reth-rlp-derive = { version = "0.1", path = "../rlp-derive", optional = true }
tracing = "0.1.37"
[dev-dependencies]
reth-rlp = { path = ".", package = "reth-rlp", features = [

View File

@ -22,11 +22,10 @@ tokio-stream = "0.1"
# common
thiserror = "1.0.37"
eyre = "0.6.8"
auto_impl = "1.0"
# io
serde = { version = "1.0", optional = true }
[features]
serde = ["dep:serde"]
serde = ["dep:serde"]

View File

@ -13,7 +13,6 @@ reth-interfaces = { path = "../interfaces" }
reth-rlp = { path = "../common/rlp" }
reth-db = { path = "../storage/db" }
reth-provider = { path = "../storage/provider" }
reth-consensus = { path = "../consensus" }
revm = "2.3"
# remove from reth and reexport from revm
@ -22,7 +21,6 @@ hashbrown = "0.13"
# common
async-trait = "0.1.57"
thiserror = "1.0.37"
eyre = "0.6.8"
auto_impl = "1.0"
tracing = "0.1.37"
tokio = { version = "1.21.2", features = ["sync"] }

View File

@ -21,8 +21,6 @@ reth-eth-wire = { path = "../net/eth-wire" }
# codecs
serde = { version = "1.0.*", default-features = false }
postcard = { version = "1.0.2", features = ["alloc"] }
heapless = "0.7.16"
parity-scale-codec = { version = "3.2.1", features = ["bytes"] }
futures = "0.3.25"
tokio-stream = "0.1.11"

View File

@ -9,6 +9,12 @@ description = """
Ethereum network support
"""
[package.metadata.cargo-udeps.ignore]
normal = [
# Used for diagrams in docs
"aquamarine"
]
[dependencies]
# reth
reth-interfaces = { path = "../../interfaces" }
@ -37,7 +43,6 @@ thiserror = "1.0"
parking_lot = "0.12"
async-trait = "0.1"
bytes = "1.2"
either = "1.8"
linked_hash_set = "0.1"
rand = "0.8"
secp256k1 = { version = "0.24", features = [

View File

@ -28,9 +28,8 @@ secp256k1 = { version = "0.24.2", default-features = false, features = [
"recovery",
] }
#used for forkid
# used for forkid
crc = "1"
maplit = "1"
# misc
bytes = "1.2"
@ -57,4 +56,4 @@ test-fuzz = "3.0.4"
# necessary so we don't hit a "undeclared 'std'":
# https://github.com/paradigmxyz/reth/pull/177#discussion_r1021172198
secp256k1 = "0.24.2"
secp256k1 = "0.24.2"

View File

@ -7,6 +7,12 @@ repository = "https://github.com/paradigmxyz/reth"
readme = "README.md"
description = "Staged syncing primitives used in reth."
[package.metadata.cargo-udeps.ignore]
normal = [
# Used for diagrams in docs
"aquamarine"
]
[dependencies]
# reth libs
reth-primitives = { path = "../primitives" }
@ -15,15 +21,13 @@ reth-executor = { path = "../executor" }
reth-rlp = { path = "../common/rlp" }
reth-db = { path = "../storage/db" }
reth-provider = { path = "../storage/provider" }
reth-network = { path = "../net/network" }
#async
# async
tokio = { version = "1.21.2", features = ["sync"] }
async-trait = "0.1.57"
thiserror = "1.0.37"
tracing = "0.1.36"
tracing-futures = "0.2.5"
aquamarine = "0.1.12"
metrics = "0.20.1"
futures-util = "0.3.25"

View File

@ -6,6 +6,14 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/paradigmxyz/reth"
readme = "../README.md"
[package.metadata.cargo-udeps.ignore]
normal = [
# Used in proc macros
"serde",
# Used in proc macros
"parity-scale-codec"
]
[lib]
proc-macro = true

View File

@ -31,8 +31,6 @@ bytes = "1.2.1"
page_size = "0.4.2"
thiserror = "1.0.37"
tempfile = { version = "3.3.0", optional = true }
eyre = "0.6.8"
[dev-dependencies]
tempfile = "3.3.0"

View File

@ -9,6 +9,12 @@ description = """
Transaction pool implementation
"""
[package.metadata.cargo-udeps.ignore]
normal = [
# Used for diagrams in docs
"aquamarine"
]
[dependencies]
# eth
@ -25,7 +31,6 @@ aquamarine = "0.1" # docs
thiserror = "1.0"
tracing = "0.1"
serde = { version = "1.0", features = ["derive", "rc"] }
linked-hash-map = "0.5"
fnv = "1.0.7"
bitflags = "1.3"