diff --git a/src/air/layouts/starknet.cairo b/src/air/layouts/starknet.cairo index 6a30e09a..c1f2d330 100644 --- a/src/air/layouts/starknet.cairo +++ b/src/air/layouts/starknet.cairo @@ -3,16 +3,13 @@ mod constants; mod global_values; mod public_input; mod traces; +#[cfg(feature: 'split')] mod contract; use cairo_verifier::{ air::{ constants::{SHIFT_POINT_X, SHIFT_POINT_Y, StarkCurve}, layouts::starknet::{ - contract::{ - IStarknetLayoutContract1Dispatcher, IStarknetLayoutContract1DispatcherTrait, - IStarknetLayoutContract2Dispatcher, IStarknetLayoutContract2DispatcherTrait, - }, global_values::{ GlobalValues, InteractionElements, EcPoint, EcdsaSigConfig, CurveConfig }, diff --git a/src/air/layouts/starknet/contract.cairo b/src/air/layouts/starknet/contract.cairo index 709dee11..756a06ad 100644 --- a/src/air/layouts/starknet/contract.cairo +++ b/src/air/layouts/starknet/contract.cairo @@ -27,7 +27,7 @@ trait ILayoutOodsContract { #[starknet::contract] mod LayoutCompositionContract { - use super::ILayoutCompositionContract; + use super::{ILayoutCompositionContract, ILayoutCompositionContractDispatcher}; use cairo_verifier::air::layouts::starknet::{ global_values::GlobalValues, autogenerated::eval_composition_polynomial_inner_part_1, }; @@ -35,7 +35,7 @@ mod LayoutCompositionContract { #[storage] struct Storage { - continuation_contracts: Array, + continuation_contracts: Span, } #[abi(embed_v0)] @@ -48,8 +48,10 @@ mod LayoutCompositionContract { trace_generator: felt252, global_values: GlobalValues ) -> felt252 { + let mut continuation_contracts = self.continuation_contracts.read(); + let mut total_sum = ILayoutCompositionContractDispatcher { - contract_address: continuation_contracts[0] + contract_address: continuation_contracts.pop_front().unwrap() } .eval_composition_polynomial_inner( mask_values, @@ -60,7 +62,9 @@ mod LayoutCompositionContract { ); total_sum += - ILayoutCompositionContractDispatcher { contract_address: continuation_contracts[1] } + ILayoutCompositionContractDispatcher { + contract_address: continuation_contracts.pop_front().unwrap() + } .eval_composition_polynomial_inner( mask_values, constraint_coefficients.slice(99, 99), diff --git a/src/air/layouts/starknet_with_keccak.cairo b/src/air/layouts/starknet_with_keccak.cairo index bd6301cc..d1d249fb 100644 --- a/src/air/layouts/starknet_with_keccak.cairo +++ b/src/air/layouts/starknet_with_keccak.cairo @@ -3,18 +3,13 @@ mod constants; mod global_values; mod public_input; mod traces; +#[cfg(feature: 'split')] mod contract; use cairo_verifier::{ air::{ constants::{SHIFT_POINT_X, SHIFT_POINT_Y, StarkCurve}, layouts::starknet_with_keccak::{ - contract::{ - IStarknetWithKeccakLayoutContract1Dispatcher, - IStarknetWithKeccakLayoutContract1DispatcherTrait, - IStarknetWithKeccakLayoutContract2Dispatcher, - IStarknetWithKeccakLayoutContract2DispatcherTrait, - }, global_values::{ GlobalValues, InteractionElements, EcPoint, EcdsaSigConfig, CurveConfig }, diff --git a/src/air/layouts/starknet_with_keccak/contract.cairo b/src/air/layouts/starknet_with_keccak/contract.cairo index 3e503210..788e98ad 100644 --- a/src/air/layouts/starknet_with_keccak/contract.cairo +++ b/src/air/layouts/starknet_with_keccak/contract.cairo @@ -46,8 +46,10 @@ mod LayoutCompositionContract { trace_generator: felt252, global_values: GlobalValues ) -> felt252 { + let mut continuation_contracts = self.continuation_contracts.read(); + let mut total_sum = ILayoutCompositionContractDispatcher { - contract_address: continuation_contracts[0] + contract_address: continuation_contracts.pop_front().unwrap() } .eval_composition_polynomial_inner( mask_values, @@ -58,7 +60,9 @@ mod LayoutCompositionContract { ); total_sum += - ILayoutCompositionContractDispatcher { contract_address: continuation_contracts[1] } + ILayoutCompositionContractDispatcher { + contract_address: continuation_contracts.pop_front().unwrap() + } .eval_composition_polynomial_inner( mask_values, constraint_coefficients.slice(95, 100), @@ -68,7 +72,9 @@ mod LayoutCompositionContract { ); total_sum += - ILayoutCompositionContractDispatcher { contract_address: continuation_contracts[2] } + ILayoutCompositionContractDispatcher { + contract_address: continuation_contracts.pop_front().unwrap() + } .eval_composition_polynomial_inner( mask_values, constraint_coefficients.slice(195, 34), @@ -78,7 +84,9 @@ mod LayoutCompositionContract { ); total_sum += - ILayoutCompositionContractDispatcher { contract_address: continuation_contracts[3] } + ILayoutCompositionContractDispatcher { + contract_address: continuation_contracts.pop_front().unwrap() + } .eval_composition_polynomial_inner( mask_values, constraint_coefficients.slice(229, 31), @@ -88,7 +96,9 @@ mod LayoutCompositionContract { ); total_sum += - ILayoutCompositionContractDispatcher { contract_address: continuation_contracts[4] } + ILayoutCompositionContractDispatcher { + contract_address: continuation_contracts.pop_front().unwrap() + } .eval_composition_polynomial_inner( mask_values, constraint_coefficients.slice(260, 25), @@ -98,7 +108,9 @@ mod LayoutCompositionContract { ); total_sum += - ILayoutCompositionContractDispatcher { contract_address: continuation_contracts[5] } + ILayoutCompositionContractDispatcher { + contract_address: continuation_contracts.pop_front().unwrap() + } .eval_composition_polynomial_inner( mask_values, constraint_coefficients.slice(285, 25), @@ -108,7 +120,9 @@ mod LayoutCompositionContract { ); total_sum += - ILayoutCompositionContractDispatcher { contract_address: continuation_contracts[6] } + ILayoutCompositionContractDispatcher { + contract_address: continuation_contracts.pop_front().unwrap() + } .eval_composition_polynomial_inner( mask_values, constraint_coefficients.slice(310, 37),