Skip to content

Commit

Permalink
Fix code execution logic in EVM::call
Browse files Browse the repository at this point in the history
  • Loading branch information
elmato committed Feb 28, 2024
1 parent 97f76a7 commit 50b724d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion silkworm/core/execution/evm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,13 @@ evmc::Result EVM::call(const evmc_message& message) noexcept {
tracer.get().on_execution_end(res.raw(),state_);
}
} else {

if(eos_evm_version_ > 0 && message.depth == 0 && state_.is_dead(message.recipient)) {
if ((res.gas_left -= static_cast<int64_t>(gas_params_.G_txnewaccount)) < 0)
res.status_code = EVMC_OUT_OF_GAS;
} else {
}

if(res.status_code == EVMC_SUCCESS) {
const ByteView code{state_.get_code(message.code_address)};
if (code.empty() && tracers_.empty()) { // Do not skip execution if there are any tracers
return res;
Expand Down

0 comments on commit 50b724d

Please sign in to comment.