Skip to content

Commit

Permalink
traces validation layout specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Aug 28, 2024
1 parent cc964d1 commit d9dab7d
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 20 deletions.
8 changes: 6 additions & 2 deletions src/air/layouts/dex/traces.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use cairo_verifier::{
air::layouts::dex::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
air::{
public_input::PublicInput,
layouts::dex::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
}
},
channel::channel::{Channel, ChannelTrait},
table_commitment::table_commitment::{
Expand Down Expand Up @@ -69,6 +72,7 @@ struct TracesConfig {
impl TracesConfigImpl of TracesConfigTrait {
fn validate(
self: @TracesConfig,
public_input: @PublicInput,
log_eval_domain_size: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {
Expand Down
7 changes: 5 additions & 2 deletions src/air/layouts/dynamic/traces.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use cairo_verifier::{
air::layouts::dynamic::{global_values::InteractionElements, constants::DynamicParams},
air::{
public_input::PublicInput,
layouts::dynamic::{global_values::InteractionElements, constants::DynamicParams}
},
channel::channel::{Channel, ChannelTrait},
table_commitment::table_commitment::{
TableCommitment, TableDecommitment, TableCommitmentWitness, table_commit, table_decommit,
Expand Down Expand Up @@ -67,7 +70,7 @@ struct TracesConfig {
impl TracesConfigImpl of TracesConfigTrait {
fn validate(
self: @TracesConfig,
dynamic_params: @DynamicParams,
public_input: @PublicInput,
log_eval_domain_size: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {
Expand Down
8 changes: 6 additions & 2 deletions src/air/layouts/recursive/traces.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use cairo_verifier::{
air::layouts::recursive::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
air::{
public_input::PublicInput,
layouts::recursive::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
}
},
channel::channel::{Channel, ChannelTrait},
table_commitment::table_commitment::{
Expand Down Expand Up @@ -69,6 +72,7 @@ struct TracesConfig {
impl TracesConfigImpl of TracesConfigTrait {
fn validate(
self: @TracesConfig,
public_input: @PublicInput,
log_eval_domain_size: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {
Expand Down
8 changes: 6 additions & 2 deletions src/air/layouts/recursive_with_poseidon/traces.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use cairo_verifier::{
air::layouts::recursive_with_poseidon::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
air::{
public_input::PublicInput,
layouts::recursive_with_poseidon::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
}
},
channel::channel::{Channel, ChannelTrait},
table_commitment::table_commitment::{
Expand Down Expand Up @@ -69,6 +72,7 @@ struct TracesConfig {
impl TracesConfigImpl of TracesConfigTrait {
fn validate(
self: @TracesConfig,
public_input: @PublicInput,
log_eval_domain_size: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {
Expand Down
8 changes: 6 additions & 2 deletions src/air/layouts/small/traces.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use cairo_verifier::{
air::layouts::small::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
air::{
public_input::PublicInput,
layouts::small::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
}
},
channel::channel::{Channel, ChannelTrait},
table_commitment::table_commitment::{
Expand Down Expand Up @@ -69,6 +72,7 @@ struct TracesConfig {
impl TracesConfigImpl of TracesConfigTrait {
fn validate(
self: @TracesConfig,
public_input: @PublicInput,
log_eval_domain_size: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {
Expand Down
8 changes: 6 additions & 2 deletions src/air/layouts/starknet/traces.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use cairo_verifier::{
air::layouts::starknet::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
air::{
public_input::PublicInput,
layouts::starknet::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
}
},
channel::channel::{Channel, ChannelTrait},
table_commitment::table_commitment::{
Expand Down Expand Up @@ -69,6 +72,7 @@ struct TracesConfig {
impl TracesConfigImpl of TracesConfigTrait {
fn validate(
self: @TracesConfig,
public_input: @PublicInput,
log_eval_domain_size: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {
Expand Down
8 changes: 6 additions & 2 deletions src/air/layouts/starknet_with_keccak/traces.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use cairo_verifier::{
air::layouts::starknet_with_keccak::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
air::{
public_input::PublicInput,
layouts::starknet_with_keccak::{
constants::{NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND}, global_values::InteractionElements,
}
},
channel::channel::{Channel, ChannelTrait},
table_commitment::table_commitment::{
Expand Down Expand Up @@ -69,6 +72,7 @@ struct TracesConfig {
impl TracesConfigImpl of TracesConfigTrait {
fn validate(
self: @TracesConfig,
public_input: @PublicInput,
log_eval_domain_size: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {
Expand Down
4 changes: 2 additions & 2 deletions src/oods.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ use cairo_verifier::{
// === STARKNET_WITH_KECCAK END ===
// === DYNAMIC BEGIN ===
// air::layouts::dynamic::{
// AIRComposition, AIROods, StarknetWithKeccakAIRCompositionImpl,
// StarknetWithKeccakAIROodsImpl, global_values::InteractionElements,
// AIRComposition, AIROods, DynamicAIRCompositionImpl,
// DynamicAIROodsImpl, global_values::InteractionElements,
// public_input::PublicInput, traces::TracesDecommitment, constants::{CONSTRAINT_DEGREE, NUM_COLUMNS_FIRST, NUM_COLUMNS_SECOND, DynamicParams},
// },
// === DYNAMIC END ===
Expand Down
12 changes: 8 additions & 4 deletions src/stark.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use cairo_verifier::{
// === DYNAMIC BEGIN ===
// layouts::dynamic::{
// traces::{TracesConfig, TracesConfigTrait},
// public_input::StarknetWithKeccakPublicInputImpl,
// public_input::DynamicPublicInputImpl,
// traces::{TracesUnsentCommitment, TracesCommitment, TracesDecommitment, TracesWitness},
// },
// === DYNAMIC END ===
Expand Down Expand Up @@ -81,7 +81,7 @@ struct StarkProof {
impl StarkProofImpl of StarkProofTrait {
fn verify(self: @StarkProof, security_bits: felt252) {
// Validate config.
self.config.validate(security_bits);
self.config.validate(self.public_input, security_bits);

// Validate the public input.
let stark_domains = StarkDomainsImpl::new(
Expand Down Expand Up @@ -132,7 +132,7 @@ struct StarkConfig {

#[generate_trait]
impl StarkConfigImpl of StarkConfigTrait {
fn validate(self: @StarkConfig, security_bits: felt252) {
fn validate(self: @StarkConfig, public_input: @PublicInput, security_bits: felt252) {
// Validate Proof of work config.
self.proof_of_work.validate();

Expand All @@ -146,7 +146,11 @@ impl StarkConfigImpl of StarkConfigTrait {

// Validate traces config.
let log_eval_domain_size = *self.log_trace_domain_size + *self.log_n_cosets;
self.traces.validate(log_eval_domain_size, *self.n_verifier_friendly_commitment_layers);
self
.traces
.validate(
public_input, log_eval_domain_size, *self.n_verifier_friendly_commitment_layers
);

// Validate composition config.
self
Expand Down

0 comments on commit d9dab7d

Please sign in to comment.