forked from matter-labs/zksync-era
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zk_toolbox):
zk_supervisor prover
subcommand (matter-labs#2820)
## What ❔ Add prover subcommand for `zk_supervisor`. Add the following subcommand: * `zk_supervisor prover info` - Prints information about current prover setup. * `zk_supervisor prover insert-version` - Insert new protocol version in prover database(integration with `prover_cli`). * `zk_supervisor prover insert-batch` - Insert new batch in prover database(integration with `prover_cli`). Add automatic creation of `prover/artifacts/witness_inputs` dirs if the storage is file backed on init. ## Why ❔ To improve UX of working with provers. ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`.
- Loading branch information
1 parent
d256092
commit 3506731
Showing
23 changed files
with
391 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,12 @@ git clone [email protected]:matter-labs/zksync-era.git | |
cargo install prover_cli | ||
``` | ||
|
||
Or | ||
|
||
``` | ||
cargo +nightly-2024-08-01 install --git https://github.com/matter-labs/zksync-era/ --locked prover_cli --force | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
zk_toolbox/crates/zk_inception/src/commands/prover/utils.rs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use clap::Parser; | ||
|
||
#[derive(Debug, Parser)] | ||
pub struct InsertBatchArgs { | ||
#[clap(long)] | ||
pub number: Option<u32>, | ||
#[clap(long, default_value = "false")] | ||
pub default: bool, | ||
#[clap(long)] | ||
pub version: Option<String>, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct InsertBatchArgsFinal { | ||
pub number: u32, | ||
pub version: String, | ||
} | ||
|
||
impl InsertBatchArgs { | ||
pub(crate) fn fill_values_with_prompts(self, era_version: String) -> InsertBatchArgsFinal { | ||
let number = self.number.unwrap_or_else(|| { | ||
common::Prompt::new("Enter the number of the batch to insert").ask() | ||
}); | ||
|
||
if self.default { | ||
return InsertBatchArgsFinal { | ||
number, | ||
version: era_version, | ||
}; | ||
} | ||
|
||
let version = self.version.unwrap_or_else(|| { | ||
common::Prompt::new("Enter the version of the batch to insert") | ||
.default(&era_version) | ||
.ask() | ||
}); | ||
|
||
InsertBatchArgsFinal { number, version } | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use clap::Parser; | ||
|
||
#[derive(Debug, Parser)] | ||
pub struct InsertVersionArgs { | ||
#[clap(long, default_value = "false")] | ||
pub default: bool, | ||
#[clap(long)] | ||
pub version: Option<String>, | ||
#[clap(long)] | ||
pub snark_wrapper: Option<String>, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct InsertVersionArgsFinal { | ||
pub snark_wrapper: String, | ||
pub version: String, | ||
} | ||
|
||
impl InsertVersionArgs { | ||
pub(crate) fn fill_values_with_prompts( | ||
self, | ||
era_version: String, | ||
snark_wrapper: String, | ||
) -> InsertVersionArgsFinal { | ||
if self.default { | ||
return InsertVersionArgsFinal { | ||
snark_wrapper, | ||
version: era_version, | ||
}; | ||
} | ||
|
||
let version = self.version.unwrap_or_else(|| { | ||
common::Prompt::new("Enter the version of the protocol to insert") | ||
.default(&era_version) | ||
.ask() | ||
}); | ||
|
||
let snark_wrapper = self.snark_wrapper.unwrap_or_else(|| { | ||
common::Prompt::new("Enter the snark wrapper of the protocol to insert") | ||
.default(&snark_wrapper) | ||
.ask() | ||
}); | ||
|
||
InsertVersionArgsFinal { | ||
snark_wrapper, | ||
version, | ||
} | ||
} | ||
} |
Oops, something went wrong.