Skip to content

Commit

Permalink
Sload cache item
Browse files Browse the repository at this point in the history
  • Loading branch information
boundless-forest committed Nov 3, 2023
1 parent 6db59d1 commit 0fe2e9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion frame/evm/src/runner/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,12 @@ where
}
}
Opcode::SLOAD => {
weight_info.try_record_proof_size_or_fail(ACCOUNT_STORAGE_PROOF_SIZE)?;
if let Some(AccessedStorage::AccountStorages((address, index))) =
accessed_storage
{
weight_info.try_record_proof_size_or_fail(ACCOUNT_STORAGE_PROOF_SIZE)?;
recorded.account_storages.insert((address, index), true);
}
}
Opcode::SSTORE => {
if let Some(AccessedStorage::AccountStorages((address, index))) =
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ mod proof_size_test {
let reading_main_contract_len =
AccountCodes::<Test>::get(call_contract_address).len() as u64;
let expected_proof_size = reading_main_contract_len
+ ACCOUNT_STORAGE_PROOF_SIZE * 2
+ ACCOUNT_STORAGE_PROOF_SIZE
+ ACCOUNT_CODES_METADATA_PROOF_SIZE
+ IS_EMPTY_CHECK_PROOF_SIZE
+ (ACCOUNT_BASIC_PROOF_SIZE * 2);
Expand Down

0 comments on commit 0fe2e9e

Please sign in to comment.