Skip to content

Commit c7e34fb

Browse files
authored
chore: move reth test-vectors to cli/commands with feature (#9329)
1 parent a41c216 commit c7e34fb

File tree

12 files changed

+28
-20
lines changed

12 files changed

+28
-20
lines changed

.github/workflows/bench.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
ref: ${{ github.base_ref || 'main' }}
5151
- name: Generate test vectors
52-
run: cargo run --bin reth -- test-vectors tables
52+
run: cargo run --bin reth --features dev -- test-vectors tables
5353
- name: Save baseline
5454
run: cargo bench -p reth-db --bench iai --profile profiling --features test-utils -- --save-baseline=$BASELINE
5555
- name: Checkout PR

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/reth/Cargo.toml

+2-7
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@ toml = { workspace = true, features = ["display"] }
8787
# metrics
8888
metrics-process.workspace = true
8989

90-
# test vectors generation
91-
proptest.workspace = true
92-
arbitrary.workspace = true
93-
proptest-arbitrary-interop.workspace = true
94-
95-
9690
# async
9791
tokio = { workspace = true, features = [
9892
"sync",
@@ -122,10 +116,11 @@ libc = "0.2"
122116
reth-discv4.workspace = true
123117

124118

125-
126119
[features]
127120
default = ["jemalloc"]
128121

122+
dev = ["reth-cli-commands/dev"]
123+
129124
asm-keccak = ["reth-primitives/asm-keccak"]
130125

131126
jemalloc = ["dep:tikv-jemallocator", "reth-node-core/jemalloc"]

bin/reth/src/cli/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
commands::{
99
config_cmd, debug_cmd, dump_genesis, import, init_cmd, init_state,
1010
node::{self, NoArgs},
11-
p2p, prune, recover, stage, test_vectors,
11+
p2p, prune, recover, stage,
1212
},
1313
version::{LONG_VERSION, SHORT_VERSION},
1414
};
@@ -161,6 +161,7 @@ impl<Ext: clap::Args + fmt::Debug> Cli<Ext> {
161161
Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute()),
162162
Commands::Stage(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
163163
Commands::P2P(command) => runner.run_until_ctrl_c(command.execute()),
164+
#[cfg(feature = "dev")]
164165
Commands::TestVectors(command) => runner.run_until_ctrl_c(command.execute()),
165166
Commands::Config(command) => runner.run_until_ctrl_c(command.execute()),
166167
Commands::Debug(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
@@ -214,8 +215,9 @@ pub enum Commands<Ext: clap::Args + fmt::Debug = NoArgs> {
214215
#[command(name = "p2p")]
215216
P2P(p2p::Command),
216217
/// Generate Test Vectors
218+
#[cfg(feature = "dev")]
217219
#[command(name = "test-vectors")]
218-
TestVectors(test_vectors::Command),
220+
TestVectors(reth_cli_commands::test_vectors::Command),
219221
/// Write config to stdout
220222
#[command(name = "config")]
221223
Config(config_cmd::Command),

bin/reth/src/commands/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ pub mod p2p;
1111
pub mod prune;
1212
pub mod recover;
1313
pub mod stage;
14-
pub mod test_vectors;

book/SUMMARY.md

-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
- [`reth p2p`](./cli/reth/p2p.md)
6262
- [`reth p2p header`](./cli/reth/p2p/header.md)
6363
- [`reth p2p body`](./cli/reth/p2p/body.md)
64-
- [`reth test-vectors`](./cli/reth/test-vectors.md)
65-
- [`reth test-vectors tables`](./cli/reth/test-vectors/tables.md)
6664
- [`reth config`](./cli/reth/config.md)
6765
- [`reth debug`](./cli/reth/debug.md)
6866
- [`reth debug execution`](./cli/reth/debug/execution.md)

book/cli/SUMMARY.md

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
- [`reth p2p`](./reth/p2p.md)
3333
- [`reth p2p header`](./reth/p2p/header.md)
3434
- [`reth p2p body`](./reth/p2p/body.md)
35-
- [`reth test-vectors`](./reth/test-vectors.md)
36-
- [`reth test-vectors tables`](./reth/test-vectors/tables.md)
3735
- [`reth config`](./reth/config.md)
3836
- [`reth debug`](./reth/debug.md)
3937
- [`reth debug execution`](./reth/debug/execution.md)

book/cli/reth.md

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Commands:
1515
db Database debugging utilities
1616
stage Manipulate individual stages
1717
p2p P2P Debugging utilities
18-
test-vectors Generate Test Vectors
1918
config Write config to stdout
2019
debug Various debug routines
2120
recover Scripts for node recovery

crates/cli/commands/Cargo.toml

+16-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,19 @@ comfy-table = "7.0"
4444
crossterm = "0.27.0"
4545
ratatui = { version = "0.27", default-features = false, features = [
4646
"crossterm",
47-
] }
47+
] }
48+
49+
# reth test-vectors
50+
proptest = { workspace = true, optional = true }
51+
arbitrary = { workspace = true, optional = true }
52+
proptest-arbitrary-interop = { workspace = true, optional = true }
53+
54+
[features]
55+
default = []
56+
dev = [
57+
"dep:proptest",
58+
"dep:arbitrary",
59+
"dep:proptest-arbitrary-interop",
60+
"reth-primitives/arbitrary",
61+
"reth-db-api/arbitrary"
62+
]

crates/cli/commands/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010

1111
pub mod common;
1212
pub mod db;
13+
#[cfg(feature = "dev")]
14+
pub mod test_vectors;

0 commit comments

Comments
 (0)