Skip to content

Commit d3dbd33

Browse files
chore: add final_proof_name input to cli prove command (#188)
## What ❔ * [x] Add `final_proof_name` input to cli prove command. <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ To simplify the usage of CLI in protocol upgrade scripts, remove the need to copy the hardcoded proof name. <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [x] No ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted.
1 parent 3d98d74 commit d3dbd33

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tools/cli/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ enum Commands {
8585
input: InputConfig,
8686
#[arg(long, default_value = "output")]
8787
output_dir: String,
88+
89+
#[arg(long, default_value = "final_program_proof.json")]
90+
final_proof_name: String,
91+
8892
#[arg(long, value_enum, default_value = "standard")]
8993
machine: Machine,
9094
// If proving for recursion - you must also pass the previous metadata info.
@@ -288,6 +292,7 @@ fn main() {
288292
bin,
289293
input,
290294
output_dir,
295+
final_proof_name,
291296
machine,
292297
prev_metadata,
293298
cycles,
@@ -300,6 +305,7 @@ fn main() {
300305
create_proofs(
301306
bin,
302307
output_dir,
308+
final_proof_name,
303309
input_data,
304310
prev_metadata,
305311
machine,

tools/cli/src/prover_utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub fn u32_from_hex_string(hex_string: &str) -> Vec<u32> {
6161
pub fn create_proofs(
6262
bin_path: &String,
6363
output_dir: &String,
64+
final_proof_name: &String,
6465
input_data: Option<Vec<u32>>,
6566
prev_metadata: &Option<String>,
6667
machine: &Machine,
@@ -176,7 +177,7 @@ pub fn create_proofs(
176177

177178
serialize_to_file(
178179
&program_proof,
179-
&Path::new(output_dir).join("final_program_proof.json"),
180+
&Path::new(output_dir).join(final_proof_name),
180181
);
181182
}
182183
ProvingLimit::Snark => todo!(),

0 commit comments

Comments
 (0)