diff --git a/compiler_tester/src/vm/eravm/mod.rs b/compiler_tester/src/vm/eravm/mod.rs index b17eef1..baa4b23 100644 --- a/compiler_tester/src/vm/eravm/mod.rs +++ b/compiler_tester/src/vm/eravm/mod.rs @@ -398,6 +398,7 @@ impl EraVM { calldata: Vec, vm_launch_option: Option, ) -> anyhow::Result { + // legacy EvmGasManager.sol compatibility // set `evmStackFrames` size to 1 self.storage.insert( zkevm_tester::compiler_tests::StorageKey { @@ -425,6 +426,34 @@ impl EraVM { web3::types::H256::from_low_u64_be(Self::EVM_CALL_GAS_LIMIT), ); + // updated EvmGasManager.sol compatibility + // set `evmStackFrames` size to 1 + self.storage_transient.insert( + zkevm_tester::compiler_tests::StorageKey { + address: web3::types::Address::from_low_u64_be(ADDRESS_EVM_GAS_MANAGER.into()), + key: web3::types::U256::from(Self::EVM_GAS_MANAGER_STACK_FRAME_SLOT), + }, + web3::types::H256::from_low_u64_be(1), + ); + + // set `evmStackFrames[0].passGas` to `EVM_CALL_GAS_LIMIT` + self.storage_transient.insert( + zkevm_tester::compiler_tests::StorageKey { + address: web3::types::Address::from_low_u64_be(ADDRESS_EVM_GAS_MANAGER.into()), + key: web3::types::U256::from(Self::EVM_GAS_MANAGER_STACK_FRAME_SLOT).add(2), + }, + web3::types::H256::from_low_u64_be(Self::EVM_CALL_GAS_LIMIT), + ); + + // set `evmStackFrames[0].isStatic` to false + self.storage_transient.insert( + zkevm_tester::compiler_tests::StorageKey { + address: web3::types::Address::from_low_u64_be(ADDRESS_EVM_GAS_MANAGER.into()), + key: web3::types::U256::from(Self::EVM_GAS_MANAGER_STACK_FRAME_SLOT).add(3), + }, + web3::types::H256::zero(), + ); + let mut result = self.execute::( test_name, entry_address,