Skip to content

Commit

Permalink
chore(witnessgen): error messages (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Oct 9, 2024
1 parent 775b295 commit 944d19d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ execution-reports/
**/rollup-config.json

# DB
db/*
db

# Stdins
stdins

**/bin/op-proposer

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
1 change: 1 addition & 0 deletions utils/host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ futures.workspace = true
num-format.workspace = true
serde.workspace = true
reqwest.workspace = true
log.workspace = true

# sp1
sp1-sdk.workspace = true
Expand Down
8 changes: 5 additions & 3 deletions utils/host/src/witnessgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub const WITNESSGEN_TIMEOUT: Duration = Duration::from_secs(1200);
struct WitnessGenProcess {
child: tokio::process::Child,
exec: String,
host_cli: HostCli,
}

/// Stateful executor for witness generation. Useful for executing several witness generation
Expand Down Expand Up @@ -95,6 +96,7 @@ impl WitnessGenExecutor {
self.ongoing_processes.push(WitnessGenProcess {
child,
exec: host_cli.exec.clone().unwrap(),
host_cli: host_cli.clone(),
});
Ok(())
}
Expand Down Expand Up @@ -135,16 +137,16 @@ impl WitnessGenExecutor {
result = child.child.wait() => {
match result {
Ok(status) if !status.success() => {
return Err(anyhow::anyhow!("Witness generation process exited because it failed."));
return Err(anyhow::anyhow!("Witness generation process for end block {} failed.", child.host_cli.l2_block_number));
}
Err(e) => {
return Err(anyhow::anyhow!("Failed to get witness generation process status: {}", e));
return Err(anyhow::anyhow!("Failed to get witness generation process status for end block {}: {}", child.host_cli.l2_block_number, e));
}
_ => {}
}
}
_ = tokio::time::sleep(self.timeout) => {
return Err(anyhow::anyhow!("Witness generation process timed out."));
return Err(anyhow::anyhow!("Witness generation process for end block {} timed out.", child.host_cli.l2_block_number));
}
}
}
Expand Down

0 comments on commit 944d19d

Please sign in to comment.