From 644f5d38bb0d546ccbe9eed8df9ea30616505669 Mon Sep 17 00:00:00 2001 From: Filip Krawczyk Date: Thu, 15 Aug 2024 09:22:13 +0200 Subject: [PATCH] Fix compilation errors --- src/air/layouts/recursive.cairo | 5 ++++- src/benches/fri/verify.cairo | 7 ++++--- src/benches/stark/commit.cairo | 2 +- src/benches/stark/stark_proof_verify.cairo | 2 +- src/benches/stark/verify.cairo | 4 ++-- src/fri/tests/test_fri_verify.cairo | 11 ++++++----- src/oods.cairo | 3 ++- src/stark/tests/test_stark_commit.cairo | 2 +- src/stark/tests/test_stark_proof_verify.cairo | 5 +++-- src/stark/tests/test_stark_verify.cairo | 5 +++-- 10 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/air/layouts/recursive.cairo b/src/air/layouts/recursive.cairo index 3c13a775e..089b8857e 100644 --- a/src/air/layouts/recursive.cairo +++ b/src/air/layouts/recursive.cairo @@ -22,6 +22,7 @@ use cairo_verifier::{ }, common::{math::{Felt252Div, Felt252PartialOrd, pow}, asserts::assert_range_u128} }; +use starknet::ContractAddress; impl RecursiveAIRCompositionImpl of AIRComposition { fn eval_composition_polynomial( @@ -31,7 +32,8 @@ impl RecursiveAIRCompositionImpl of AIRComposition, point: felt252, trace_domain_size: felt252, - trace_generator: felt252 + trace_generator: felt252, + contract_address_1: ContractAddress, ) -> felt252 { let memory_z = interaction_elements.memory_multi_column_perm_perm_interaction_elm; let memory_alpha = interaction_elements.memory_multi_column_perm_hash_interaction_elm0; @@ -104,6 +106,7 @@ impl RecursiveAIROodsImpl of AIROods { point: felt252, oods_point: felt252, trace_generator: felt252, + contract_address_2: ContractAddress, ) -> felt252 { eval_oods_polynomial_inner( column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator, diff --git a/src/benches/fri/verify.cairo b/src/benches/fri/verify.cairo index 855118dfb..b71e57ffd 100644 --- a/src/benches/fri/verify.cairo +++ b/src/benches/fri/verify.cairo @@ -1,11 +1,12 @@ -use cairo_verifier::{fri::fri::fri_verify, tests::stone_proof_fibonacci_keccak}; +use cairo_verifier::{fri::fri::fri_verify_initial, tests::stone_proof_fibonacci_keccak}; fn bench_fri_verify() { let queries = stone_proof_fibonacci_keccak::queries::get().span(); let commitment = stone_proof_fibonacci_keccak::fri::commitment::get(); let decommitment = stone_proof_fibonacci_keccak::fri::decommitment::get(); - let witness = stone_proof_fibonacci_keccak::fri::witness::get(); + let _witness = stone_proof_fibonacci_keccak::fri::witness::get(); - fri_verify(queries, commitment, decommitment, witness) + fri_verify_initial(queries, commitment, decommitment); + // TODO: add next steps } diff --git a/src/benches/stark/commit.cairo b/src/benches/stark/commit.cairo index 31773f5d4..09d515dce 100644 --- a/src/benches/stark/commit.cairo +++ b/src/benches/stark/commit.cairo @@ -13,5 +13,5 @@ fn bench_stark_commit() { let config = stone_proof_fibonacci_keccak::stark::config::get(); let stark_domains = stone_proof_fibonacci_keccak::stark::domains::get(); - stark_commit(ref channel, @public_input, @unsent_commitment, @config, @stark_domains); + stark_commit(ref channel, @public_input, @unsent_commitment, @config, @stark_domains, 0.try_into().unwrap()); } diff --git a/src/benches/stark/stark_proof_verify.cairo b/src/benches/stark/stark_proof_verify.cairo index 77e1925c5..41a5452f9 100644 --- a/src/benches/stark/stark_proof_verify.cairo +++ b/src/benches/stark/stark_proof_verify.cairo @@ -10,5 +10,5 @@ fn bench_stark_proof_verify() { witness: stone_proof_fibonacci_keccak::stark::witness::get(), }; - stark_proof.verify(security_bits); + stark_proof.verify_initial(security_bits, 0.try_into().unwrap(), 0.try_into().unwrap()); } diff --git a/src/benches/stark/verify.cairo b/src/benches/stark/verify.cairo index a66609fcf..0e0bf66ce 100644 --- a/src/benches/stark/verify.cairo +++ b/src/benches/stark/verify.cairo @@ -11,6 +11,6 @@ fn bench_stark_verify() { 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, queries, commitment, witness, stark_domains, 0.try_into().unwrap() + ); } diff --git a/src/fri/tests/test_fri_verify.cairo b/src/fri/tests/test_fri_verify.cairo index 4629871b1..a0bfdcd87 100644 --- a/src/fri/tests/test_fri_verify.cairo +++ b/src/fri/tests/test_fri_verify.cairo @@ -1,5 +1,5 @@ use cairo_verifier::{ - fri::fri::fri_verify, tests::{stone_proof_fibonacci, stone_proof_fibonacci_keccak} + fri::fri::fri_verify_initial, tests::{stone_proof_fibonacci, stone_proof_fibonacci_keccak} }; // === BLAKE2S BEGIN === @@ -9,9 +9,9 @@ use cairo_verifier::{ // let queries = stone_proof_fibonacci::queries::get().span(); // let commitment = stone_proof_fibonacci::fri::commitment::get(); // let decommitment = stone_proof_fibonacci::fri::decommitment::get(); -// let witness = stone_proof_fibonacci::fri::witness::get(); +// let _witness = stone_proof_fibonacci::fri::witness::get(); -// fri_verify(queries, commitment, decommitment, witness) +// fri_verify_initial(queries, commitment, decommitment) // } // === BLAKE2S END === @@ -22,9 +22,10 @@ fn test_fri_verify() { let queries = stone_proof_fibonacci_keccak::queries::get().span(); let commitment = stone_proof_fibonacci_keccak::fri::commitment::get(); let decommitment = stone_proof_fibonacci_keccak::fri::decommitment::get(); - let witness = stone_proof_fibonacci_keccak::fri::witness::get(); + let _witness = stone_proof_fibonacci_keccak::fri::witness::get(); - fri_verify(queries, commitment, decommitment, witness) + fri_verify_initial(queries, commitment, decommitment); + // TODO: next steps } // === KECCAK END === diff --git a/src/oods.cairo b/src/oods.cairo index be5d27b45..ddec95632 100644 --- a/src/oods.cairo +++ b/src/oods.cairo @@ -167,7 +167,8 @@ mod tests { constraint_coefficients.span(), 0x47148421d376a8ca07af1e4c89890bf29c90272f63b16103646397d907281a8, 0x40000, - 0x4768803ef85256034f67453635f87997ff61841e411ee63ce7b0a8b9745a046 + 0x4768803ef85256034f67453635f87997ff61841e411ee63ce7b0a8b9745a046, + 0.try_into().unwrap() ); } } diff --git a/src/stark/tests/test_stark_commit.cairo b/src/stark/tests/test_stark_commit.cairo index 620694c6a..22b5ed47b 100644 --- a/src/stark/tests/test_stark_commit.cairo +++ b/src/stark/tests/test_stark_commit.cairo @@ -46,7 +46,7 @@ fn test_stark_commit() { assert( stark_commit( - ref channel, @public_input, @unsent_commitment, @config, @stark_domains + ref channel, @public_input, @unsent_commitment, @config, @stark_domains, 0.try_into().unwrap() ) == stone_proof_fibonacci_keccak::stark::commitment::get(), 'Invalid value' ); diff --git a/src/stark/tests/test_stark_proof_verify.cairo b/src/stark/tests/test_stark_proof_verify.cairo index 03b492b63..587fcaefb 100644 --- a/src/stark/tests/test_stark_proof_verify.cairo +++ b/src/stark/tests/test_stark_proof_verify.cairo @@ -16,7 +16,7 @@ use cairo_verifier::{ // witness: stone_proof_fibonacci::stark::witness::get(), // }; // -// stark_proof.verify(security_bits); +// stark_proof.verify_initial(security_bits); // } // === BLAKE2S END === @@ -33,7 +33,8 @@ fn test_stark_proof_fibonacci_verify() { witness: stone_proof_fibonacci_keccak::stark::witness::get(), }; - stark_proof.verify(security_bits); + stark_proof.verify_initial(security_bits, 0.try_into().unwrap(), 0.try_into().unwrap()); + // TODO: next steps } // === KECCAK END === diff --git a/src/stark/tests/test_stark_verify.cairo b/src/stark/tests/test_stark_verify.cairo index 79ed05e3e..0cc8ca595 100644 --- a/src/stark/tests/test_stark_verify.cairo +++ b/src/stark/tests/test_stark_verify.cairo @@ -29,8 +29,9 @@ fn test_stark_verify() { 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, queries, commitment, witness, stark_domains, 0.try_into().unwrap() + ); + // TODO: next steps } // === KECCAK END ===