-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(zk_toolbox): zk_supervisor prover
subcommand
#2820
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
707285f
add prover info command
Artemka374 9902800
initial changes
Artemka374 4b8e665
some refactoring
Artemka374 0738586
Merge branch 'refs/heads/main' into afo/toolbox-prover/improvements
Artemka374 66f0d24
fix merge, implement insert-version and insert-batch commands
Artemka374 df0cb55
update readme
Artemka374 8f90b34
add automatic creation of witness_inputs dir on init
Artemka374 c0a343b
fix lint
Artemka374 15056f9
fix lint
Artemka374 7c3f3b9
fmt
Artemka374 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 { | ||
Artemka374 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 hidden or 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 { | ||
Artemka374 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.