From 0184065df06ad3eb4a38db1dddb847b8e6aa783a Mon Sep 17 00:00:00 2001 From: Vladislav Volosnikov Date: Mon, 30 Dec 2024 16:57:39 +0100 Subject: [PATCH] Use static call for isSlotWarm --- system-contracts/contracts/EvmEmulator.yul | 6 ++---- .../evm-emulator/EvmEmulatorFunctions.template.yul | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/system-contracts/contracts/EvmEmulator.yul b/system-contracts/contracts/EvmEmulator.yul index ba2ad472f..1b531a3c1 100644 --- a/system-contracts/contracts/EvmEmulator.yul +++ b/system-contracts/contracts/EvmEmulator.yul @@ -617,8 +617,7 @@ object "EvmEmulator" { // non-standard selector 0x01 mstore(0, 0x0100000000000000000000000000000000000000000000000000000000000000) mstore(1, key) - // should be call since we use TSTORE in gas manager - let success := call(gas(), EVM_GAS_MANAGER_CONTRACT(), 0, 0, 33, 0, 0) + let success := staticcall(gas(), EVM_GAS_MANAGER_CONTRACT(), 0, 33, 0, 0) if iszero(success) { // This error should never happen @@ -3746,8 +3745,7 @@ object "EvmEmulator" { // non-standard selector 0x01 mstore(0, 0x0100000000000000000000000000000000000000000000000000000000000000) mstore(1, key) - // should be call since we use TSTORE in gas manager - let success := call(gas(), EVM_GAS_MANAGER_CONTRACT(), 0, 0, 33, 0, 0) + let success := staticcall(gas(), EVM_GAS_MANAGER_CONTRACT(), 0, 33, 0, 0) if iszero(success) { // This error should never happen diff --git a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul index a9253a8cd..f7544f4ce 100644 --- a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul +++ b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul @@ -557,8 +557,7 @@ function isSlotWarm(key) -> isWarm { // non-standard selector 0x01 mstore(0, 0x0100000000000000000000000000000000000000000000000000000000000000) mstore(1, key) - // should be call since we use TSTORE in gas manager - let success := call(gas(), EVM_GAS_MANAGER_CONTRACT(), 0, 0, 33, 0, 0) + let success := staticcall(gas(), EVM_GAS_MANAGER_CONTRACT(), 0, 33, 0, 0) if iszero(success) { // This error should never happen