diff --git a/evm_arithmetization/src/cpu/kernel/interpreter.rs b/evm_arithmetization/src/cpu/kernel/interpreter.rs index 36a2034ee..3d5d46220 100644 --- a/evm_arithmetization/src/cpu/kernel/interpreter.rs +++ b/evm_arithmetization/src/cpu/kernel/interpreter.rs @@ -11,7 +11,7 @@ use std::collections::{BTreeSet, HashMap}; use anyhow::anyhow; use ethereum_types::{BigEndianHash, U256}; use keccak_hash::H256; -use log::{trace, Level}; +use log::Level; use mpt_trie::partial_trie::PartialTrie; use plonky2::hash::hash_types::RichField; use serde::{Deserialize, Serialize}; @@ -177,13 +177,6 @@ pub(crate) fn get_jumpdest_analysis_inputs_rpc( } else { &vec![] }; - trace!( - "code: {:?}, code_addr: {:?}, {:?} <============", - &code, - &code_addr, - code_map.contains_key(code_addr), - ); - trace!("code_map: {:?}", &code_map); prove_context_jumpdests(code, ctx_jumpdests) }) .collect(); diff --git a/evm_arithmetization/src/generation/prover_input.rs b/evm_arithmetization/src/generation/prover_input.rs index 3bc25307c..995b22b23 100644 --- a/evm_arithmetization/src/generation/prover_input.rs +++ b/evm_arithmetization/src/generation/prover_input.rs @@ -7,7 +7,6 @@ use anyhow::{bail, Error, Result}; use ethereum_types::{BigEndianHash, H256, U256, U512}; use itertools::Itertools; use keccak_hash::keccak; -use log::{info, trace}; use num_bigint::BigUint; use plonky2::hash::hash_types::RichField; use serde::{Deserialize, Serialize}; @@ -792,10 +791,6 @@ impl GenerationState { /// Simulate the user's code and store all the jump addresses with their /// respective contexts. fn generate_jumpdest_table(&mut self) -> Result<(), ProgramError> { - // Simulate the user's code and (unnecessarily) part of the kernel code, - // skipping the validate table call - - info!("Generating JUMPDEST tables"); let rpcw = self.inputs.jumpdest_table.clone(); let rpcp: Option = rpcw .as_ref() @@ -804,15 +799,11 @@ impl GenerationState { self.jumpdest_table = rpcp; return Ok(()); } - - info!("Generating JUMPDEST tables: Running SIM"); - + // Simulate the user's code and (unnecessarily) part of the kernel code, + // skipping the validate table call let (simp, _simw) = simulate_cpu_and_get_user_jumps("terminate_common", self) .ok_or(ProgramError::ProverInputError(InvalidJumpdestSimulation))?; self.jumpdest_table = Some(simp); - - info!("Generating JUMPDEST tables: finished"); - Ok(()) } @@ -828,7 +819,6 @@ impl GenerationState { |(ctx, jumpdest_table)| { let code = self.get_code(ctx).unwrap(); let code_hash = keccak(code.clone()); - trace!("ctx: {ctx}, code_hash: {:?} code: {:?}", code_hash, code); for offset in jumpdest_table.clone() { jdtw.insert(code_hash, ctx, offset); } diff --git a/trace_decoder/src/core.rs b/trace_decoder/src/core.rs index d7b5e19c0..97969bf52 100644 --- a/trace_decoder/src/core.rs +++ b/trace_decoder/src/core.rs @@ -21,7 +21,6 @@ use evm_arithmetization::{ }; use itertools::Itertools as _; use keccak_hash::H256; -use log::debug; use mpt_trie::partial_trie::PartialTrie as _; use nunny::NonEmpty; use zk_evm_common::gwei_to_wei; @@ -859,9 +858,6 @@ impl Hash2Code { } pub fn get(&mut self, hash: H256) -> Option> { let res = self.inner.get(&hash).cloned(); - if res.is_none() { - debug!("no code for hash {:#x}", hash); - } res } pub fn insert(&mut self, code: Vec) { diff --git a/zero/src/rpc/jumpdest.rs b/zero/src/rpc/jumpdest.rs index 7f323551a..4f41b79d7 100644 --- a/zero/src/rpc/jumpdest.rs +++ b/zero/src/rpc/jumpdest.rs @@ -24,7 +24,7 @@ use tokio::time::timeout; use trace_decoder::is_precompile; use trace_decoder::ContractCodeUsage; use trace_decoder::TxnTrace; -use tracing::{trace, warn}; +use tracing::warn; use crate::rpc::H256; @@ -70,7 +70,6 @@ where match timeout(*fetch_timeout, block_stackonly_structlog_traces_fut).await { Ok(traces) => traces?, Err(elapsed) => { - trace!(target: "fetching block structlogs timed out", ?elapsed); bail!(elapsed); } }; @@ -97,8 +96,6 @@ pub(crate) fn generate_jumpdest_table<'a>( structlog: &[StructLog], tx_traces: impl Iterator, ) -> anyhow::Result { - trace!("Generating JUMPDEST table for tx: {}", tx.hash); - let mut jumpdest_table = JumpDestTableWitness::default(); // This map does neither contain the `init` field of Contract Deployment @@ -112,17 +109,6 @@ pub(crate) fn generate_jumpdest_table<'a>( }) .collect(); - // REVIEW: will be removed before merge - trace!( - "Transaction: {} is a {}.", - tx.hash, - if tx.to.is_some() { - "message call" - } else { - "contract creation" - } - ); - let entrypoint_code_hash: H256 = match tx.to { Some(to_address) if is_precompile(to_address.compat()) => return Ok(jumpdest_table), Some(to_address) if callee_addr_to_code_hash.contains_key(&to_address).not() => { @@ -147,7 +133,7 @@ pub(crate) fn generate_jumpdest_table<'a>( next_ctx_available += 1; let mut stuctlog_iter = structlog.iter().enumerate().peekable(); - while let Some((step, entry)) = stuctlog_iter.next() { + while let Some((_step, entry)) = stuctlog_iter.next() { let op = entry.op.as_str(); let curr_depth: usize = entry.depth.try_into().unwrap(); @@ -163,22 +149,6 @@ pub(crate) fn generate_jumpdest_table<'a>( ); let (code_hash, ctx) = call_stack.last().unwrap(); - // REVIEW: will be removed before merge - trace!( - step, - curr_depth, - tx_hash = ?tx.hash, - ?code_hash, - ctx, - next_ctx_available, - pc = entry.pc, - pc_hex = format!("{:08x?}", entry.pc), - gas = entry.gas, - gas_cost = entry.gas_cost, - op, - ?entry, - ); - match op { "CALL" | "CALLCODE" | "DELEGATECALL" | "STATICCALL" => { prev_jump = None; @@ -191,7 +161,6 @@ pub(crate) fn generate_jumpdest_table<'a>( let operands_used = 2; if evm_stack.len() < operands_used { - trace!( "Opcode {op} expected {operands_used} operands at the EVM stack, but only {} were found.", evm_stack.len()); // Note for future debugging: There may exist edge cases, where the call // context has been incremented before the call op fails. This should be // accounted for before this and the following `continue`. The details are @@ -209,21 +178,6 @@ pub(crate) fn generate_jumpdest_table<'a>( call_stack.push((next_code_hash, next_ctx_available)); }; - if is_precompile(callee_address.compat()) { - trace!("Called precompile at address {}.", &callee_address); - }; - - if callee_addr_to_code_hash.contains_key(&callee_address).not() - && is_precompile(callee_address.compat()).not() - { - // This case happens if calling an EOA. This is described - // under opcode `STOP`: https://www.evm.codes/#00?fork=cancun - trace!( - "Callee address {} has no associated `code_hash`.", - &callee_address - ); - } - if let Some((_next_step, next_entry)) = stuctlog_iter.peek() { let next_depth: usize = next_entry.depth.try_into().unwrap(); if next_depth < curr_depth { @@ -252,7 +206,6 @@ pub(crate) fn generate_jumpdest_table<'a>( let evm_stack: Vec<_> = entry.stack.as_ref().unwrap().iter().rev().collect(); let operands = 1; if evm_stack.len() < operands { - trace!( "Opcode {op} expected {operands} operands at the EVM stack, but only {} were found.", evm_stack.len() ); continue; } let [jump_target, ..] = evm_stack[..] else { @@ -268,7 +221,6 @@ pub(crate) fn generate_jumpdest_table<'a>( let evm_stack: Vec<_> = entry.stack.as_ref().unwrap().iter().rev().collect(); let operands = 2; if evm_stack.len() < operands { - trace!( "Opcode {op} expected {operands} operands at the EVM stack, but only {} were found.", evm_stack.len()); continue; }; @@ -290,20 +242,11 @@ pub(crate) fn generate_jumpdest_table<'a>( prev_jump = None; if jumped_here.not() { - trace!( - "{op}: JUMPDESTs at offset {} was reached through fall-through.", - entry.pc - ); continue; } let jumpdest_offset = TryInto::::try_into(entry.pc); if jumpdest_offset.is_err() { - trace!( - "{op}: Could not cast offset {} to usize {}.", - entry.pc, - usize::MAX - ); continue; } ensure!(jumpdest_offset.unwrap() < 24576);