Merge pull request #462 from mir-protocol/disallow_degree_1

Disallow `quotient_degree_factor = 1`
This commit is contained in:
wborgeaud 2022-02-03 18:11:45 +01:00 committed by GitHub
commit 77af9fa4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -651,7 +651,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
// `quotient_degree_factor` has to be between `max_filtered_constraint_degree-1` and `1<<rate_bits`.
// We find the value that minimizes `num_partial_product + quotient_degree_factor`.
let min_quotient_degree_factor = max_filtered_constraint_degree - 1;
let min_quotient_degree_factor = (max_filtered_constraint_degree - 1).max(2);
let max_quotient_degree_factor = self.config.max_quotient_degree_factor.min(1 << rate_bits);
let quotient_degree_factor = (min_quotient_degree_factor..=max_quotient_degree_factor)
.min_by_key(|&q| num_partial_products(self.config.num_routed_wires, q) + q)