Skip to content

Commit

Permalink
fix publics bug halo2
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoalt committed Sep 20, 2024
1 parent b381adb commit 7d22174
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions backend/src/halo2/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ impl Halo2Prover {
) -> Result<(Vec<u8>, Vec<Vec<Fr>>), String> {
log::info!("Starting proof generation...");

let circuit = PowdrCircuit::new(self.analyzed.clone(), &self.fixed)
.with_witgen_callback(witgen_callback)
.with_witness(witness);
let publics = vec![circuit.instance_column()];
// Create static circuit (no witness).
let circuit = PowdrCircuit::new(self.analyzed.clone(), &self.fixed);

log::info!("Generating PK for snark...");
let vk = match self.vkey {
Expand All @@ -139,6 +137,13 @@ impl Halo2Prover {
log::info!("Generating proof...");
let start = Instant::now();

// Add witness to the circuit structure.
let circuit = circuit
.with_witgen_callback(witgen_callback)
.with_witness(witness);

let publics = vec![circuit.instance_column()];

let proof = gen_proof::<_, _, TW>(&self.params, &pk, circuit, &publics)?;

let duration = start.elapsed();
Expand Down

0 comments on commit 7d22174

Please sign in to comment.