Skip to content

Commit

Permalink
Add check whether prove_batch found duplicate proving keys
Browse files Browse the repository at this point in the history
  • Loading branch information
vicsn committed Dec 6, 2023
1 parent 1bc011e commit b86e3ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions synthesizer/snark/src/proving_key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ impl<N: Network> ProvingKey<N> {
let timer = std::time::Instant::now();

// Prepare the instances.
let instances = assignments
.map(|(proving_key, assignments)| (proving_key.deref(), assignments))
.collect::<BTreeMap<_, _>>();
let mut instances = BTreeMap::default();
for (proving_key, assignments) in assignments {
let previous_entry = instances.insert(proving_key.deref(), assignments);
ensure!(previous_entry.is_none(), "prove_batch found duplicate proving keys");
}

// Retrieve the proving parameters.
let universal_prover = N::varuna_universal_prover();
Expand Down

0 comments on commit b86e3ea

Please sign in to comment.