From 3c80076be60d0cd5bc8e58e95e08f4d992acab28 Mon Sep 17 00:00:00 2001 From: Joaquin Carletti Date: Tue, 20 Aug 2024 18:09:58 -0300 Subject: [PATCH 1/2] updates README --- prover/crates/bin/prover_cli/README.md | 107 ++++++++++++++++++------- 1 file changed, 76 insertions(+), 31 deletions(-) diff --git a/prover/crates/bin/prover_cli/README.md b/prover/crates/bin/prover_cli/README.md index 6a9091aef25e..919a0e9f39d6 100644 --- a/prover/crates/bin/prover_cli/README.md +++ b/prover/crates/bin/prover_cli/README.md @@ -6,28 +6,35 @@ CLI tool for performing maintenance of a ZKsync Prover ``` git clone git@github.com:matter-labs/zksync-era.git -cargo install -p prover_cli +cargo install prover_cli ``` -> This should be `cargo install zksync-prover-cli` or something similar ideally. - ## Usage -> NOTE: For the moment it is necessary to run the CLI commands with `zk f`. - ``` -Usage: prover_cli +Usage: prover_cli [DB_URL] Commands: + debug-proof file-info + config + delete status - help Print this message or the help of the given subcommand(s) + requeue + restart + stats Displays L1 Batch proving stats for a given period + help Print this message or the help of the given subcommand(s) + +Arguments: + [DB_URL] [env: PLI__DB_URL=] [default: postgres://postgres:notsecurepassword@localhost/prover_local] Options: -h, --help Print help -V, --version Print version ``` +Warning: If this tool is being used outside the directory where the zksync-era repository is located, the configuration is not persistent, so the database URL needs to be set each time a new command that requires it is called!. Work is being done to improve this. + ### `prover_cli file-info` Displays the information about a given file. @@ -84,6 +91,7 @@ Usage: prover_cli status Commands: batch + l1 help Print this message or the help of the given subcommand(s) Options: @@ -119,15 +127,18 @@ Scheduler: In progress ⌛️ > Compressor job not found 🚫 ``` +NOTE: With the --verbose flag, much more detailed information about each stage of the process is displayed. + #### `prover_cli status l1` Retrieve information about the state of the batches sent to L1 and compare the contract hashes in L1 with those stored in the prover database. + #### Example Output ``` -zk f run --release -- status l1 +prover_cli status l1 ====== L1 Status ====== State keeper: First batch: 0, recent batch: 10 @@ -151,15 +162,43 @@ DB hash: 0x0000000000000000000000000000000000000000000000000000000000000000 ### `prover_cli requeue` -TODO +Requeue all the stuck jobs for a specific batch. + +``` +Usage: prover_cli requeue [OPTIONS] --batch + +Options: + -b, --batch + --max-attempts Maximum number of attempts to re-queue a job. Default value is 10. NOTE: this argument is temporary and will be deprecated once the `config` command is implemented [default: 10] + -h, --help Print help +``` ### `prover_cli delete` -TODO +Delete all the data from the prover database. + +``` +Usage: prover_cli delete [OPTIONS] + +Options: + -a, --all Delete data from all batches + -b, --batch Batch number to delete [default: 0] + -h, --help Print help +``` ### `prover_cli config` -TODO +It allows you to change the CLI configuration; currently, it only lets you change the database URL, but work is being done to also include information about the L1 contracts for when they are not set in the environment variables. + +``` +Usage: prover_cli config [DB_URL] + +Arguments: + [DB_URL] [env: PLI__DB_URL=] [default: postgres://postgres:notsecurepassword@localhost/prover_local] + +Options: + -h, --help Print help +``` ### `prover_cli debug-proof` @@ -191,25 +230,31 @@ assertion `left == right` failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` +### `prover_cli debug-proof` + +TODO + ## Development Status -| **Command** | **Subcommand** | **Flags** | **Status** | -| ----------- | -------------- | --------------------------------- | ---------- | -| `status` | `batch` | `-n ` | ✅ | -| | | `-v, --verbose` | 🏗️ | -| | `l1` | | 🏗️ | -| `restart` | `batch` | `-n ` | ❌ | -| | `jobs` | `-n ` | ❌ | -| | | `-bwg, --basic-witness-generator` | ❌ | -| | | `-lwg, --leaf-witness-generator` | ❌ | -| | | `-nwg, --node-witness-generator` | ❌ | -| | | `-rt, --recursion-tip` | ❌ | -| | | `-s, --scheduler` | ❌ | -| | | `-c, --compressor` | ❌ | -| | | `-f, --failed` | ❌ | -| `delete` | | `-n ` | 🏗️ | -| | | `-a, --all` | 🏗️ | -| `requeue` | | `—b, --batch ` | 🏗️ | -| | | `-a, --all` | 🏗️ | -| `config` | | `--db-url ` | ❌ | -| | | `--max-attempts ` | ❌ | +| **Command** | **Subcommand** | **Flags** | **Status** | +| ----------- | -------------- | --------------------------------- | ---------- | +| `status` | `batch` | `-n ` | ✅ | +| | | `-v, --verbose` | ✅️ | +| | `l1` | | ✅️ | +| `restart` | `batch` | `-n ` | ✅ | +| | `jobs` | `-n ` | ️🏗️ | +| | | `-bwg, --basic-witness-generator` | 🏗️ | +| | | `-lwg, --leaf-witness-generator` | 🏗️ | +| | | `-nwg, --node-witness-generator` | 🏗️ | +| | | `-rt, --recursion-tip` | 🏗️ | +| | | `-s, --scheduler` | 🏗️ | +| | | `-c, --compressor` | 🏗️ | +| | | `-f, --failed` | 🏗 | +| `delete` | | `-n ` | ✅️️ | +| | | `-a, --all` | ️️✅️️️️️️ | +| `requeue` | | `—b, --batch ` | ✅️ | +| | | `-a, --all` | ✅️️ | +| `config` | | `--db-url ` | 🏗 | +| `debug-proof`| | `--file ` | ✅️ | +| `file-info` | | `--file-path ` | ✅️ | +| `stats` | | `--period ` | ✅️ | \ No newline at end of file From e3beb10cbf7f49d23e18e1510f9fd873520babb3 Mon Sep 17 00:00:00 2001 From: Joaquin Carletti Date: Tue, 20 Aug 2024 18:10:37 -0300 Subject: [PATCH 2/2] updates README --- prover/crates/bin/prover_cli/README.md | 52 +++++++++++++------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/prover/crates/bin/prover_cli/README.md b/prover/crates/bin/prover_cli/README.md index 919a0e9f39d6..2d57e0b56495 100644 --- a/prover/crates/bin/prover_cli/README.md +++ b/prover/crates/bin/prover_cli/README.md @@ -33,7 +33,9 @@ Options: -V, --version Print version ``` -Warning: If this tool is being used outside the directory where the zksync-era repository is located, the configuration is not persistent, so the database URL needs to be set each time a new command that requires it is called!. Work is being done to improve this. +Warning: If this tool is being used outside the directory where the zksync-era repository is located, the configuration +is not persistent, so the database URL needs to be set each time a new command that requires it is called!. Work is +being done to improve this. ### `prover_cli file-info` @@ -134,7 +136,6 @@ NOTE: With the --verbose flag, much more detailed information about each stage o Retrieve information about the state of the batches sent to L1 and compare the contract hashes in L1 with those stored in the prover database. - #### Example Output ``` @@ -188,7 +189,8 @@ Options: ### `prover_cli config` -It allows you to change the CLI configuration; currently, it only lets you change the database URL, but work is being done to also include information about the L1 contracts for when they are not set in the environment variables. +It allows you to change the CLI configuration; currently, it only lets you change the database URL, but work is being +done to also include information about the L1 contracts for when they are not set in the environment variables. ``` Usage: prover_cli config [DB_URL] @@ -236,25 +238,25 @@ TODO ## Development Status -| **Command** | **Subcommand** | **Flags** | **Status** | -| ----------- | -------------- | --------------------------------- | ---------- | -| `status` | `batch` | `-n ` | ✅ | -| | | `-v, --verbose` | ✅️ | -| | `l1` | | ✅️ | -| `restart` | `batch` | `-n ` | ✅ | -| | `jobs` | `-n ` | ️🏗️ | -| | | `-bwg, --basic-witness-generator` | 🏗️ | -| | | `-lwg, --leaf-witness-generator` | 🏗️ | -| | | `-nwg, --node-witness-generator` | 🏗️ | -| | | `-rt, --recursion-tip` | 🏗️ | -| | | `-s, --scheduler` | 🏗️ | -| | | `-c, --compressor` | 🏗️ | -| | | `-f, --failed` | 🏗 | -| `delete` | | `-n ` | ✅️️ | -| | | `-a, --all` | ️️✅️️️️️️ | -| `requeue` | | `—b, --batch ` | ✅️ | -| | | `-a, --all` | ✅️️ | -| `config` | | `--db-url ` | 🏗 | -| `debug-proof`| | `--file ` | ✅️ | -| `file-info` | | `--file-path ` | ✅️ | -| `stats` | | `--period ` | ✅️ | \ No newline at end of file +| **Command** | **Subcommand** | **Flags** | **Status** | +| ------------- | -------------- | --------------------------------- | ---------- | +| `status` | `batch` | `-n ` | ✅ | +| | | `-v, --verbose` | ✅️ | +| | `l1` | | ✅️ | +| `restart` | `batch` | `-n ` | ✅ | +| | `jobs` | `-n ` | ️🏗️ | +| | | `-bwg, --basic-witness-generator` | 🏗️ | +| | | `-lwg, --leaf-witness-generator` | 🏗️ | +| | | `-nwg, --node-witness-generator` | 🏗️ | +| | | `-rt, --recursion-tip` | 🏗️ | +| | | `-s, --scheduler` | 🏗️ | +| | | `-c, --compressor` | 🏗️ | +| | | `-f, --failed` | 🏗 | +| `delete` | | `-n ` | ✅️️ | +| | | `-a, --all` | ️️✅️️️️️️ | +| `requeue` | | `—b, --batch ` | ✅️ | +| | | `-a, --all` | ✅️️ | +| `config` | | `--db-url ` | 🏗 | +| `debug-proof` | | `--file ` | ✅️ | +| `file-info` | | `--file-path ` | ✅️ | +| `stats` | | `--period ` | ✅️ |