From fc55f6e52b78c76dd06c9862869ccb092cc6cbaa Mon Sep 17 00:00:00 2001 From: Vladislav Volosnikov Date: Fri, 6 Dec 2024 12:39:15 +0100 Subject: [PATCH] fix(EVM): Increase max allowed memory (2) (#1124) --- system-contracts/contracts/EvmEmulator.yul | 8 ++++---- .../evm-emulator/EvmEmulatorFunctions.template.yul | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/system-contracts/contracts/EvmEmulator.yul b/system-contracts/contracts/EvmEmulator.yul index 4da1e794f..625231950 100644 --- a/system-contracts/contracts/EvmEmulator.yul +++ b/system-contracts/contracts/EvmEmulator.yul @@ -166,9 +166,9 @@ object "EvmEmulator" { } // Used to simplify gas calculations for memory expansion. - // The cost to increase the memory to 4 MB is close to 30M gas + // The cost to increase the memory to 12 MB is close to 277M EVM gas function MAX_POSSIBLE_MEM_LEN() -> max { - max := 0x400000 // 4MB + max := 0xC00000 // 12MB } function MAX_UINT() -> max_uint { @@ -3278,9 +3278,9 @@ object "EvmEmulator" { } // Used to simplify gas calculations for memory expansion. - // The cost to increase the memory to 4 MB is close to 30M gas + // The cost to increase the memory to 12 MB is close to 277M EVM gas function MAX_POSSIBLE_MEM_LEN() -> max { - max := 0x400000 // 4MB + max := 0xC00000 // 12MB } function MAX_UINT() -> max_uint { diff --git a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul index 011f7b13a..04ce45ea8 100644 --- a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul +++ b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul @@ -104,9 +104,9 @@ function MEM_OFFSET() -> offset { } // Used to simplify gas calculations for memory expansion. -// The cost to increase the memory to 4 MB is close to 30M gas +// The cost to increase the memory to 12 MB is close to 277M EVM gas function MAX_POSSIBLE_MEM_LEN() -> max { - max := 0x400000 // 4MB + max := 0xC00000 // 12MB } function MAX_UINT() -> max_uint {