Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-deng committed Sep 23, 2024
1 parent 2b2e737 commit 84860a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 70 deletions.
4 changes: 0 additions & 4 deletions evm_arithmetization/src/all_stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ pub const NUM_TABLES: usize = if cfg!(feature = "cdk_erigon") {
Table::MemAfter as usize + 1
};

/// Indices of Keccak Tables
pub const KECCAK_TABLES_INDICES: [usize; 2] =
[Table::Keccak as usize, Table::KeccakSponge as usize];

impl Table {
/// Returns all STARK table indices.
pub(crate) const fn all() -> [Self; NUM_TABLES] {
Expand Down
67 changes: 1 addition & 66 deletions evm_arithmetization/src/fixed_recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::sync::Arc;
use anyhow::anyhow;
use hashbrown::HashMap;
use itertools::{zip_eq, Itertools};
use log::info;
use mpt_trie::partial_trie::{HashedPartialTrie, Node, PartialTrie};
use plonky2::field::extension::Extendable;
use plonky2::fri::FriParams;
Expand Down Expand Up @@ -36,10 +35,7 @@ use starky::lookup::{get_grand_product_challenge_set_target, GrandProductChallen
use starky::proof::StarkProofWithMetadata;
use starky::stark::Stark;

use crate::all_stark::Table::Keccak;
use crate::all_stark::{
all_cross_table_lookups, AllStark, Table, KECCAK_TABLES_INDICES, NUM_TABLES,
};
use crate::all_stark::{all_cross_table_lookups, AllStark, Table, NUM_TABLES};
use crate::cpu::kernel::aggregator::KERNEL;
use crate::generation::segments::{GenerationSegmentData, SegmentDataIterator, SegmentError};
use crate::generation::{GenerationInputs, TrimmedGenerationInputs};
Expand Down Expand Up @@ -132,8 +128,6 @@ where
/// for EVM root proofs; the circuit has them just to match the
/// structure of aggregation proofs.
cyclic_vk: VerifierCircuitTarget,
// We can skip verifying Keccak tables when they are not in use.
// enable_keccak_tables: BoolTarget,
}

impl<F, C, const D: usize> RootCircuitData<F, C, D>
Expand Down Expand Up @@ -790,8 +784,6 @@ where

let mut builder = CircuitBuilder::new(CircuitConfig::standard_recursion_config());

let enable_keccak_tables = builder.add_virtual_bool_target_safe();
let disable_keccak_tables = builder.not(enable_keccak_tables);
let public_values = add_virtual_public_values_public_input(&mut builder);

let recursive_proofs =
Expand Down Expand Up @@ -862,14 +854,6 @@ where
})
.collect_vec();

// When Keccak Tables are disabled, Keccak Tables' ctl_zs_first should be 0s.
for &tbl in KECCAK_TABLES_INDICES.iter() {
for &t in pis[tbl].ctl_zs_first.iter() {
let keccak_ctl_check = builder.mul(disable_keccak_tables.target, t);
builder.assert_zero(keccak_ctl_check);
}
}

// Verify the CTL checks.
verify_cross_table_lookups_circuit::<F, D, NUM_TABLES>(
&mut builder,
Expand Down Expand Up @@ -899,20 +883,11 @@ where
let inner_verifier_data =
builder.random_access_verifier_data(index_verifier_data[i], possible_vks);

// if KECCAK_TABLES_INDICES.contains(&i) {
// builder.conditionally_verify_proof_or_dummy::<C>(
// enable_keccak_tables,
// &recursive_proofs[i],
// &inner_verifier_data,
// inner_common_data[i],
// )?;
// } else {
builder.verify_proof::<C>(
&recursive_proofs[i],
&inner_verifier_data,
inner_common_data[i],
);
// }
}

let merkle_before =
Expand Down Expand Up @@ -943,7 +918,6 @@ where
index_verifier_data,
public_values,
cyclic_vk,
// enable_keccak_tables,
}
}

Expand Down Expand Up @@ -1842,45 +1816,6 @@ where
timing,
abort_signal.clone(),
)?;
info!(
"Debugging trace_cap.0[0]: {:?}",
&all_proof.multi_proof.stark_proofs[*Table::Keccak]
.proof
.trace_cap
.0[0]
);

info!(
"Debugging openings.ctl_zs_first: {:?}",
&all_proof.multi_proof.stark_proofs[*Table::Keccak]
.proof
.openings
.ctl_zs_first
);

info!(
"Debugging trace_cap.0[0] for KeccakSponge: {:?}",
&all_proof.multi_proof.stark_proofs[*Table::KeccakSponge]
.proof
.trace_cap
.0[0]
);

info!(
"Debugging openings.ctl_zs_first for KeccakSponge: {:?}",
&all_proof.multi_proof.stark_proofs[*Table::KeccakSponge]
.proof
.openings
.ctl_zs_first
);

info!(
"Debugging openings.ctl_zs_first for Logic: {:?}",
&all_proof.multi_proof.stark_proofs[*Table::Logic]
.proof
.openings
.ctl_zs_first
);

let mut root_inputs = PartialWitness::new();

Expand Down

0 comments on commit 84860a9

Please sign in to comment.