Skip to content

Commit

Permalink
Inherit stdout/err
Browse files Browse the repository at this point in the history
  • Loading branch information
sergerad committed Nov 20, 2024
1 parent 1e9c06f commit 831b68d
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions scripts/prove_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub fn prove_via_rpc(args: ProveRpcArgs) -> anyhow::Result<()> {
cmd_args.extend_from_slice(leader_args);

// Run the leader command.
let output = Command::new("cargo")
let status = Command::new("cargo")
.args(&cmd_args)
.env("ARITHMETIC_CIRCUIT_SIZE", "16..21")
.env("BYTE_PACKING_CIRCUIT_SIZE", "8..21")
Expand All @@ -141,12 +141,9 @@ pub fn prove_via_rpc(args: ProveRpcArgs) -> anyhow::Result<()> {
.env("MEMORY_CIRCUIT_SIZE", "17..24")
.env("MEMORY_BEFORE_CIRCUIT_SIZE", "16..23")
.env("MEMORY_AFTER_CIRCUIT_SIZE", "7..23")
.output()?;
ensure!(
output.status.success(),
"command failed with {}",
output.status
);
.spawn()?
.wait()?;
ensure!(status.success(), "command failed with {}", status);
Ok(())
}
RunMode::Prove | RunMode::Verify => {
Expand All @@ -156,12 +153,8 @@ pub fn prove_via_rpc(args: ProveRpcArgs) -> anyhow::Result<()> {
cmd_args.extend_from_slice(leader_args);

// Run the leader command.
let output = Command::new("cargo").args(&cmd_args).output()?;
ensure!(
output.status.success(),
"command failed with {}",
output.status
);
let status = Command::new("cargo").args(&cmd_args).spawn()?.wait()?;
ensure!(status.success(), "command failed with {}", status);

// Verify proof if in verify mode.
if let RunMode::Verify = args.mode {
Expand All @@ -171,7 +164,7 @@ pub fn prove_via_rpc(args: ProveRpcArgs) -> anyhow::Result<()> {
.join(format!("b{}.zkproof", block_string(end_block)?));

// Run the verifier command.
let output = Command::new("cargo")
let status = Command::new("cargo")
.args([
"run",
"--release",
Expand All @@ -181,12 +174,9 @@ pub fn prove_via_rpc(args: ProveRpcArgs) -> anyhow::Result<()> {
"-f",
proof_filepath.to_str().unwrap(),
])
.output()?;
ensure!(
output.status.success(),
"command failed with {}",
output.status
);
.spawn()?
.wait()?;
ensure!(status.success(), "command failed with {}", status);
}
Ok(())
}
Expand Down

0 comments on commit 831b68d

Please sign in to comment.