Skip to content

Commit

Permalink
o1vm/pickles: Fix various FIXMEs from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzixnerd committed Oct 17, 2024
1 parent 4781ef3 commit 5f845ee
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions o1vm/src/pickles/column_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use super::proof::WitnessColumns;

type Evals<F> = Evaluations<F, Radix2EvaluationDomain<F>>;

/// The collection f polynomials (all in evaluation form) and constants
/// The collection of polynomials (all in evaluation form) and constants
/// required to evaluate an expression as a polynomial.
///
/// All are evaluations.
pub struct ColumnEnvironment<'a, F: FftField> {
/// The witness coluomn polynomials. Includes relation columns and dynamic
/// The witness column polynomials. Includes relation columns and dynamic
/// selector columns.
pub witness: &'a WitnessColumns<Evals<F>, [Evals<F>; N_MIPS_SEL_COLS]>,
/// The value `prod_{j != 1} (1 - ω^j)`, used for efficiently
Expand Down
3 changes: 2 additions & 1 deletion o1vm/src/pickles/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ where
quotient
};

// FIXME: Add this to absorb here
let quotient_commitment = srs.commit_non_hiding(&quotient_poly, 7);
// FIXME: Add this to absorb here (DONE)
absorb_commitment(&mut fq_sponge, &quotient_commitment);

////////////////////////////////////////////////////////////////////////////
// Round 3: Evaluations at ζ and ζω
Expand Down
32 changes: 20 additions & 12 deletions o1vm/src/pickles/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![allow(clippy::boxed_local)]

use ark_ec::{AffineRepr, Group};
use ark_ff::{PrimeField, Zero};
use ark_ff::{PrimeField, Zero /* One */};
use rand::thread_rng;

use kimchi::{
Expand Down Expand Up @@ -174,9 +174,9 @@ where
let combined_expr =
Expr::combine_constraints(0..(constraints.len() as u32), constraints.clone());

// FIXME: Add these to the final check!!!!!
// FIXME: Add these to the final check!!!!! (DONE)

// FIXME: Fixup absorbs so they match in prover.rs
// FIXME: Fixup absorbs so they match in prover.rs (DONE)

let quotient_eval_zeta = PolishToken::evaluate(
combined_expr.to_polish().as_slice(),
Expand All @@ -198,18 +198,18 @@ where
)
.unwrap_or_else(|_| panic!("Could not evaluate quotient polynomial at zeta_omega"));

// Check the actual quotient works. combined_expr(eval) [ == quotient_eval_*] = quotient(eval) [== Given by prover (new field) -- chunked] * vanishing_poly(eval) [== x^n - 1 == zeta^(d1.size()) - 1]
// Check the actual quotient works.
//
// combined_expr(eval) [ == quotient_eval_*]
// =
// quotient(eval) [== Given by prover (new field) -- chunked]
// *
// vanishing_poly(eval) [== x^n - 1 == zeta^(d1.size()) - 1]
// FIXME: This should probably use some sort of proof assert, not just panic.
/* assert!(quotient_eval_zeta == quotient_evaluations * (pow(zeta, d1.size()) - G::ScalarField::one()), "The prover lied!"); */

// Fixme add ft eval to the proof
/* coms_and_evaluations.push(Evaluation {
commitment: ft_comm,
evaluations: vec![vec![ft_eval0], vec![zeta_omega_evaluations.ft]],
});
*/
fr_sponge.absorb(&quotient_eval_zeta);
fr_sponge.absorb(&quotient_eval_zeta_omega);
// fr_sponge.absorb(zeta_omega_evaluations.ft_eval1);
// -- End absorb all coms_and_evaluations

let v_chal = fr_sponge.challenge();
let v = v_chal.to_field(endo_r);
Expand Down Expand Up @@ -241,6 +241,14 @@ where
})
});

evaluations.push(Evaluation {
commitment: quotient_commitment.clone(),
evaluations: vec![
vec![quotient_eval_zeta],
vec![quotient_eval_zeta_omega],
],
});

evaluations
};

Expand Down

0 comments on commit 5f845ee

Please sign in to comment.