Skip to content

Commit

Permalink
Fixed missing segment in circuit path
Browse files Browse the repository at this point in the history
- Was missing `zero_bin`.
- Also made the circuit directory error a bit more helpful (now also
  contains underlying IO error).
  • Loading branch information
BGluth committed Jul 10, 2024
1 parent 788cf3c commit 3fbe039
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions zero_bin/common/src/prover_state/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ pub(crate) trait DiskResource {

// Create the base folder if non-existent.
if std::fs::metadata(&circuits_dir).is_err() {
std::fs::create_dir(&circuits_dir).map_err(|_| {
DiskResourceError::IoError::<Self::Error>(std::io::Error::other(
format!("Could not create circuits folder at {}", circuits_dir),
))
std::fs::create_dir(&circuits_dir).map_err(|err| {
DiskResourceError::IoError::<Self::Error>(std::io::Error::other(format!(
"Could not create circuits folder at {} (err: {})", err,
circuits_dir
)))
})?;
}

Expand Down Expand Up @@ -282,6 +283,6 @@ fn prover_to_disk(
/// current directory.
fn relative_circuit_dir_path() -> String {
env::var(ZK_EVM_WORKSPACE_DIR_ENV)
.map(|p| format!("{}tools/{}", p, CIRCUITS_DIR))
.map(|p| format!("{}zero_bin/tools/{}", p, CIRCUITS_DIR))
.unwrap_or_else(|_| CIRCUITS_DIR.to_string())
}
2 changes: 1 addition & 1 deletion zero_bin/tools/prove_rpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fi
TOOLS_DIR=$(dirname $(realpath "$0"))

# Set the environment variable to let the binary know that we're running in the project workspace.
export CARGO_WORKSPACE_DIR="${TOOLS_DIR}/../"
export CARGO_WORKSPACE_DIR="${TOOLS_DIR}/../../"

PROOF_OUTPUT_DIR="${TOOLS_DIR}/proofs"
OUT_LOG_PATH="${PROOF_OUTPUT_DIR}/b$1_$2.log"
Expand Down
2 changes: 1 addition & 1 deletion zero_bin/tools/prove_stdio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ VERIFY_OUT_PATH="${TOOLS_DIR}/verify.out"
TEST_OUT_PATH="${TOOLS_DIR}/test.out"

# Set the environment variable to let the binary know that we're running in the project workspace.
export ZK_EVM_WORKSPACE_DIR="${TOOLS_DIR}/../"
export ZK_EVM_WORKSPACE_DIR="${TOOLS_DIR}/../../"

# Configured Rayon and Tokio with rough defaults
export RAYON_NUM_THREADS=$num_procs
Expand Down

0 comments on commit 3fbe039

Please sign in to comment.