Skip to content

Commit ce62440

Browse files
committed
Work
1 parent afdb17a commit ce62440

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

relations/src/r1cs/constraint_system.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl<F: Field> ConstraintSystem<F> {
298298
}
299299
}
300300
self.num_constraints += 1;
301-
301+
302302
Ok(())
303303
}
304304

@@ -541,11 +541,15 @@ impl<F: Field> ConstraintSystem<F> {
541541
/// Optimize the constraint system (either by outlining or inlining,
542542
/// if an optimization goal is set).
543543
pub fn optimize(&mut self) {
544-
match self.optimization_goal {
545-
OptimizationGoal::None => self.inline_all_lcs(),
546-
OptimizationGoal::Constraints => self.inline_all_lcs(),
547-
OptimizationGoal::Weight => self.outline_lcs(),
548-
};
544+
// In verify mode we don't have any linear combinations; all variables
545+
// are instance variables, and there are no generated constraints
546+
if !self.is_in_verify_mode() {
547+
match self.optimization_goal {
548+
OptimizationGoal::None => self.inline_all_lcs(),
549+
OptimizationGoal::Constraints => self.inline_all_lcs(),
550+
OptimizationGoal::Weight => self.outline_lcs(),
551+
};
552+
}
549553
}
550554

551555
/// This step must be called after constraint generation has completed, and

0 commit comments

Comments
 (0)