diff --git a/src/air/air.cairo b/src/air/air.cairo index d100b7e5a..0068a69be 100644 --- a/src/air/air.cairo +++ b/src/air/air.cairo @@ -10,7 +10,7 @@ trait AIRComposition { ) -> felt252; } -trait AIROods { +trait AIROods { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -18,5 +18,6 @@ trait AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DY, ) -> felt252; } diff --git a/src/air/layouts.cairo b/src/air/layouts.cairo index d5c2af4f0..4ad4010d5 100644 --- a/src/air/layouts.cairo +++ b/src/air/layouts.cairo @@ -17,7 +17,7 @@ mod recursive; // mod starknet_with_keccak; // === STARKNET_WITH_KECCAK END === // === DYNAMIC BEGIN === -mod dynamic; +// mod dynamic; // === DYNAMIC END === diff --git a/src/air/layouts/dex.cairo b/src/air/layouts/dex.cairo index b590a6910..5d5be06c6 100644 --- a/src/air/layouts/dex.cairo +++ b/src/air/layouts/dex.cairo @@ -12,7 +12,7 @@ use cairo_verifier::{ global_values::{GlobalValues, InteractionElements, EcPoint, EcdsaSigConfig}, public_input::DexPublicInputImpl, constants::{ - PUBLIC_MEMORY_STEP, PEDERSEN_BUILTIN_RATIO, ECDSA_BUILTIN_RATIO, + DynamicParams, PUBLIC_MEMORY_STEP, PEDERSEN_BUILTIN_RATIO, ECDSA_BUILTIN_RATIO, ECDSA_BUILTIN_REPETITIONS, PEDERSEN_BUILTIN_REPETITIONS, segments, }, }, @@ -95,7 +95,7 @@ impl DexAIRCompositionImpl of AIRComposition { } } -impl DexAIROodsImpl of AIROods { +impl DexAIROodsImpl of AIROods { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -103,9 +103,10 @@ impl DexAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DynamicParams, ) -> felt252 { eval_oods_polynomial_inner( - column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator, + column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator ) } } diff --git a/src/air/layouts/dex/constants.cairo b/src/air/layouts/dex/constants.cairo index 986e93b86..fa34dc8cc 100644 --- a/src/air/layouts/dex/constants.cairo +++ b/src/air/layouts/dex/constants.cairo @@ -33,6 +33,9 @@ const RANGE_CHECK_BUILTIN_RATIO: felt252 = 8; const RANGE_CHECK_BUILTIN_ROW_RATIO: felt252 = 128; const RANGE_CHECK_N_PARTS: felt252 = 8; +#[derive(Drop, Copy, Serde)] +struct DynamicParams {} + mod segments { const ECDSA: usize = 5; const EXECUTION: usize = 1; diff --git a/src/air/layouts/dynamic.cairo b/src/air/layouts/dynamic.cairo index b8dbf10f0..d1c447432 100644 --- a/src/air/layouts/dynamic.cairo +++ b/src/air/layouts/dynamic.cairo @@ -31,7 +31,7 @@ use cairo_verifier::{ common::{math::{Felt252Div, Felt252PartialOrd, pow}, asserts::assert_range_u128} }; -impl StarknetAIRCompositionImpl of AIRComposition { +impl DynamicAIRCompositionImpl of AIRComposition { fn eval_composition_polynomial( interaction_elements: InteractionElements, public_input: @PublicInput, @@ -203,17 +203,12 @@ impl StarknetAIRCompositionImpl of AIRComposition { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -221,7 +216,16 @@ impl StarknetAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DynamicParams, ) -> felt252 { - 0 + eval_oods_polynomial_inner( + column_values, + oods_values, + constraint_coefficients, + point, + oods_point, + trace_generator, + dynamic_params, + ) } } diff --git a/src/air/layouts/dynamic/autogenerated.cairo b/src/air/layouts/dynamic/autogenerated.cairo index 9aa8a39a0..c474d23ab 100644 --- a/src/air/layouts/dynamic/autogenerated.cairo +++ b/src/air/layouts/dynamic/autogenerated.cairo @@ -13,8 +13,8 @@ fn eval_composition_polynomial_inner( point: felt252, trace_generator: felt252, global_values: GlobalValues, - dynamic_params: DynamicParams ) -> felt252 { + let dynamic_params = global_values.dynamic_params; let add_mod_a0_suboffset = dynamic_params.add_mod_a0_suboffset; let add_mod_a1_suboffset = dynamic_params.add_mod_a1_suboffset; let add_mod_a2_suboffset = dynamic_params.add_mod_a2_suboffset; diff --git a/src/air/layouts/recursive.cairo b/src/air/layouts/recursive.cairo index 3c13a775e..cd31d378a 100644 --- a/src/air/layouts/recursive.cairo +++ b/src/air/layouts/recursive.cairo @@ -12,8 +12,8 @@ use cairo_verifier::{ global_values::{GlobalValues, InteractionElements, EcPoint}, public_input::RecursivePublicInputImpl, constants::{ - PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, PEDERSEN_BUILTIN_RATIO, - PEDERSEN_BUILTIN_REPETITIONS, segments, + DynamicParams, PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, + PEDERSEN_BUILTIN_RATIO, PEDERSEN_BUILTIN_REPETITIONS, segments, }, }, air::{AIRComposition, AIROods}, diluted::get_diluted_product, @@ -96,7 +96,7 @@ impl RecursiveAIRCompositionImpl of AIRComposition { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -104,9 +104,10 @@ impl RecursiveAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DynamicParams, ) -> felt252 { eval_oods_polynomial_inner( - column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator, + column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator ) } } diff --git a/src/air/layouts/recursive/constants.cairo b/src/air/layouts/recursive/constants.cairo index 4fa5e379a..f6679ff3c 100644 --- a/src/air/layouts/recursive/constants.cairo +++ b/src/air/layouts/recursive/constants.cairo @@ -33,6 +33,9 @@ const RANGE_CHECK_BUILTIN_RATIO: felt252 = 8; const RANGE_CHECK_BUILTIN_ROW_RATIO: felt252 = 128; const RANGE_CHECK_N_PARTS: felt252 = 8; +#[derive(Drop, Copy, Serde)] +struct DynamicParams {} + mod segments { const BITWISE: usize = 5; const EXECUTION: usize = 1; diff --git a/src/air/layouts/recursive_with_poseidon.cairo b/src/air/layouts/recursive_with_poseidon.cairo index 5324e6db9..2b802942a 100644 --- a/src/air/layouts/recursive_with_poseidon.cairo +++ b/src/air/layouts/recursive_with_poseidon.cairo @@ -12,8 +12,8 @@ use cairo_verifier::{ global_values::{GlobalValues, InteractionElements, EcPoint}, public_input::RecursiveWithPoseidonPublicInputImpl, constants::{ - PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, PEDERSEN_BUILTIN_RATIO, - PEDERSEN_BUILTIN_REPETITIONS, segments, POSEIDON_RATIO + DynamicParams, PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, + PEDERSEN_BUILTIN_RATIO, PEDERSEN_BUILTIN_REPETITIONS, segments, POSEIDON_RATIO }, }, air::{AIRComposition, AIROods}, diluted::get_diluted_product, @@ -125,7 +125,7 @@ impl RecursiveWithPoseidonAIRCompositionImpl of AIRComposition { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -133,6 +133,7 @@ impl RecursiveWithPoseidonAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DynamicParams, ) -> felt252 { eval_oods_polynomial_inner( column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator, diff --git a/src/air/layouts/recursive_with_poseidon/constants.cairo b/src/air/layouts/recursive_with_poseidon/constants.cairo index b5b596671..b15c94e9a 100644 --- a/src/air/layouts/recursive_with_poseidon/constants.cairo +++ b/src/air/layouts/recursive_with_poseidon/constants.cairo @@ -38,6 +38,9 @@ const RANGE_CHECK_BUILTIN_RATIO: felt252 = 16; const RANGE_CHECK_BUILTIN_ROW_RATIO: felt252 = 256; const RANGE_CHECK_N_PARTS: felt252 = 8; +#[derive(Drop, Copy, Serde)] +struct DynamicParams {} + mod segments { const BITWISE: usize = 5; const EXECUTION: usize = 1; diff --git a/src/air/layouts/small.cairo b/src/air/layouts/small.cairo index ddcdd6f4d..49055d97f 100644 --- a/src/air/layouts/small.cairo +++ b/src/air/layouts/small.cairo @@ -12,7 +12,7 @@ use cairo_verifier::{ global_values::{GlobalValues, InteractionElements, EcPoint, EcdsaSigConfig}, public_input::SmallPublicInputImpl, constants::{ - PUBLIC_MEMORY_STEP, PEDERSEN_BUILTIN_RATIO, ECDSA_BUILTIN_RATIO, + DynamicParams, PUBLIC_MEMORY_STEP, PEDERSEN_BUILTIN_RATIO, ECDSA_BUILTIN_RATIO, ECDSA_BUILTIN_REPETITIONS, PEDERSEN_BUILTIN_REPETITIONS, segments, }, }, @@ -95,7 +95,7 @@ impl SmallAIRCompositionImpl of AIRComposition } } -impl SmallAIROodsImpl of AIROods { +impl SmallAIROodsImpl of AIROods { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -103,6 +103,7 @@ impl SmallAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DynamicParams, ) -> felt252 { eval_oods_polynomial_inner( column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator, diff --git a/src/air/layouts/small/constants.cairo b/src/air/layouts/small/constants.cairo index 87554f11d..6f51187b7 100644 --- a/src/air/layouts/small/constants.cairo +++ b/src/air/layouts/small/constants.cairo @@ -33,6 +33,9 @@ const RANGE_CHECK_BUILTIN_RATIO: felt252 = 8; const RANGE_CHECK_BUILTIN_ROW_RATIO: felt252 = 128; const RANGE_CHECK_N_PARTS: felt252 = 8; +#[derive(Drop, Copy, Serde)] +struct DynamicParams {} + mod segments { const ECDSA: usize = 5; const EXECUTION: usize = 1; diff --git a/src/air/layouts/starknet.cairo b/src/air/layouts/starknet.cairo index 2ad62c447..5b20c0387 100644 --- a/src/air/layouts/starknet.cairo +++ b/src/air/layouts/starknet.cairo @@ -14,8 +14,8 @@ use cairo_verifier::{ }, public_input::StarknetPublicInputImpl, constants::{ - PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, PEDERSEN_BUILTIN_RATIO, - PEDERSEN_BUILTIN_REPETITIONS, segments, ECDSA_BUILTIN_RATIO, + DynamicParams, PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, + PEDERSEN_BUILTIN_RATIO, PEDERSEN_BUILTIN_REPETITIONS, segments, ECDSA_BUILTIN_RATIO, ECDSA_BUILTIN_REPETITIONS, POSEIDON_RATIO }, }, @@ -145,7 +145,7 @@ impl StarknetAIRCompositionImpl of AIRComposition { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -153,6 +153,7 @@ impl StarknetAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DynamicParams, ) -> felt252 { eval_oods_polynomial_inner( column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator, diff --git a/src/air/layouts/starknet/constants.cairo b/src/air/layouts/starknet/constants.cairo index 652549080..82175b6ed 100644 --- a/src/air/layouts/starknet/constants.cairo +++ b/src/air/layouts/starknet/constants.cairo @@ -47,6 +47,9 @@ const RANGE_CHECK_BUILTIN_RATIO: felt252 = 16; const RANGE_CHECK_BUILTIN_ROW_RATIO: felt252 = 256; const RANGE_CHECK_N_PARTS: felt252 = 8; +#[derive(Drop, Copy, Serde)] +struct DynamicParams {} + mod segments { const BITWISE: usize = 6; const EC_OP: usize = 7; diff --git a/src/air/layouts/starknet_with_keccak.cairo b/src/air/layouts/starknet_with_keccak.cairo index b83ad85b8..d18434e86 100644 --- a/src/air/layouts/starknet_with_keccak.cairo +++ b/src/air/layouts/starknet_with_keccak.cairo @@ -14,8 +14,8 @@ use cairo_verifier::{ }, public_input::StarknetWithKeccakPublicInputImpl, constants::{ - PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, PEDERSEN_BUILTIN_RATIO, - PEDERSEN_BUILTIN_REPETITIONS, segments, ECDSA_BUILTIN_RATIO, + DynamicParams, PUBLIC_MEMORY_STEP, DILUTED_N_BITS, DILUTED_SPACING, + PEDERSEN_BUILTIN_RATIO, PEDERSEN_BUILTIN_REPETITIONS, segments, ECDSA_BUILTIN_RATIO, ECDSA_BUILTIN_REPETITIONS, POSEIDON_RATIO, KECCAK_RATIO }, }, @@ -167,7 +167,7 @@ impl StarknetWithKeccakAIRCompositionImpl of AIRComposition { fn eval_oods_polynomial( column_values: Span, oods_values: Span, @@ -175,6 +175,7 @@ impl StarknetWithKeccakAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + dynamic_params: DynamicParams, ) -> felt252 { eval_oods_polynomial_inner( column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator, diff --git a/src/air/layouts/starknet_with_keccak/constants.cairo b/src/air/layouts/starknet_with_keccak/constants.cairo index bd8702548..66bdcc6c2 100644 --- a/src/air/layouts/starknet_with_keccak/constants.cairo +++ b/src/air/layouts/starknet_with_keccak/constants.cairo @@ -49,6 +49,9 @@ const RANGE_CHECK_BUILTIN_RATIO: felt252 = 16; const RANGE_CHECK_BUILTIN_ROW_RATIO: felt252 = 256; const RANGE_CHECK_N_PARTS: felt252 = 8; +#[derive(Drop, Copy, Serde)] +struct DynamicParams {} + mod segments { const BITWISE: usize = 6; const EC_OP: usize = 7; diff --git a/src/air/public_input.cairo b/src/air/public_input.cairo index b89b475b9..c26b336ea 100644 --- a/src/air/public_input.cairo +++ b/src/air/public_input.cairo @@ -18,6 +18,9 @@ use cairo_verifier::{ // === STARKNET_WITH_KECCAK BEGIN === // air::layouts::starknet_with_keccak::constants::segments, // === STARKNET_WITH_KECCAK END === + // === DYNAMIC BEGIN === + // air::layouts::dynamic::constants::segments, + // === DYNAMIC END === air::public_memory::{ Page, PageTrait, ContinuousPageHeader, get_continuous_pages_product, AddrValueSize }, diff --git a/src/benches/stark/verify.cairo b/src/benches/stark/verify.cairo index a66609fcf..ccbe774f8 100644 --- a/src/benches/stark/verify.cairo +++ b/src/benches/stark/verify.cairo @@ -5,12 +5,19 @@ use cairo_verifier::{ }; fn bench_stark_verify() { + let public_input = stone_proof_fibonacci_keccak::public_input::get(); let queries = stone_proof_fibonacci_keccak::queries::get().span(); let commitment = stone_proof_fibonacci_keccak::stark::commitment::get(); let witness = stone_proof_fibonacci_keccak::stark::witness::get(); let stark_domains = stone_proof_fibonacci_keccak::stark::domains::get(); stark_verify( - NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND, queries, commitment, witness, stark_domains, + NUM_COLUMNS_FIRST, + NUM_COLUMNS_SECOND, + @public_input, + queries, + commitment, + witness, + stark_domains, ) } diff --git a/src/deserialization/stark.cairo b/src/deserialization/stark.cairo index caed9bfc1..8aa63bf41 100644 --- a/src/deserialization/stark.cairo +++ b/src/deserialization/stark.cairo @@ -21,6 +21,9 @@ use cairo_verifier::{ // === STARKNET_WITH_KECCAK BEGIN === // air::layouts::starknet_with_keccak::traces::TracesConfig, // === STARKNET_WITH_KECCAK END === + // === DYNAMIC BEGIN === + // air::layouts::dynamic::traces::TracesConfig, + // === DYNAMIC END === deserialization::{ traces::{ TracesConfigWithSerde, TracesDecommitmentWithSerde, TracesWitnessWithSerde, diff --git a/src/deserialization/traces.cairo b/src/deserialization/traces.cairo index acf2bdf33..4bc2eaf0b 100644 --- a/src/deserialization/traces.cairo +++ b/src/deserialization/traces.cairo @@ -29,6 +29,11 @@ use cairo_verifier::{ // traces::TracesConfig, traces::{TracesUnsentCommitment, TracesDecommitment, TracesWitness} // }, // === STARKNET_WITH_KECCAK END === + // === DYNAMIC BEGIN === + // air::layouts::dynamic::{ + // traces::TracesConfig, traces::{TracesUnsentCommitment, TracesDecommitment, TracesWitness} + // }, + // === DYNAMIC END === deserialization::{ vector::{ VectorCommitmentConfig, VectorCommitmentWitness, VectorCommitmentConfigWithSerde, diff --git a/src/lib.cairo b/src/lib.cairo index 5553d0c7f..e0f965fc9 100644 --- a/src/lib.cairo +++ b/src/lib.cairo @@ -39,6 +39,9 @@ use cairo_verifier::{ // === STARKNET_WITH_KECCAK BEGIN === // air::layouts::starknet_with_keccak::public_input::StarknetWithKeccakPublicInputImpl as PublicInputImpl, // === STARKNET_WITH_KECCAK END === +// === DYNAMIC BEGIN === +// air::layouts::dynamic::public_input::DynamicPublicInputImpl as PublicInputImpl, +// === DYNAMIC END === }; const SECURITY_BITS: felt252 = 50; diff --git a/src/oods.cairo b/src/oods.cairo index 615abf613..1cc7748d6 100644 --- a/src/oods.cairo +++ b/src/oods.cairo @@ -4,44 +4,51 @@ use cairo_verifier::{ // air::layouts::dex::{ // AIRComposition, AIROods, DexAIRCompositionImpl, DexAIROodsImpl, // global_values::InteractionElements, public_input::PublicInput, traces::TracesDecommitment, - // constants::CONSTRAINT_DEGREE, + // constants::{CONSTRAINT_DEGREE, DynamicParams}, // }, // === DEX END === // === RECURSIVE BEGIN === air::layouts::recursive::{ AIRComposition, AIROods, RecursiveAIRCompositionImpl, RecursiveAIROodsImpl, global_values::InteractionElements, public_input::PublicInput, traces::TracesDecommitment, - constants::CONSTRAINT_DEGREE, + constants::{CONSTRAINT_DEGREE, DynamicParams}, }, // === RECURSIVE END === // === RECURSIVE_WITH_POSEIDON BEGIN === // air::layouts::recursive_with_poseidon::{ // AIRComposition, AIROods, RecursiveWithPoseidonAIRCompositionImpl, // RecursiveWithPoseidonAIROodsImpl, global_values::InteractionElements, - // public_input::PublicInput, traces::TracesDecommitment, constants::CONSTRAINT_DEGREE, + // public_input::PublicInput, traces::TracesDecommitment, constants::{CONSTRAINT_DEGREE, DynamicParams}, // }, // === RECURSIVE_WITH_POSEIDON END === // === SMALL BEGIN === // air::layouts::small::{ // AIRComposition, AIROods, SmallAIRCompositionImpl, SmallAIROodsImpl, // global_values::InteractionElements, public_input::PublicInput, traces::TracesDecommitment, - // constants::CONSTRAINT_DEGREE, + // constants::{CONSTRAINT_DEGREE, DynamicParams}, // }, // === SMALL END === // === STARKNET BEGIN === // air::layouts::starknet::{ // AIRComposition, AIROods, StarknetAIRCompositionImpl, StarknetAIROodsImpl, // global_values::InteractionElements, public_input::PublicInput, traces::TracesDecommitment, - // constants::CONSTRAINT_DEGREE, + // constants::{CONSTRAINT_DEGREE, DynamicParams}, // }, // === STARKNET END === // === STARKNET_WITH_KECCAK BEGIN === // air::layouts::starknet_with_keccak::{ // AIRComposition, AIROods, StarknetWithKeccakAIRCompositionImpl, // StarknetWithKeccakAIROodsImpl, global_values::InteractionElements, - // public_input::PublicInput, traces::TracesDecommitment, constants::CONSTRAINT_DEGREE, + // public_input::PublicInput, traces::TracesDecommitment, constants::{CONSTRAINT_DEGREE, DynamicParams}, // }, // === STARKNET_WITH_KECCAK END === + // === DYNAMIC BEGIN === + // air::layouts::dynamic::{ + // AIRComposition, AIROods, StarknetWithKeccakAIRCompositionImpl, + // StarknetWithKeccakAIROodsImpl, global_values::InteractionElements, + // public_input::PublicInput, traces::TracesDecommitment, constants::{CONSTRAINT_DEGREE, DynamicParams}, + // }, + // === DYNAMIC END === table_commitment::table_commitment::TableDecommitment }; @@ -83,11 +90,15 @@ fn verify_oods( fn eval_oods_boundary_poly_at_points( n_original_columns: u32, n_interaction_columns: u32, + public_input: @PublicInput, eval_info: OodsEvaluationInfo, points: Span, decommitment: TracesDecommitment, composition_decommitment: TableDecommitment, ) -> Array { + let mut dynamic_params_span = public_input.dynamic_params.span(); + let dynamic_params = Serde::::deserialize(ref dynamic_params_span).unwrap(); + assert( decommitment.original.values.len() == points.len() * n_original_columns, 'Invalid value' ); @@ -132,6 +143,7 @@ fn eval_oods_boundary_poly_at_points( *points.at(i), eval_info.oods_point, eval_info.trace_generator, + dynamic_params, ) ); diff --git a/src/stark.cairo b/src/stark.cairo index 09d08521f..b4fa620fa 100644 --- a/src/stark.cairo +++ b/src/stark.cairo @@ -51,6 +51,14 @@ use cairo_verifier::{ // constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND} // }, // === STARKNET_WITH_KECCAK END === + // === DYNAMIC BEGIN === + // layouts::dynamic::{ + // traces::{TracesConfig, TracesConfigTrait}, + // public_input::StarknetWithKeccakPublicInputImpl, + // traces::{TracesUnsentCommitment, TracesCommitment, TracesDecommitment, TracesWitness}, + // constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND} + // }, + // === DYNAMIC END === }, channel::channel::{Channel, ChannelImpl}, fri::{ @@ -109,6 +117,7 @@ impl StarkProofImpl of StarkProofTrait { stark_verify::stark_verify( NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND, + self.public_input, queries.span(), stark_commitment, *self.witness, diff --git a/src/stark/stark_commit.cairo b/src/stark/stark_commit.cairo index fa6c7e506..b9df136c1 100644 --- a/src/stark/stark_commit.cairo +++ b/src/stark/stark_commit.cairo @@ -35,6 +35,12 @@ use cairo_verifier::{ // traces::traces_commit, // }, // === STARKNET_WITH_KECCAK END === + // === DYNAMIC BEGIN === + // air::layouts::dynamic::{ + // constants::{CONSTRAINT_DEGREE, N_CONSTRAINTS, MASK_SIZE}, public_input::PublicInput, + // traces::traces_commit, + // }, + // === DYNAMIC END === channel::channel::{Channel, ChannelTrait}, common::powers_array::powers_array, domains::StarkDomains, fri::fri::fri_commit, stark::{StarkUnsentCommitment, StarkConfig, StarkCommitment}, diff --git a/src/stark/stark_verify.cairo b/src/stark/stark_verify.cairo index 0944a079b..d952c7bf2 100644 --- a/src/stark/stark_verify.cairo +++ b/src/stark/stark_verify.cairo @@ -1,5 +1,5 @@ use cairo_verifier::{ - queries::queries::queries_to_points, domains::StarkDomains, + air::public_input::PublicInput, queries::queries::queries_to_points, domains::StarkDomains, fri::fri::{FriDecommitment, fri_verify}, stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}, // === DEX BEGIN === @@ -19,6 +19,9 @@ use cairo_verifier::{ // === STARKNET_WITH_KECCAK BEGIN === // air::layouts::starknet_with_keccak::traces::traces_decommit, // === STARKNET_WITH_KECCAK END === + // === DYNAMIC BEGIN === + // air::layouts::dynamic::traces::traces_decommit, + // === DYNAMIC END === table_commitment::table_commitment::table_decommit, oods::{OodsEvaluationInfo, eval_oods_boundary_poly_at_points}, }; @@ -27,6 +30,7 @@ use cairo_verifier::{ fn stark_verify( n_original_columns: u32, n_interaction_columns: u32, + public_input: @PublicInput, queries: Span, commitment: StarkCommitment, witness: StarkWitness, @@ -57,6 +61,7 @@ fn stark_verify( let oods_poly_evals = eval_oods_boundary_poly_at_points( n_original_columns, n_interaction_columns, + public_input, eval_info, points.span(), witness.traces_decommitment, diff --git a/src/stark/tests/test_stark_verify.cairo b/src/stark/tests/test_stark_verify.cairo index 79ed05e3e..895a3409c 100644 --- a/src/stark/tests/test_stark_verify.cairo +++ b/src/stark/tests/test_stark_verify.cairo @@ -23,13 +23,20 @@ use cairo_verifier::{ #[test] #[available_gas(9999999999)] fn test_stark_verify() { + let public_input = stone_proof_fibonacci_keccak::public_input::get(); let queries = stone_proof_fibonacci_keccak::queries::get().span(); let commitment = stone_proof_fibonacci_keccak::stark::commitment::get(); let witness = stone_proof_fibonacci_keccak::stark::witness::get(); let stark_domains = stone_proof_fibonacci_keccak::stark::domains::get(); stark_verify( - NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND, queries, commitment, witness, stark_domains, + NUM_COLUMNS_FIRST, + NUM_COLUMNS_SECOND, + @public_input, + queries, + commitment, + witness, + stark_domains, ) } // === KECCAK END ===