Skip to content

Commit

Permalink
Fix dev. (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonh5 authored Mar 20, 2024
1 parent a6b9f2c commit 2b9653e
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/core/prover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub fn prove(
}

// Check that the composition polynomial is not too big.
let composition_polynomial_log_degree_bound = air.max_constraint_log_degree_bound();
let composition_polynomial_log_degree_bound = air.composition_log_degree_bound();
if composition_polynomial_log_degree_bound + LOG_BLOWUP_FACTOR > MAX_CIRCLE_DOMAIN_LOG_SIZE {
return Err(ProvingError::MaxCompositionDegreeExceeded {
degree: composition_polynomial_log_degree_bound,
Expand Down Expand Up @@ -321,7 +321,7 @@ mod tests {
use num_traits::Zero;

use crate::core::air::evaluation::{DomainEvaluationAccumulator, PointEvaluationAccumulator};
use crate::core::air::{Air, Component, ComponentTrace, ComponentVisitor, Mask};
use crate::core::air::{Air, Component, ComponentTrace, Mask};
use crate::core::backend::cpu::CPUCircleEvaluation;
use crate::core::backend::CPUBackend;
use crate::core::circle::{CirclePoint, CirclePointIndex, Coset};
Expand All @@ -332,11 +332,13 @@ mod tests {
use crate::core::test_utils::test_channel;
use crate::qm31;

struct TestAir<C: Component<CPUBackend>>(C);
struct TestAir<C: Component<CPUBackend>> {
component: C,
}

impl Air<CPUBackend> for TestAir<TestComponent> {
fn visit_components<V: ComponentVisitor<CPUBackend>>(&self, v: &mut V) {
v.visit(&self.0)
fn components(&self) -> Vec<&dyn Component<CPUBackend>> {
vec![&self.component]
}
}

Expand Down Expand Up @@ -380,9 +382,11 @@ mod tests {
#[ignore]
fn test_trace_too_big() {
const LOG_DOMAIN_SIZE: u32 = MAX_CIRCLE_DOMAIN_LOG_SIZE;
let air = TestAir(TestComponent {
max_constraint_log_degree_bound: LOG_DOMAIN_SIZE,
});
let air = TestAir {
component: TestComponent {
max_constraint_log_degree_bound: LOG_DOMAIN_SIZE,
},
};
let domain = CircleDomain::new(Coset::new(
CirclePointIndex::generator(),
LOG_DOMAIN_SIZE - 1,
Expand All @@ -403,9 +407,11 @@ mod tests {
#[test]
fn test_composition_polynomial_too_big() {
const COMPOSITION_POLYNOMIAL_DEGREE: u32 = MAX_CIRCLE_DOMAIN_LOG_SIZE;
let air = TestAir(TestComponent {
max_constraint_log_degree_bound: COMPOSITION_POLYNOMIAL_DEGREE,
});
let air = TestAir {
component: TestComponent {
max_constraint_log_degree_bound: COMPOSITION_POLYNOMIAL_DEGREE,
},
};
const LOG_DOMAIN_SIZE: u32 = 5;
let domain = CircleDomain::new(Coset::new(
CirclePointIndex::generator(),
Expand All @@ -426,9 +432,11 @@ mod tests {
#[test]
fn test_constraints_not_satisfied() {
const LOG_DOMAIN_SIZE: u32 = 5;
let air = TestAir(TestComponent {
max_constraint_log_degree_bound: LOG_DOMAIN_SIZE,
});
let air = TestAir {
component: TestComponent {
max_constraint_log_degree_bound: LOG_DOMAIN_SIZE,
},
};
let domain = CircleDomain::new(Coset::new(
CirclePointIndex::generator(),
LOG_DOMAIN_SIZE - 1,
Expand Down

0 comments on commit 2b9653e

Please sign in to comment.