Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move reth test-vectors to cli/commands with feature #9329

Merged
merged 2 commits into from
Jul 5, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
ref: ${{ github.base_ref || 'main' }}
- name: Generate test vectors
run: cargo run --bin reth -- test-vectors tables
run: cargo run --bin reth --features dev -- test-vectors tables
- name: Save baseline
run: cargo bench -p reth-db --bench iai --profile profiling --features test-utils -- --save-baseline=$BASELINE
- name: Checkout PR
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

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

9 changes: 2 additions & 7 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ toml = { workspace = true, features = ["display"] }
# metrics
metrics-process.workspace = true

# test vectors generation
proptest.workspace = true
arbitrary.workspace = true
proptest-arbitrary-interop.workspace = true


# async
tokio = { workspace = true, features = [
"sync",
Expand Down Expand Up @@ -122,10 +116,11 @@ libc = "0.2"
reth-discv4.workspace = true



[features]
default = ["jemalloc"]

dev = ["reth-cli-commands/dev"]

asm-keccak = ["reth-primitives/asm-keccak"]

jemalloc = ["dep:tikv-jemallocator", "reth-node-core/jemalloc"]
Expand Down
6 changes: 4 additions & 2 deletions bin/reth/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
commands::{
config_cmd, debug_cmd, dump_genesis, import, init_cmd, init_state,
node::{self, NoArgs},
p2p, prune, recover, stage, test_vectors,
p2p, prune, recover, stage,
},
version::{LONG_VERSION, SHORT_VERSION},
};
Expand Down Expand Up @@ -161,6 +161,7 @@ impl<Ext: clap::Args + fmt::Debug> Cli<Ext> {
Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Stage(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Commands::P2P(command) => runner.run_until_ctrl_c(command.execute()),
#[cfg(feature = "dev")]
Commands::TestVectors(command) => runner.run_until_ctrl_c(command.execute()),
Commands::Config(command) => runner.run_until_ctrl_c(command.execute()),
Commands::Debug(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Expand Down Expand Up @@ -214,8 +215,9 @@ pub enum Commands<Ext: clap::Args + fmt::Debug = NoArgs> {
#[command(name = "p2p")]
P2P(p2p::Command),
/// Generate Test Vectors
#[cfg(feature = "dev")]
#[command(name = "test-vectors")]
TestVectors(test_vectors::Command),
TestVectors(reth_cli_commands::test_vectors::Command),
/// Write config to stdout
#[command(name = "config")]
Config(config_cmd::Command),
Expand Down
1 change: 0 additions & 1 deletion bin/reth/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ pub mod p2p;
pub mod prune;
pub mod recover;
pub mod stage;
pub mod test_vectors;
2 changes: 0 additions & 2 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
- [`reth p2p`](./cli/reth/p2p.md)
- [`reth p2p header`](./cli/reth/p2p/header.md)
- [`reth p2p body`](./cli/reth/p2p/body.md)
- [`reth test-vectors`](./cli/reth/test-vectors.md)
- [`reth test-vectors tables`](./cli/reth/test-vectors/tables.md)
- [`reth config`](./cli/reth/config.md)
- [`reth debug`](./cli/reth/debug.md)
- [`reth debug execution`](./cli/reth/debug/execution.md)
Expand Down
2 changes: 0 additions & 2 deletions book/cli/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
- [`reth p2p`](./reth/p2p.md)
- [`reth p2p header`](./reth/p2p/header.md)
- [`reth p2p body`](./reth/p2p/body.md)
- [`reth test-vectors`](./reth/test-vectors.md)
- [`reth test-vectors tables`](./reth/test-vectors/tables.md)
- [`reth config`](./reth/config.md)
- [`reth debug`](./reth/debug.md)
- [`reth debug execution`](./reth/debug/execution.md)
Expand Down
1 change: 0 additions & 1 deletion book/cli/reth.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Commands:
db Database debugging utilities
stage Manipulate individual stages
p2p P2P Debugging utilities
test-vectors Generate Test Vectors
config Write config to stdout
debug Various debug routines
recover Scripts for node recovery
Expand Down
17 changes: 16 additions & 1 deletion crates/cli/commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,19 @@ comfy-table = "7.0"
crossterm = "0.27.0"
ratatui = { version = "0.27", default-features = false, features = [
"crossterm",
] }
] }

# reth test-vectors
proptest = { workspace = true, optional = true }
arbitrary = { workspace = true, optional = true }
proptest-arbitrary-interop = { workspace = true, optional = true }

[features]
default = []
dev = [
"dep:proptest",
"dep:arbitrary",
"dep:proptest-arbitrary-interop",
"reth-primitives/arbitrary",
"reth-db-api/arbitrary"
]
2 changes: 2 additions & 0 deletions crates/cli/commands/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@

pub mod common;
pub mod db;
#[cfg(feature = "dev")]
pub mod test_vectors;
Loading