From 0ea789234aa1b9a6fbda5ee99c0ae78ac325cd72 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 10 Jan 2024 14:45:35 +0100 Subject: [PATCH 01/10] queries use StarkDomains struct --- src/queries/queries.cairo | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/queries/queries.cairo b/src/queries/queries.cairo index f62d47a82..adf84f7be 100644 --- a/src/queries/queries.cairo +++ b/src/queries/queries.cairo @@ -2,7 +2,8 @@ use cairo_verifier::{ channel::channel::{Channel, ChannelTrait}, common::{ merge_sort::merge_sort, math::pow, consts::FIELD_GENERATOR, bit_reverse::BitReverseTrait - } + }, + domains::StarkDomains }; // 2^64 = 18446744073709551616 @@ -86,17 +87,15 @@ fn usort(input: Array) -> Array { result } -fn queries_to_points( - queries: Span, log_eval_domain_size: u8, eval_generator: felt252 -) -> Array { +fn queries_to_points(queries: Span, stark_domains: @StarkDomains) -> Array { let mut points = ArrayTrait::::new(); // Evaluation domains of size greater than 2**64 are not supported - assert(log_eval_domain_size <= 64, 'Eval domain too big'); + assert((*stark_domains.log_eval_domain_size).into() <= 64_u256, 'Eval domain too big'); // A 'log_eval_domain_size' bits index can be bit reversed using bit_reverse_u64 if it is // multiplied by 2**(64 - log_eval_domain_size) first. - let shift = pow(2, 64 - log_eval_domain_size.into()); + let shift = pow(2, 64 - (*stark_domains.log_eval_domain_size).into()); let mut i: u32 = 0; loop { @@ -108,7 +107,10 @@ fn queries_to_points( // Compute the x value of the query in the evaluation domain coset: // FIELD_GENERATOR * eval_generator ^ reversed_index. - points.append(FIELD_GENERATOR * pow(eval_generator, index.bit_reverse().into())); + points + .append( + FIELD_GENERATOR * pow(*stark_domains.eval_generator, index.bit_reverse().into()) + ); }; points } From a57e5c0141e08db291a0e83c19172d1b9321f2f8 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 10 Jan 2024 14:46:23 +0100 Subject: [PATCH 02/10] StarkCommitment StarkWitness StarkUnsentCommitment refactor --- src/stark.cairo | 62 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/src/stark.cairo b/src/stark.cairo index a33558d37..0812c008c 100644 --- a/src/stark.cairo +++ b/src/stark.cairo @@ -1,11 +1,17 @@ use cairo_verifier::{ air::{ traces_config::{TracesConfig, TracesConfigTrait}, public_input::PublicInput, - traces::{TracesUnsentCommitment, TracesDecommitment, TracesWitness} + traces::{TracesUnsentCommitment, TracesCommitment, TracesDecommitment, TracesWitness} + }, + fri::{ + fri_config::{FriConfig, FriConfigTrait}, + fri::{FriUnsentCommitment, FriWitness, FriCommitment} }, - fri::{fri_config::{FriConfig, FriConfigTrait}, fri::{FriUnsentCommitment, FriWitness}}, domains::StarkDomainsImpl, - table_commitment::{TableCommitmentConfig, TableCommitmentWitness, TableDecommitment}, + table_commitment::{ + TableCommitmentConfig, TableCommitmentWitness, TableDecommitment, TableUnsentCommitment, + TableCommitment + }, proof_of_work::{ config::{ProofOfWorkConfig, ProofOfWorkConfigTrait}, proof_of_work::ProofOfWorkUnsentCommitment @@ -72,20 +78,66 @@ impl StarkConfigImpl of StarkConfigTrait { } } +// Protocol components: +// ====================== +// The verifier is built from protocol components. Each component is responsible for commitment +// and decommitment phase. The decommitment part can be regarded as proving a statement with certain +// parameters that are known only after the commitment phase. The XDecommitment struct holds these +// parameters. +// The XWitness struct is the witness required to prove this statement. +// +// For example, VectorDecommitment holds some indices to the committed vector and the corresponding +// values. +// The VectorWitness struct has the authentication paths of the merkle tree, required to prove the +// validity of the values. +// +// The Stark protocol itself is a component, with the statement having no parameters known only +// after the commitment phase, and thus, there is no StarkDecommitment. +// +// The interface of a component named X is: +// +// Structs: +// * XConfig: Configuration for the component. +// * XUnsentCommitment: Commitment values (e.g. hashes), before sending in the channel. +// Those values shouldn't be used directly (only by the channel). +// Used by x_commit() to generate a commitment XCommitment. +// * XCommitment: Represents the commitment after it is read from the channel. +// * XDecommitment: Responses for queries. +// * XWitness: Auxiliary information for proving the decommitment. +// +// Functions: +// * x_commit() - The commitment phase. Takes XUnsentCommitment and returns XCommitment. +// * x_decommit() - The decommitment phase. Verifies a decommitment. Uses the commitment and the +// witness. + +// n_oods_values := air.mask_size + air.constraint_degree. + #[derive(Drop)] struct StarkUnsentCommitment { traces: TracesUnsentCommitment, - composition: felt252, + composition: TableUnsentCommitment, + // n_oods_values elements. The i-th value is the evaluation of the i-th mask item polynomial at + // the OODS point, where the mask item polynomial is the interpolation polynomial of the + // corresponding column shifted by the corresponding row_offset. oods_values: Span, fri: FriUnsentCommitment, proof_of_work: ProofOfWorkUnsentCommitment, } +#[derive(Drop)] +struct StarkCommitment { + traces: TracesCommitment, + composition: TableCommitment, + interaction_after_composition: felt252, + oods_values: Span, + interaction_after_oods: Span, + fri: FriCommitment, +} + #[derive(Drop)] struct StarkWitness { traces_decommitment: TracesDecommitment, traces_witness: TracesWitness, - interaction: TableCommitmentWitness, composition_decommitment: TableDecommitment, composition_witness: TableCommitmentWitness, fri_witness: FriWitness, From 1a96cd707b33e40c354d13863ed953720dc71aa1 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 10 Jan 2024 14:46:37 +0100 Subject: [PATCH 03/10] stark-verify skaffold function --- src/stark/stark_verify.cairo | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/stark/stark_verify.cairo b/src/stark/stark_verify.cairo index 8b1378917..e561bd460 100644 --- a/src/stark/stark_verify.cairo +++ b/src/stark/stark_verify.cairo @@ -1 +1,32 @@ +use cairo_verifier::queries::queries::queries_to_points; +use cairo_verifier::domains::StarkDomains; +use cairo_verifier::fri::fri::{FriDecommitment, fri_verify}; +use cairo_verifier::stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}; +// STARK decommitment phase. +fn stark_verify( + queries: Span, + commitment: StarkCommitment, + witness: StarkWitness, + stark_domains: StarkDomains, +) { + // First layer decommit. + + // Compute query points. + let points = queries_to_points(queries, @stark_domains); + + // Evaluate the FRI input layer at query points. + let eval_info = 0; + let oods_poly_evals = ArrayTrait::::new(); + + // Decommit FRI. + let fri_decommitment = FriDecommitment { + values: oods_poly_evals.span(), points: points.span(), + }; + fri_verify( + queries: queries, + commitment: commitment.fri, + decommitment: fri_decommitment, + witness: witness.fri_witness, + ) +} From 4d82ddcb2e3d0b68a59826985d20a3e8716371b1 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 10 Jan 2024 15:10:18 +0100 Subject: [PATCH 04/10] deserialization table_commitment fixes and refactor --- src/deserialization.cairo | 1 + src/deserialization/stark.cairo | 7 ++--- src/deserialization/table.cairo | 49 ++++++++++++++++++++++++++++++++ src/deserialization/traces.cairo | 46 ++++++------------------------ 4 files changed, 61 insertions(+), 42 deletions(-) create mode 100644 src/deserialization/table.cairo diff --git a/src/deserialization.cairo b/src/deserialization.cairo index 8109743e9..caf18e069 100644 --- a/src/deserialization.cairo +++ b/src/deserialization.cairo @@ -3,3 +3,4 @@ mod pow; mod stark; mod traces; mod vector; +mod table; diff --git a/src/deserialization/stark.cairo b/src/deserialization/stark.cairo index 95888c2d0..ba653993a 100644 --- a/src/deserialization/stark.cairo +++ b/src/deserialization/stark.cairo @@ -9,6 +9,7 @@ use cairo_verifier::{ TracesUnsentCommitmentWithSerde, TableCommitmentConfigWithSerde, TableCommitmentWitnessWithSerde, TableDecommitmentWithSerde }, + table::{TableUnsentCommitmentWithSerde}, fri::{FriConfigWithSerde, FriUnsentCommitmentWithSerde, FriWitnessWithSerde}, pow::{ProofOfWorkConfigWithSerde, ProofOfWorkUnsentCommitmentWithSerde}, }, @@ -145,7 +146,7 @@ impl IntoPublicInput of Into { #[derive(Drop, Serde)] struct StarkUnsentCommitmentWithSerde { traces: TracesUnsentCommitmentWithSerde, - composition: felt252, + composition: TableUnsentCommitmentWithSerde, oods_values: Array, fri: FriUnsentCommitmentWithSerde, proof_of_work: ProofOfWorkUnsentCommitmentWithSerde, @@ -154,7 +155,7 @@ impl IntoStarkUnsentCommitment of Into StarkUnsentCommitment { StarkUnsentCommitment { traces: self.traces.into(), - composition: self.composition, + composition: self.composition.into(), oods_values: self.oods_values.span(), fri: self.fri.into(), proof_of_work: self.proof_of_work.into(), @@ -166,7 +167,6 @@ impl IntoStarkUnsentCommitment of Into { StarkWitness { traces_decommitment: self.traces_decommitment.into(), traces_witness: self.traces_witness.into(), - interaction: self.interaction.into(), composition_decommitment: self.composition_decommitment.into(), composition_witness: self.composition_witness.into(), fri_witness: self.fri_witness.into(), diff --git a/src/deserialization/table.cairo b/src/deserialization/table.cairo new file mode 100644 index 000000000..d920ce165 --- /dev/null +++ b/src/deserialization/table.cairo @@ -0,0 +1,49 @@ +use cairo_verifier::table_commitment::{ + TableCommitmentConfig, TableCommitmentWitness, TableDecommitment, TableUnsentCommitment +}; +use cairo_verifier::deserialization::vector::{ + VectorCommitmentConfigWithSerde, VectorCommitmentWitnessWithSerde +}; + +#[derive(Drop, Serde)] +struct TableCommitmentConfigWithSerde { + n_columns: felt252, + vector: VectorCommitmentConfigWithSerde, +} + +impl IntoTableCommitmentConfig of Into { + fn into(self: TableCommitmentConfigWithSerde) -> TableCommitmentConfig { + TableCommitmentConfig { n_columns: self.n_columns, vector: self.vector.into(), } + } +} + +#[derive(Drop, Serde)] +struct TableDecommitmentWithSerde { + n_values: felt252, + values: Array, +} +impl IntoTableDecommitment of Into { + fn into(self: TableDecommitmentWithSerde) -> TableDecommitment { + TableDecommitment { values: self.values.span(), } + } +} + +#[derive(Drop, Serde)] +struct TableCommitmentWitnessWithSerde { + vector: VectorCommitmentWitnessWithSerde, +} +impl IntoTableCommitmentWitness of Into { + fn into(self: TableCommitmentWitnessWithSerde) -> TableCommitmentWitness { + TableCommitmentWitness { vector: self.vector.into(), } + } +} + +#[derive(Drop, Serde)] +struct TableUnsentCommitmentWithSerde { + vector: felt252, +} +impl IntoTableUnsentCommitment of Into { + fn into(self: TableUnsentCommitmentWithSerde) -> TableUnsentCommitment { + TableUnsentCommitment { vector: self.vector } + } +} diff --git a/src/deserialization/traces.cairo b/src/deserialization/traces.cairo index 879abb114..c7efbea03 100644 --- a/src/deserialization/traces.cairo +++ b/src/deserialization/traces.cairo @@ -1,3 +1,4 @@ +use core::traits::Into; use cairo_verifier::{ air::{ traces_config::TracesConfig, @@ -7,11 +8,12 @@ use cairo_verifier::{ vector::{ VectorCommitmentConfig, VectorCommitmentWitness, VectorCommitmentConfigWithSerde, VectorCommitmentWitnessWithSerde + }, + table::{ + TableCommitmentConfigWithSerde, TableDecommitmentWithSerde, + TableCommitmentWitnessWithSerde, TableUnsentCommitmentWithSerde } }, - table_commitment::{ - TableCommitmentConfig, TableCommitmentWitness, TableDecommitment, TableUnsentCommitment - }, }; #[derive(Drop, Serde)] @@ -25,17 +27,6 @@ impl IntoTracesConfig of Into { } } -#[derive(Drop, Serde)] -struct TableCommitmentConfigWithSerde { - n_columns: felt252, - vector: VectorCommitmentConfigWithSerde, -} -impl IntoTableCommitmentConfig of Into { - fn into(self: TableCommitmentConfigWithSerde) -> TableCommitmentConfig { - TableCommitmentConfig { n_columns: self.n_columns, vector: self.vector.into(), } - } -} - #[derive(Drop, Serde)] struct TracesDecommitmentWithSerde { original: TableDecommitmentWithSerde, @@ -49,29 +40,17 @@ impl IntoTracesDecommitment of Into { fn into(self: TracesUnsentCommitmentWithSerde) -> TracesUnsentCommitment { TracesUnsentCommitment { - original: TableUnsentCommitment { vector: self.original }, - interaction: TableUnsentCommitment { vector: self.original }, + original: self.original.into(), interaction: self.interaction.into(), } } } -#[derive(Drop, Serde)] -struct TableDecommitmentWithSerde { - n_values: felt252, - values: Array, -} -impl IntoTableDecommitment of Into { - fn into(self: TableDecommitmentWithSerde) -> TableDecommitment { - TableDecommitment { values: self.values.span(), } - } -} - #[derive(Drop, Serde)] struct TracesWitnessWithSerde { original: TableCommitmentWitnessWithSerde, @@ -83,12 +62,3 @@ impl IntoTracesWitness of Into { } } -#[derive(Drop, Serde)] -struct TableCommitmentWitnessWithSerde { - vector: VectorCommitmentWitnessWithSerde, -} -impl IntoTableCommitmentWitness of Into { - fn into(self: TableCommitmentWitnessWithSerde) -> TableCommitmentWitness { - TableCommitmentWitness { vector: self.vector.into(), } - } -} From b975d46ba9eb7ada4f3472c37a44f56f4edfad5d Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 10 Jan 2024 15:16:56 +0100 Subject: [PATCH 05/10] traces decommit & table decommit --- src/stark/stark_verify.cairo | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/stark/stark_verify.cairo b/src/stark/stark_verify.cairo index e561bd460..8b9096808 100644 --- a/src/stark/stark_verify.cairo +++ b/src/stark/stark_verify.cairo @@ -2,6 +2,8 @@ use cairo_verifier::queries::queries::queries_to_points; use cairo_verifier::domains::StarkDomains; use cairo_verifier::fri::fri::{FriDecommitment, fri_verify}; use cairo_verifier::stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}; +use cairo_verifier::air::traces::traces_decommit; +use cairo_verifier::table_commitment::table_decommit; // STARK decommitment phase. fn stark_verify( @@ -11,6 +13,16 @@ fn stark_verify( stark_domains: StarkDomains, ) { // First layer decommit. + traces_decommit( + queries, commitment.traces, witness.traces_decommitment, witness.traces_witness + ); + + table_decommit( + commitment.composition, + queries, + witness.composition_decommitment, + witness.composition_witness, + ); // Compute query points. let points = queries_to_points(queries, @stark_domains); From 59b3ec622ba8a2ae81ee43f25605c9f2c8eef336 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 10 Jan 2024 15:18:14 +0100 Subject: [PATCH 06/10] import fmt --- src/stark/stark_verify.cairo | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/stark/stark_verify.cairo b/src/stark/stark_verify.cairo index 8b9096808..56d467abf 100644 --- a/src/stark/stark_verify.cairo +++ b/src/stark/stark_verify.cairo @@ -1,9 +1,9 @@ -use cairo_verifier::queries::queries::queries_to_points; -use cairo_verifier::domains::StarkDomains; -use cairo_verifier::fri::fri::{FriDecommitment, fri_verify}; -use cairo_verifier::stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}; -use cairo_verifier::air::traces::traces_decommit; -use cairo_verifier::table_commitment::table_decommit; +use cairo_verifier::{ + queries::queries::queries_to_points, domains::StarkDomains, + fri::fri::{FriDecommitment, fri_verify}, + stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}, air::traces::traces_decommit, + table_commitment::table_decommit, +}; // STARK decommitment phase. fn stark_verify( From 2933ec7ced06fd9c62b8fafb4c4b92022ec4b0c5 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Thu, 11 Jan 2024 13:29:07 +0100 Subject: [PATCH 07/10] eval_oods_boundary_poly_at_points --- src/oods.cairo | 83 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/src/oods.cairo b/src/oods.cairo index 76a9c6f04..f2c2307ef 100644 --- a/src/oods.cairo +++ b/src/oods.cairo @@ -1,12 +1,27 @@ -use cairo_verifier::air::composition::eval_composition_polynomial; +use core::array::ArrayTrait; +use cairo_verifier::common::array_extend::ArrayExtendTrait; +use core::array::SpanTrait; +use cairo_verifier::air::composition::{eval_composition_polynomial, eval_oods_polynomial}; use cairo_verifier::air::global_values::InteractionElements; use cairo_verifier::air::public_input::PublicInput; +use cairo_verifier::air::traces::TracesDecommitment; +use cairo_verifier::table_commitment::TableDecommitment; +use cairo_verifier::air::constants::CONSTRAINT_DEGREE; +#[derive(Drop)] struct OodsValues { mask_values: Array, split_polynomials: Array } +#[derive(Drop)] +struct OodsEvaluationInfo { + oods_values: Span, + oods_point: felt252, + trace_generator: felt252, + constraint_coefficients: Span, +} + fn verify_oods( oods: OodsValues, interaction_elements: InteractionElements, @@ -32,3 +47,69 @@ fn verify_oods( assert(composition_from_trace == claimed_composition, 'Invalid OODS'); } + +fn eval_oods_boundary_poly_at_points( + n_original_columns: u32, + n_interaction_columns: u32, + eval_info: OodsEvaluationInfo, + points: Span, + decommitment: TracesDecommitment, + composition_decommitment: TableDecommitment, +) -> Array { + assert(n_original_columns == decommitment.original.values.len(), 'Invalid value'); + assert( + decommitment.interaction.values.len() == points.len() * n_interaction_columns, + 'Invalid value' + ); + assert( + composition_decommitment.values.len() == points.len() * CONSTRAINT_DEGREE, 'Invalid value' + ); + + let mut evaluations = ArrayTrait::::new(); + + let mut i: u32 = 0; + loop { + if i == points.len() { + break; + } + + let mut column_values = ArrayTrait::::new(); + + column_values + .extend( + decommitment + .original + .values + .slice(i * n_original_columns, (i + 1) * n_original_columns) + ); + column_values + .extend( + decommitment + .interaction + .values + .slice(i * n_interaction_columns, (i + 1) * n_interaction_columns) + ); + column_values + .extend( + composition_decommitment + .values + .slice(i * CONSTRAINT_DEGREE, (i + 1) * CONSTRAINT_DEGREE) + ); + + evaluations + .append( + eval_oods_polynomial( + column_values.span(), + eval_info.oods_values, + eval_info.constraint_coefficients, + *points.at(i), + eval_info.oods_point, + eval_info.trace_generator, + ) + ); + + i += 1; + }; + + evaluations +} From 541c84d5a7b6ddf771a084a3b0c9bf04f5934dbd Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 12 Jan 2024 10:05:08 +0100 Subject: [PATCH 08/10] stark-verify finalized --- src/air/traces.cairo | 4 ++-- src/stark.cairo | 2 +- src/stark/stark_verify.cairo | 20 ++++++++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/air/traces.cairo b/src/air/traces.cairo index 57b8a3789..85271d14f 100644 --- a/src/air/traces.cairo +++ b/src/air/traces.cairo @@ -37,7 +37,7 @@ struct TracesCommitment { // Responses for queries to the AIR commitment. // The queries are usually generated by the next component down the line (e.g. FRI). -#[derive(Drop)] +#[derive(Drop, Copy)] struct TracesDecommitment { // Responses for queries to the original trace. original: TableDecommitment, @@ -46,7 +46,7 @@ struct TracesDecommitment { } // A witness for a decommitment of the AIR traces over queries. -#[derive(Drop)] +#[derive(Drop, Copy)] struct TracesWitness { original: TableCommitmentWitness, interaction: TableCommitmentWitness, diff --git a/src/stark.cairo b/src/stark.cairo index 0812c008c..bd78b0fa3 100644 --- a/src/stark.cairo +++ b/src/stark.cairo @@ -134,7 +134,7 @@ struct StarkCommitment { fri: FriCommitment, } -#[derive(Drop)] +#[derive(Drop, Copy)] struct StarkWitness { traces_decommitment: TracesDecommitment, traces_witness: TracesWitness, diff --git a/src/stark/stark_verify.cairo b/src/stark/stark_verify.cairo index 56d467abf..b8bbf2bf6 100644 --- a/src/stark/stark_verify.cairo +++ b/src/stark/stark_verify.cairo @@ -1,12 +1,16 @@ +use core::array::ArrayTrait; use cairo_verifier::{ queries::queries::queries_to_points, domains::StarkDomains, fri::fri::{FriDecommitment, fri_verify}, stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}, air::traces::traces_decommit, table_commitment::table_decommit, + oods::{OodsEvaluationInfo, eval_oods_boundary_poly_at_points}, }; // STARK decommitment phase. fn stark_verify( + n_original_columns: u32, + n_interaction_columns: u32, queries: Span, commitment: StarkCommitment, witness: StarkWitness, @@ -28,8 +32,20 @@ fn stark_verify( let points = queries_to_points(queries, @stark_domains); // Evaluate the FRI input layer at query points. - let eval_info = 0; - let oods_poly_evals = ArrayTrait::::new(); + let eval_info = OodsEvaluationInfo { + oods_values: commitment.oods_values, + oods_point: commitment.interaction_after_composition, + trace_generator: stark_domains.trace_generator, + constraint_coefficients: commitment.interaction_after_oods, + }; + let oods_poly_evals = eval_oods_boundary_poly_at_points( + n_original_columns, + n_interaction_columns, + eval_info, + points.span(), + witness.traces_decommitment, + witness.composition_decommitment, + ); // Decommit FRI. let fri_decommitment = FriDecommitment { From 4eb42229797e54c9c3746e96e95d897430c2ad8f Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 12 Jan 2024 10:06:55 +0100 Subject: [PATCH 09/10] fmt --- src/stark/stark_verify.cairo | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stark/stark_verify.cairo b/src/stark/stark_verify.cairo index b8bbf2bf6..3ad27a179 100644 --- a/src/stark/stark_verify.cairo +++ b/src/stark/stark_verify.cairo @@ -3,8 +3,7 @@ use cairo_verifier::{ queries::queries::queries_to_points, domains::StarkDomains, fri::fri::{FriDecommitment, fri_verify}, stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}, air::traces::traces_decommit, - table_commitment::table_decommit, - oods::{OodsEvaluationInfo, eval_oods_boundary_poly_at_points}, + table_commitment::table_decommit, oods::{OodsEvaluationInfo, eval_oods_boundary_poly_at_points}, }; // STARK decommitment phase. From ec7032e174dd1c033b605a467c31ba08a1b4041c Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Mon, 15 Jan 2024 14:13:41 +0100 Subject: [PATCH 10/10] remove TableUnsentCommitmentWithSerde -> felt252 --- src/deserialization/stark.cairo | 5 ++--- src/deserialization/table.cairo | 10 ---------- src/deserialization/traces.cairo | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/deserialization/stark.cairo b/src/deserialization/stark.cairo index ba653993a..ea5eb8ec3 100644 --- a/src/deserialization/stark.cairo +++ b/src/deserialization/stark.cairo @@ -9,7 +9,6 @@ use cairo_verifier::{ TracesUnsentCommitmentWithSerde, TableCommitmentConfigWithSerde, TableCommitmentWitnessWithSerde, TableDecommitmentWithSerde }, - table::{TableUnsentCommitmentWithSerde}, fri::{FriConfigWithSerde, FriUnsentCommitmentWithSerde, FriWitnessWithSerde}, pow::{ProofOfWorkConfigWithSerde, ProofOfWorkUnsentCommitmentWithSerde}, }, @@ -146,7 +145,7 @@ impl IntoPublicInput of Into { #[derive(Drop, Serde)] struct StarkUnsentCommitmentWithSerde { traces: TracesUnsentCommitmentWithSerde, - composition: TableUnsentCommitmentWithSerde, + composition: felt252, oods_values: Array, fri: FriUnsentCommitmentWithSerde, proof_of_work: ProofOfWorkUnsentCommitmentWithSerde, @@ -155,7 +154,7 @@ impl IntoStarkUnsentCommitment of Into StarkUnsentCommitment { StarkUnsentCommitment { traces: self.traces.into(), - composition: self.composition.into(), + composition: self.composition, oods_values: self.oods_values.span(), fri: self.fri.into(), proof_of_work: self.proof_of_work.into(), diff --git a/src/deserialization/table.cairo b/src/deserialization/table.cairo index 572bd86fc..86070689b 100644 --- a/src/deserialization/table.cairo +++ b/src/deserialization/table.cairo @@ -37,13 +37,3 @@ impl IntoTableCommitmentWitness of Into { - fn into(self: TableUnsentCommitmentWithSerde) -> felt252 { - self.vector - } -} diff --git a/src/deserialization/traces.cairo b/src/deserialization/traces.cairo index ca7122599..073e7255d 100644 --- a/src/deserialization/traces.cairo +++ b/src/deserialization/traces.cairo @@ -11,7 +11,7 @@ use cairo_verifier::{ }, table::{ TableCommitmentConfigWithSerde, TableDecommitmentWithSerde, - TableCommitmentWitnessWithSerde, TableUnsentCommitmentWithSerde + TableCommitmentWitnessWithSerde, } }, table_commitment::table_commitment::{