From 641090555d24c5f7b01c1e993ed132e3274b2ddc Mon Sep 17 00:00:00 2001 From: Robin Salen <30937548+Nashtare@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:20:04 -0400 Subject: [PATCH] Fix address marking for state reads (#695) --- trace_decoder/src/core.rs | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/trace_decoder/src/core.rs b/trace_decoder/src/core.rs index 5f0eeef61..eb598b6ae 100644 --- a/trace_decoder/src/core.rs +++ b/trace_decoder/src/core.rs @@ -4,10 +4,9 @@ use std::{ mem, }; -use alloy::primitives::address; use alloy_compat::Compat as _; use anyhow::{anyhow, bail, ensure, Context as _}; -use ethereum_types::{Address, H160, U256}; +use ethereum_types::{Address, U256}; use evm_arithmetization::{ generation::{mpt::AccountRlp, TrieInputs}, proof::{BlockMetadata, TrieRoots}, @@ -474,30 +473,7 @@ fn middle( state_mask.insert(TrieKey::from_address(addr)); } else { // Simple state access - - fn is_precompile(addr: H160) -> bool { - let precompiled_addresses = if cfg!(feature = "eth_mainnet") { - address!("0000000000000000000000000000000000000001") - ..address!("000000000000000000000000000000000000000a") - } else { - // Remove KZG Peval for non-Eth mainnet networks - address!("0000000000000000000000000000000000000001") - ..address!("0000000000000000000000000000000000000009") - }; - - precompiled_addresses.contains(&addr.compat()) - || (cfg!(feature = "polygon_pos") - // Include P256Verify for Polygon PoS - && addr.compat() - == address!("0000000000000000000000000000000000000100")) - } - - if receipt.status || !is_precompile(addr) { - // TODO(0xaatif): https://github.com/0xPolygonZero/zk_evm/pull/613 - // masking like this SHOULD be a space-saving optimization, - // BUT if it's omitted, we actually get state root mismatches - state_mask.insert(TrieKey::from_address(addr)); - } + state_mask.insert(TrieKey::from_address(addr)); } if self_destructed {