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: with:
ref: ${{ github.base_ref || 'main' }} ref: ${{ github.base_ref || 'main' }}
- name: Generate test vectors - 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 - name: Save baseline
run: cargo bench -p reth-db --bench iai --profile profiling --features test-utils -- --save-baseline=$BASELINE run: cargo bench -p reth-db --bench iai --profile profiling --features test-utils -- --save-baseline=$BASELINE
- name: Checkout PR - name: Checkout PR

6
Cargo.lock generated
View File

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

View File

@ -87,12 +87,6 @@ toml = { workspace = true, features = ["display"] }
# metrics # metrics
metrics-process.workspace = true metrics-process.workspace = true
# test vectors generation
proptest.workspace = true
arbitrary.workspace = true
proptest-arbitrary-interop.workspace = true
# async # async
tokio = { workspace = true, features = [ tokio = { workspace = true, features = [
"sync", "sync",
@ -122,10 +116,11 @@ libc = "0.2"
reth-discv4.workspace = true reth-discv4.workspace = true
[features] [features]
default = ["jemalloc"] default = ["jemalloc"]
dev = ["reth-cli-commands/dev"]
asm-keccak = ["reth-primitives/asm-keccak"] asm-keccak = ["reth-primitives/asm-keccak"]
jemalloc = ["dep:tikv-jemallocator", "reth-node-core/jemalloc"] jemalloc = ["dep:tikv-jemallocator", "reth-node-core/jemalloc"]

View File

@ -8,7 +8,7 @@ use crate::{
commands::{ commands::{
config_cmd, debug_cmd, dump_genesis, import, init_cmd, init_state, config_cmd, debug_cmd, dump_genesis, import, init_cmd, init_state,
node::{self, NoArgs}, node::{self, NoArgs},
p2p, prune, recover, stage, test_vectors, p2p, prune, recover, stage,
}, },
version::{LONG_VERSION, SHORT_VERSION}, 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::Db(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Stage(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)), Commands::Stage(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Commands::P2P(command) => runner.run_until_ctrl_c(command.execute()), Commands::P2P(command) => runner.run_until_ctrl_c(command.execute()),
#[cfg(feature = "dev")]
Commands::TestVectors(command) => runner.run_until_ctrl_c(command.execute()), Commands::TestVectors(command) => runner.run_until_ctrl_c(command.execute()),
Commands::Config(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)), 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")] #[command(name = "p2p")]
P2P(p2p::Command), P2P(p2p::Command),
/// Generate Test Vectors /// Generate Test Vectors
#[cfg(feature = "dev")]
#[command(name = "test-vectors")] #[command(name = "test-vectors")]
TestVectors(test_vectors::Command), TestVectors(reth_cli_commands::test_vectors::Command),
/// Write config to stdout /// Write config to stdout
#[command(name = "config")] #[command(name = "config")]
Config(config_cmd::Command), Config(config_cmd::Command),

View File

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

View File

@ -61,8 +61,6 @@
- [`reth p2p`](./cli/reth/p2p.md) - [`reth p2p`](./cli/reth/p2p.md)
- [`reth p2p header`](./cli/reth/p2p/header.md) - [`reth p2p header`](./cli/reth/p2p/header.md)
- [`reth p2p body`](./cli/reth/p2p/body.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 config`](./cli/reth/config.md)
- [`reth debug`](./cli/reth/debug.md) - [`reth debug`](./cli/reth/debug.md)
- [`reth debug execution`](./cli/reth/debug/execution.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`](./reth/p2p.md)
- [`reth p2p header`](./reth/p2p/header.md) - [`reth p2p header`](./reth/p2p/header.md)
- [`reth p2p body`](./reth/p2p/body.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 config`](./reth/config.md)
- [`reth debug`](./reth/debug.md) - [`reth debug`](./reth/debug.md)
- [`reth debug execution`](./reth/debug/execution.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 db Database debugging utilities
stage Manipulate individual stages stage Manipulate individual stages
p2p P2P Debugging utilities p2p P2P Debugging utilities
test-vectors Generate Test Vectors
config Write config to stdout config Write config to stdout
debug Various debug routines debug Various debug routines
recover Scripts for node recovery recover Scripts for node recovery

View File

@ -44,4 +44,19 @@ comfy-table = "7.0"
crossterm = "0.27.0" crossterm = "0.27.0"
ratatui = { version = "0.27", default-features = false, features = [ ratatui = { version = "0.27", default-features = false, features = [
"crossterm", "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 common;
pub mod db; pub mod db;
#[cfg(feature = "dev")]
pub mod test_vectors;