Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KGA-107] fix: cache access list after gas validation #1624

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cairo_zero/kakarot/interpreter.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
);
Expand Down
Loading