Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,12 @@

- name: Check features
run: zepter run check

cargo-machete:
name: cargo machete
runs-on: [self-hosted, type-ccx13]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Machete
uses: bnjbvr/cargo-machete@main
22 changes: 0 additions & 22 deletions Cargo.lock

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

21 changes: 19 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"fp-consensus", # Used in Frontier consensus features
"frame-system-rpc-runtime-api", # Used in RPC features
"num-traits", # Used in various numeric operations
"pallet-commitments", # Used in runtime benchmarking features
"pallet-subtensor-swap-runtime-api", # Used in swap runtime API features
"pallet-transaction-payment-rpc-runtime-api", # Used in RPC features
"sc-consensus-grandpa-rpc", # Used in consensus RPC features
"sc-keystore", # Used in keystore features
"sc-rpc-api", # Used in RPC features
"sp-offchain", # Used in offchain worker features
"sp-session", # Used in session features
"sp-transaction-pool", # Used in transaction pool features
"subtensor-custom-rpc-runtime-api" # Used in custom RPC features
]

[[bin]]
name = "node-subtensor"

Expand All @@ -40,7 +57,6 @@ sp-core.workspace = true
sc-executor.workspace = true
sc-service.workspace = true
sc-telemetry.workspace = true
sc-keystore.workspace = true
sc-transaction-pool.workspace = true
sc-transaction-pool-api.workspace = true
sc-offchain.workspace = true
Expand All @@ -51,7 +67,6 @@ sp-consensus-babe.workspace = true
sc-consensus-babe-rpc.workspace = true
sc-consensus.workspace = true
sc-consensus-grandpa.workspace = true
sc-consensus-grandpa-rpc.workspace = true
sp-consensus-grandpa.workspace = true
sc-chain-spec.workspace = true
sc-consensus-slots.workspace = true
Expand Down Expand Up @@ -86,6 +101,8 @@ sp-block-builder.workspace = true
sc-basic-authorship.workspace = true
substrate-frame-rpc-system.workspace = true
pallet-transaction-payment-rpc.workspace = true

# Used for the node subtensor's RPCs
frame-system-rpc-runtime-api.workspace = true
pallet-transaction-payment-rpc-runtime-api.workspace = true

Expand Down
8 changes: 8 additions & 0 deletions pallets/admin-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"codec", # Used in serialization features
"scale-info", # Used in metadata features
"subtensor-macros", # Used in macro features
"subtensor-swap-interface" # Used in swap interface features
]

[dependencies]
subtensor-macros.workspace = true
codec = { workspace = true, features = ["derive"] }
Expand Down
6 changes: 6 additions & 0 deletions pallets/commitments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"enumflags2", # Used in enum bitflag features
"pallet-subtensor" # Used in subtensor integration features
]

[dependencies]
subtensor-macros.workspace = true
codec = { workspace = true, features = ["derive", "max-encoded-len"] }
Expand Down
10 changes: 9 additions & 1 deletion pallets/drand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ publish = false
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"anyhow", # Used in error handling features
"ark-bls12-381", # Used in BLS12-381 cryptography features
"ark-crypto-primitives", # Used in arkworks crypto features
"ark-ff" # Used in finite field features
]

[dependencies]
codec = { workspace = true, features = ["derive"] }
scale-info = { workspace = true, features = ["derive"] }
Expand All @@ -19,7 +27,6 @@ serde_json.workspace = true
log.workspace = true
hex = { workspace = true, features = ["serde"] }
sha2.workspace = true
anyhow.workspace = true
# frame deps
frame-benchmarking = { workspace = true, optional = true }
frame-support.workspace = true
Expand All @@ -37,6 +44,7 @@ ark-ec.workspace = true
ark-std.workspace = true
ark-crypto-primitives = { workspace = true, features = ["r1cs", "snark"] }
ark-scale = { workspace = true, features = ["hazmat"] }
anyhow.workspace = true
w3f-bls.workspace = true
sp-keyring.workspace = true
subtensor-macros.workspace = true
Expand Down
11 changes: 11 additions & 0 deletions pallets/subtensor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"ark-bls12-381", # Used in BLS12-381 cryptography features
"ndarray", # Used in matrix operations for consensus
"pallet-proxy", # Used in proxy functionality features
"pallet-transaction-payment", # Used in transaction payment features
"serde-tuple-vec-map", # Used in serialization features
"serde_bytes", # Used in byte serialization features
"serde_with" # Used in advanced serialization features
]

[dependencies]
subtensor-macros.workspace = true
codec = { workspace = true, features = ["derive"] }
Expand Down
7 changes: 7 additions & 0 deletions pallets/subtensor/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ description = "A pallet that adds custom RPC calls to subtensor"
license = "MIT"
publish = false

[package.metadata.cargo-machete]
ignored = [
"pallet-subtensor", # Used in subtensor integration features
"serde", # Used in serialization features
"sp-rpc" # Used in RPC features
]

[lints]
workspace = true

Expand Down
6 changes: 6 additions & 0 deletions pallets/subtensor/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ description = "A pallet that adds a custom runtime API to Subtensor"
license = "MIT"
publish = false

[package.metadata.cargo-machete]
ignored = [
"frame-support", # Used in frame features
"serde" # Used in serialization features
]

