diff --git a/bus-mapping/src/evm/opcodes/extcodesize.rs b/bus-mapping/src/evm/opcodes/extcodesize.rs index aef99e9946..afaddefef0 100644 --- a/bus-mapping/src/evm/opcodes/extcodesize.rs +++ b/bus-mapping/src/evm/opcodes/extcodesize.rs @@ -57,7 +57,15 @@ impl Opcode for Extcodesize { let (code_hash, code_size) = if exists { ( account.code_hash, - state.code(account.code_hash)?.len().into(), + if cfg!(feature = "scroll") { + debug_assert_eq!( + account.code_size, + state.code(account.code_hash)?.len().into() + ); + account.code_size + } else { + state.code(account.code_hash)?.len().into() + }, ) } else { (H256::zero(), Word::zero()) diff --git a/eth-types/src/state_db/l2.rs b/eth-types/src/state_db/l2.rs index 7736188748..e0bab37629 100644 --- a/eth-types/src/state_db/l2.rs +++ b/eth-types/src/state_db/l2.rs @@ -116,7 +116,7 @@ impl CodeDB { // bustmapping do this job unreachable!() } - OpcodeId::EXTCODESIZE | OpcodeId::EXTCODECOPY => { + OpcodeId::EXTCODECOPY => { let code = data.get_code_at(0); if code.is_none() { log::warn!("unable to fetch code from step. {step:?}"); diff --git a/zkevm-circuits/src/witness/mpt.rs b/zkevm-circuits/src/witness/mpt.rs index eb4b82df65..34abdddb18 100644 --- a/zkevm-circuits/src/witness/mpt.rs +++ b/zkevm-circuits/src/witness/mpt.rs @@ -286,21 +286,12 @@ impl MptUpdates { MptUpdate::from_rows(key, rows, i, rows_len, old_root, new_root) }) .collect(); - let mpt_updates = MptUpdates { + MptUpdates { old_root, new_root, updates, ..Default::default() - }; - // FIXME: we can remove this assert after the code runs a while and everything is ok? - #[cfg(debug_assertions)] - { - let mut rows = rows.to_vec(); - rows.sort_by_key(Rw::as_key); - let old_updates = Self::from_rws_with_mock_state_roots(&rows, old_root, new_root); - assert_eq!(old_updates.updates, mpt_updates.updates); } - mpt_updates } pub(crate) fn from_rws_with_mock_state_roots(