Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plonky2x/core/src/backend/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod result;

use std::fs::File;
use std::io::{BufReader, Write};
use std::{fs, path};
use std::{env, fs, path};

use clap::Parser;
use log::info;
Expand Down Expand Up @@ -140,6 +140,9 @@ impl<C: Circuit> Plonky2xFunction for C {
AlgebraicHasher<InnerParameters::Field>,
OuterParameters::Config: Serialize,
{
// Setup enviroment variables.
env::set_var("BUILD_DIR", args.build_dir.clone());

// If the request is of type bytes and the wrapper path is not empty, then we need to
// start the gnark wrapper process.
let gnark_wrapper_process = if let ProofRequest::Bytes(_) = request {
Expand Down
6 changes: 4 additions & 2 deletions plonky2x/core/src/backend/prover/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ impl EnvProver {
} else {
let gate_serializer = S::gate_registry::<L, D>();
let generator_serializer = S::generator_registry::<L, D>();
let circuit_path = format!("./build/{}.circuit", circuit_id);
let build_dir = env::var("BUILD_DIR").unwrap_or_else(|_| "./build".to_string());
let circuit_path = format!("{}/{}.circuit", build_dir, circuit_id);
let circuit =
CircuitBuild::<L, D>::load(&circuit_path, &gate_serializer, &generator_serializer)
.unwrap();
Expand All @@ -55,7 +56,8 @@ impl EnvProver {
} else {
let gate_serializer = S::gate_registry::<L, D>();
let generator_serializer = S::generator_registry::<L, D>();
let circuit_path = format!("./build/{}.circuit", circuit_id);
let build_dir = env::var("BUILD_DIR").unwrap_or_else(|_| "./build".to_string());
let circuit_path = format!("{}/{}.circuit", build_dir, circuit_id);
let circuit =
CircuitBuild::<L, D>::load(&circuit_path, &gate_serializer, &generator_serializer)
.unwrap();
Expand Down