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

This commit is contained in:
joshieDo
2024-07-05 16:49:52 +02:00
committed by GitHub
parent a41c216974
commit c7e34fbd4a
12 changed files with 28 additions and 20 deletions

View File

@ -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

6
Cargo.lock generated
View File

@ -6310,7 +6310,6 @@ version = "1.0.0"
dependencies = [
"alloy-rlp",
"aquamarine",
"arbitrary",
"backon",
"clap",
"confy",
@ -6321,8 +6320,6 @@ dependencies = [
"itertools 0.13.0",
"libc",
"metrics-process",
"proptest",
"proptest-arbitrary-interop",
"reth-basic-payload-builder",
"reth-beacon-consensus",
"reth-blockchain-tree",
@ -6612,6 +6609,7 @@ name = "reth-cli-commands"
version = "1.0.0"
dependencies = [
"ahash",
"arbitrary",
"clap",
"comfy-table",
"confy",
@ -6619,6 +6617,8 @@ dependencies = [
"eyre",
"human_bytes",
"itertools 0.13.0",
"proptest",
"proptest-arbitrary-interop",
"ratatui",
"reth-beacon-consensus",
"reth-chainspec",

View File

@ -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",
@ -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"]

View File

@ -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},
};
@ -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)),
@ -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),

View File

@ -11,4 +11,3 @@ pub mod p2p;
pub mod prune;
pub mod recover;
pub mod stage;
pub mod test_vectors;

View File

@ -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)

2
book/cli/SUMMARY.md vendored
View File

@ -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)

1
book/cli/reth.md vendored
View File

@ -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

View File

@ -45,3 +45,18 @@ 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"
]

View File

@ -10,3 +10,5 @@
pub mod common;
pub mod db;
#[cfg(feature = "dev")]
pub mod test_vectors;