[lints]
workspace = true

Expand Down
8 changes: 7 additions & 1 deletion pallets/swap-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ name = "subtensor-swap-interface"
version = "0.1.0"
edition.workspace = true

[package.metadata.cargo-machete]
ignored = [
"codec", # Used in serialization features
"scale-info" # Used in metadata features
]

[dependencies]
codec = { workspace = true, features = ["derive"] }
frame-support.workspace = true
scale-info.workspace = true
scale-info = { workspace = true, features = ["derive"] }
substrate-fixed.workspace = true
subtensor-runtime-common.workspace = true

Expand Down
7 changes: 7 additions & 0 deletions pallets/swap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "pallet-subtensor-swap"
version = "0.1.0"
edition.workspace = true

[package.metadata.cargo-machete]
ignored = [
"pallet-subtensor-swap-runtime-api", # Used in runtime API features
"scale-info", # Used in metadata features
"serde" # Used in serialization features
]

[dependencies]
alloy-primitives.workspace = true
approx.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions pallets/swap/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ version = "1.0.0"
description = "RPC interface for the Swap pallet"
edition.workspace = true

[package.metadata.cargo-machete]
ignored = [
"subtensor-swap-interface" # Used in swap interface features
]

[dependencies]
codec = { workspace = true, features = ["derive"] }
jsonrpsee.workspace = true
Expand Down
10 changes: 9 additions & 1 deletion pallets/swap/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ version = "1.0.0"
description = "Runtime API for the Swap pallet"
edition.workspace = true

[package.metadata.cargo-machete]
ignored = [
"codec", # Used in serialization features
"scale-info", # Used in metadata features
"sp-std", # Used in no-std features
"subtensor-swap-interface" # Used in swap interface features
]

[dependencies]
codec = { workspace = true, features = ["derive"] }
frame-support.workspace = true
scale-info.workspace = true
scale-info = { workspace = true, features = ["derive"] }
sp-api.workspace = true
sp-std.workspace = true
subtensor-macros.workspace = true
Expand Down
6 changes: 6 additions & 0 deletions pallets/transaction-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "subtensor-transaction-fee"
version = "0.1.0"
edition.workspace = true

[package.metadata.cargo-machete]
ignored = [
"codec", # Used in serialization features
"log" # Used in logging features
]

[dependencies]
codec.workspace = true
frame-support.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions pallets/utility/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"scale-info" # Used in metadata features
]

[dependencies]
frame-benchmarking = { workspace = true, optional = true }
frame-support.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions precompiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ repository = "https://github.com/opentensor/subtensor/"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"codec" # Used in serialization features
]

[dependencies]
codec = { workspace = true, features = ["derive"] }
ed25519-dalek = { workspace = true, features = ["alloc"] }
Expand Down
6 changes: 6 additions & 0 deletions primitives/safe-math/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "safe-math"
version = "0.1.0"
edition.workspace = true

[package.metadata.cargo-machete]
ignored = [
"num-traits", # Used in numeric trait features
"sp-std" # Used in no-std features
]

[dependencies]
substrate-fixed.workspace = true
sp-arithmetic.workspace = true
Expand Down
40 changes: 40 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,46 @@ workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo-machete]
ignored = [
"ark-serialize", # Used in drand pallet features and arkworks integration
"fp-account", # Used in EVM/Frontier features
"fp-evm", # Used in EVM/Frontier features
"frame-election-provider-support", # Used in NPoS features
"getrandom", # Used in drand randomness features
"hex", # Used in various serialization and crypto features
"pallet-authority-discovery", # Used in consensus features
"pallet-authorship", # Used in consensus features
"pallet-babe", # Used in consensus features
"pallet-bags-list", # Used in NPoS features
"pallet-election-provider-multi-phase", # Used in NPoS features
"pallet-evm-precompile-modexp", # Used in EVM features
"pallet-evm-precompile-sha3fips", # Used in EVM features
"pallet-evm-precompile-simple", # Used in EVM features
"pallet-fast-unstake", # Used in NPoS features
"pallet-hotfix-sufficients", # Used in EVM/Frontier features
"pallet-nomination-pools", # Used in NPoS features
"pallet-nomination-pools-runtime-api", # Used in NPoS features
"pallet-offences", # Used in consensus features
"pallet-session", # Used in consensus features
"pallet-staking", # Used in NPoS features
"pallet-staking-reward-curve", # Used in NPoS features
"pallet-staking-reward-fn", # Used in NPoS features
"pallet-staking-runtime-api", # Used in NPoS features
"precompile-utils", # Used in EVM precompile features
"rand_chacha", # Used in drand randomness features
"serde_json", # Used in various serialization features
"sha2", # Used in crypto features
"smallvec", # Used in various optimized collections
"sp-authority-discovery", # Used in consensus features
"sp-consensus-grandpa", # Used in consensus features
"sp-consensus-slots", # Used in consensus features
"sp-npos-elections", # Used in NPoS features
"sp-staking", # Used in NPoS features
"tle", # Used in drand features
"w3f-bls" # Used in drand BLS signature features
]

[dependencies]
subtensor-macros.workspace = true
subtensor-custom-rpc-runtime-api.workspace = true
Expand Down
Loading