Skip to content

Commit

Permalink
split monolith missing layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Sep 12, 2024
1 parent 372244d commit 3ae439c
Show file tree
Hide file tree
Showing 6 changed files with 17,884 additions and 1,282 deletions.
95 changes: 87 additions & 8 deletions src/air/layouts/starknet.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,78 @@ use cairo_verifier::{
};
use starknet::ContractAddress;

#[cfg(feature: 'monolith')]
use cairo_verifier::air::layouts::starknet::autogenerated::{
eval_composition_polynomial_inner as eval_composition_polynomial_inner_,
eval_oods_polynomial_inner as eval_oods_polynomial_inner_,
};

#[cfg(feature: 'monolith')]
fn eval_composition_polynomial_inner(
mask_values: Span<felt252>,
constraint_coefficients: Span<felt252>,
point: felt252,
trace_generator: felt252,
global_values: GlobalValues,
contract_address: ContractAddress,
) -> felt252 {
eval_composition_polynomial_inner_(
mask_values, constraint_coefficients, point, trace_generator, global_values
)
}

#[cfg(feature: 'monolith')]
fn eval_oods_polynomial_inner(
column_values: Span<felt252>,
oods_values: Span<felt252>,
constraint_coefficients: Span<felt252>,
point: felt252,
oods_point: felt252,
trace_generator: felt252,
contract_address: ContractAddress,
) -> felt252 {
eval_oods_polynomial_inner_(
column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator,
)
}

#[cfg(feature: 'split')]
use cairo_verifier::air::layouts::starknet::contract::{
ILayoutCompositionContractDispatcher, ILayoutCompositionContractDispatcherTrait,
ILayoutOodsContractDispatcher, ILayoutOodsContractDispatcherTrait,
};

#[cfg(feature: 'split')]
fn eval_composition_polynomial_inner(
mask_values: Span<felt252>,
constraint_coefficients: Span<felt252>,
point: felt252,
trace_generator: felt252,
global_values: GlobalValues,
contract_address: ContractAddress,
) -> felt252 {
ILayoutCompositionContractDispatcher { contract_address }
.eval_composition_polynomial_inner(
mask_values, constraint_coefficients, point, trace_generator, global_values
)
}

#[cfg(feature: 'split')]
fn eval_oods_polynomial_inner(
column_values: Span<felt252>,
oods_values: Span<felt252>,
constraint_coefficients: Span<felt252>,
point: felt252,
oods_point: felt252,
trace_generator: felt252,
contract_address: ContractAddress,
) -> felt252 {
ILayoutOodsContractDispatcher { contract_address }
.eval_oods_polynomial_inner(
column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator,
)
}

impl StarknetAIRCompositionImpl of AIRComposition<InteractionElements, PublicInput> {
fn eval_composition_polynomial(
interaction_elements: InteractionElements,
Expand Down Expand Up @@ -145,10 +217,13 @@ impl StarknetAIRCompositionImpl of AIRComposition<InteractionElements, PublicInp
diluted_check_final_cum_val: diluted_prod
};

IStarknetLayoutContract1Dispatcher {
contract_address: contract_address_1
}.eval_composition_polynomial_inner(
mask_values, constraint_coefficients, point, trace_generator, global_values
eval_composition_polynomial_inner(
mask_values,
constraint_coefficients,
point,
trace_generator,
global_values,
contract_address,
)
}
}
Expand All @@ -163,10 +238,14 @@ impl StarknetAIROodsImpl of AIROods {
trace_generator: felt252,
contract_address: ContractAddress,
) -> felt252 {
IStarknetLayoutContract2Dispatcher {
contract_address: contract_address_2
}.eval_oods_polynomial_inner(
column_values, oods_values, constraint_coefficients, point, oods_point, trace_generator,
eval_oods_polynomial_inner(
column_values,
oods_values,
constraint_coefficients,
point,
oods_point,
trace_generator,
contract_address,
)
}
}
Loading

0 comments on commit 3ae439c

Please sign in to comment.