From 4b1fed8bb79e1f2b564d1f14f016e6afaa5132bb Mon Sep 17 00:00:00 2001 From: Oba Date: Tue, 19 Nov 2024 11:37:52 +0100 Subject: [PATCH] cache access list after gas validation --- cairo_zero/kakarot/interpreter.cairo | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cairo_zero/kakarot/interpreter.cairo b/cairo_zero/kakarot/interpreter.cairo index c9e1da377..a1b2f8b8e 100644 --- a/cairo_zero/kakarot/interpreter.cairo +++ b/cairo_zero/kakarot/interpreter.cairo @@ -907,14 +907,6 @@ namespace Interpreter { let memory = Memory.init(); let state = State.init(); - // Cache the coinbase, precompiles, caller, and target, making them warm - with state { - let coinbase = State.get_account(env.coinbase); - State.cache_precompiles(); - State.get_account(address.evm); - let access_list_cost = State.cache_access_list(access_list_len, access_list); - } - let intrinsic_gas = intrinsic_gas + access_list_cost; let evm = EVM.init(message, gas_limit - intrinsic_gas); @@ -925,6 +917,14 @@ namespace Interpreter { return (evm, stack, memory, state, 0, 0); } + // Cache the coinbase, precompiles, caller, and target, making them warm + with state { + let coinbase = State.get_account(env.coinbase); + State.cache_precompiles(); + State.get_account(address.evm); + let access_list_cost = State.cache_access_list(access_list_len, access_list); + } + tempvar is_initcode_invalid = is_deploy_tx * is_nn( bytecode_len - (2 * Constants.MAX_CODE_SIZE + 1) );