Skip to content

Commit

Permalink
Apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hratoanina authored and Nashtare committed Jul 27, 2023
1 parent 232989f commit b16c118
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 54 deletions.
7 changes: 3 additions & 4 deletions evm/src/cross_table_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,11 @@ pub(crate) fn verify_cross_table_lookups<F: RichField + Extendable<D>, const D:
{
let extra_product_vec = &ctl_extra_looking_products[looked_table.table as usize];
for c in 0..config.num_challenges {
let mut looking_zs_prod = looking_tables
let looking_zs_prod = looking_tables
.iter()
.map(|table| *ctl_zs_openings[table.table as usize].next().unwrap())
.product::<F>();

looking_zs_prod *= extra_product_vec[c];
.product::<F>()
* extra_product_vec[c];

let looked_z = *ctl_zs_openings[looked_table.table as usize].next().unwrap();
println!("Checking {:?} CTL...", looked_table.table);
Expand Down
30 changes: 5 additions & 25 deletions evm/src/fixed_recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,32 +466,12 @@ where
}

// Extra products to add to the looked last value
let mut extra_looking_products = Vec::new();
for _ in 0..NUM_TABLES {
extra_looking_products.push(Vec::new());
}

// Arithmetic
for _ in 0..stark_config.num_challenges {
extra_looking_products[Table::Arithmetic as usize].push(builder.constant(F::ONE));
}

// KeccakSponge
for _ in 0..stark_config.num_challenges {
extra_looking_products[Table::KeccakSponge as usize].push(builder.constant(F::ONE));
}

// Keccak
for _ in 0..stark_config.num_challenges {
extra_looking_products[Table::Keccak as usize].push(builder.constant(F::ONE));
}

// Logic
for _ in 0..stark_config.num_challenges {
extra_looking_products[Table::Logic as usize].push(builder.constant(F::ONE));
}
// Arithmetic, KeccakSponge, Keccak, Logic
let mut extra_looking_products =
vec![vec![builder.constant(F::ONE); stark_config.num_challenges]; NUM_TABLES - 1];

// Memory
extra_looking_products.push(Vec::new());
for c in 0..stark_config.num_challenges {
extra_looking_products[Table::Memory as usize].push(
Self::get_memory_extra_looking_products_circuit(
Expand Down Expand Up @@ -746,7 +726,7 @@ where
builder.connect(row[3], field_target);
// values
for j in 0..VALUE_LIMBS {
builder.connect(row[j + 4], targets[j]);
builder.connect(row[4 + j], targets[j]);
}
// timestamp
builder.connect(row[12], timestamp_target);
Expand Down
1 change: 1 addition & 0 deletions evm/src/generation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ pub(crate) fn generate_traces<F: RichField + Extendable<D>, const D: usize>(
GenerationOutputs,
)> {
let mut state = GenerationState::<F>::new(inputs.clone(), &KERNEL.code);

apply_metadata_memops(&mut state, &inputs.block_metadata);

generate_bootstrap_kernel::<F>(&mut state);
Expand Down
29 changes: 4 additions & 25 deletions evm/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,33 +112,12 @@ where

let public_values = all_proof.public_values;

// Extra products to add to the looked last value.
let mut extra_looking_products = Vec::new();
for _ in 0..NUM_TABLES {
extra_looking_products.push(Vec::new());
}

// Arithmetic
for _ in 0..config.num_challenges {
extra_looking_products[Table::Arithmetic as usize].push(F::ONE);
}

// KeccakSponge
for _ in 0..config.num_challenges {
extra_looking_products[Table::KeccakSponge as usize].push(F::ONE);
}

// Keccak
for _ in 0..config.num_challenges {
extra_looking_products[Table::Keccak as usize].push(F::ONE);
}

// Logic
for _ in 0..config.num_challenges {
extra_looking_products[Table::Logic as usize].push(F::ONE);
}
// Extra products to add to the looked last value
// Arithmetic, KeccakSponge, Keccak, Logic
let mut extra_looking_products = vec![vec![F::ONE; config.num_challenges]; NUM_TABLES - 1];

// Memory
extra_looking_products.push(Vec::new());
let cpu_trace_len = 1 << all_proof.stark_proofs[1].proof.recover_degree_bits(config);
for c in 0..config.num_challenges {
extra_looking_products[Table::Memory as usize].push(get_memory_extra_looking_products(
Expand Down

0 comments on commit b16c118

Please sign in to comment.