Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gswirski committed Nov 22, 2024
1 parent c5118da commit fd908d1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 65 deletions.
4 changes: 2 additions & 2 deletions crypto/src/merkle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ mod tests;
/// ```
#[derive(Debug)]
pub struct MerkleTree<H: Hasher> {
pub nodes: Vec<H::Digest>,
pub leaves: Vec<H::Digest>,
nodes: Vec<H::Digest>,
leaves: Vec<H::Digest>,
}

/// Merkle tree opening consisting of a leaf value and a Merkle path leading from this leaf
Expand Down
9 changes: 1 addition & 8 deletions prover/src/constraints/composition_poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::{ColMatrix, StarkDomain};
// ================================================================================================

/// Represents merged evaluations of all constraint evaluations.
pub struct CompositionPolyTrace<E>(pub Vec<E>);
pub struct CompositionPolyTrace<E>(Vec<E>);

impl<E: FieldElement> CompositionPolyTrace<E> {
/// Returns a new instance of [CompositionPolyTrace] instantiated from the provided evaluations.
Expand Down Expand Up @@ -62,20 +62,13 @@ impl<E: FieldElement> CompositionPoly<E> {
domain.trace_length() < composition_trace.num_rows(),
"trace length must be smaller than length of composition polynomial trace"
);
// println!("coset intt in composition poly {} -> len {} cols {}", composition_trace.num_rows(), domain.trace_length(), num_cols);

let mut trace = composition_trace.into_inner();

// println!("trace-before {:?}", trace);

// at this point, combined_poly contains evaluations of the combined constraint polynomial;
// we interpolate this polynomial to transform it into coefficient form.
let inv_twiddles = fft::get_inv_twiddles::<E::BaseField>(trace.len());
fft::interpolate_poly_with_offset(&mut trace, &inv_twiddles, domain.offset());
// fft::interpolate_poly(&mut trace, &inv_twiddles);

// println!("cpu-trace-after {:?}", trace);


let polys = segment(trace, domain.trace_length(), num_cols);

Expand Down
39 changes: 0 additions & 39 deletions prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,45 +532,6 @@ pub trait Prover {
) -> (Self::ConstraintCommitment<E>, CompositionPoly<E>)
where
E: FieldElement<BaseField = Self::BaseField>;


// ,
// {
// // first, build constraint composition polynomial from its trace as follows:
// // - interpolate the trace into a polynomial in coefficient form
// // - "break" the polynomial into a set of column polynomials each of degree equal to
// // trace_length - 1
// let composition_poly = info_span!(
// "build_composition_poly_columns",
// num_columns = num_constraint_composition_columns
// )
// .in_scope(|| {
// CompositionPoly::new(composition_poly_trace, domain, num_constraint_composition_columns)
// });
// assert_eq!(composition_poly.num_columns(), num_constraint_composition_columns);
// assert_eq!(composition_poly.column_degree(), domain.trace_length() - 1);

// // then, evaluate composition polynomial columns over the LDE domain
// let domain_size = domain.lde_domain_size();
// let composed_evaluations = info_span!("evaluate_composition_poly_columns").in_scope(|| {
// RowMatrix::evaluate_polys_over::<DEFAULT_SEGMENT_WIDTH>(composition_poly.data(), domain)
// });
// assert_eq!(composed_evaluations.num_cols(), num_constraint_composition_columns);
// assert_eq!(composed_evaluations.num_rows(), domain_size);

// // finally, build constraint evaluation commitment
// let constraint_commitment = info_span!(
// "compute_constraint_evaluation_commitment",
// log_domain_size = domain_size.ilog2()
// )
// .in_scope(|| {
// let commitment = composed_evaluations
// .commit_to_rows::<Self::HashFn, Self::VC>(self.options().partition_options());
// self.new_constraint_commitment(composed_evaluations, commitment)
// });

// (constraint_commitment, composition_poly)
// }

#[doc(hidden)]
#[instrument(skip_all)]
Expand Down
16 changes: 0 additions & 16 deletions prover/src/matrix/row_matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ impl<E: FieldElement> RowMatrix<E> {
// CONSTRUCTORS
// --------------------------------------------------------------------------------------------

/// Returns a new [Matrix] instantiated with the data from the specified rows.
///
/// # Panics
/// Panics if:
/// * The provided vector of rows is empty.
/// * Not all of the rows have the same number of elements.
/// * Number of columns is smaller than or equal to 1.
/// * Number of columns is not a power of two.
pub fn new(data: Vec<E::BaseField>, num_columns: usize) -> Self {
Self {
data,
row_width: num_columns * E::EXTENSION_DEGREE,
elements_per_row: num_columns * E::EXTENSION_DEGREE,
}
}

/// Returns a new [RowMatrix] constructed by evaluating the provided polynomials over the
/// domain defined by the specified blowup factor.
///
Expand Down

0 comments on commit fd908d1

Please sign in to comment.