Skip to content

Commit

Permalink
Clear accounts and their storage warm flag after each tx
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Aug 16, 2023
1 parent 80a1c9e commit b81712e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/state/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ std::variant<TransactionReceipt, std::error_code> transition(State& state, const
// Cannot put it into constructor call because logs are std::moved from host instance.
receipt.logs_bloom_filter = compute_bloom_filter(receipt.logs);

// Set accounts and their storage access status to cold in the end of transition process
for (auto& acc : state.get_accounts())
{
acc.second.access_status = EVMC_ACCESS_COLD;
for (auto& [_, val] : acc.second.storage)
{
val.access_status = EVMC_ACCESS_COLD;
val.original = val.current;
}
}

return receipt;
}

Expand Down

0 comments on commit b81712e

Please sign in to comment.