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

feat(levm): cache refactor #1314

Merged
merged 57 commits into from
Nov 28, 2024
Merged

feat(levm): cache refactor #1314

merged 57 commits into from
Nov 28, 2024

Conversation

ilitteri
Copy link
Contributor

@ilitteri ilitteri commented Nov 27, 2024

Motivation

Description

  • A set touched_accounts is introduced to track read accounts.
  • Cache is no longer used as a tracker of read accounts. It is now only used to track updated accounts. All the account update logic is encapsulated in individual functions.
  • Cache struct is removed and a cache module is introduced with the cache's behavior.
  • Gas cost functions where the access cost takes place were refactored.

Leftovers

EF Test Report

8 more tests pass without any further changes

✓ Ethereum Foundation Tests: 714 passed 3387 failed 4101 total run - 12:08
✓ Summary: 714/4101

Cancun: 627/3578
Shanghai: 33/221
Homestead: 0/17
Istanbul: 0/34
London: 17/39
Byzantium: 0/33
Berlin: 17/35
Constantinople: 0/66
Merge: 20/62
Frontier: 0/16

@ilitteri ilitteri self-assigned this Nov 27, 2024
@ilitteri ilitteri requested a review from a team as a code owner November 27, 2024 16:48
Copy link
Contributor

@maximopalopoli maximopalopoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I just leave you some comments

crates/vm/levm/src/vm.rs Outdated Show resolved Hide resolved
Ok(static_gas
.checked_add(dynamic_gas)
.ok_or(OutOfGasError::GasCostOverflow)?)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the call type opcodes can be abstracted to a call_type_cost, or similar

crates/vm/levm/src/vm.rs Outdated Show resolved Hide resolved
crates/vm/levm/src/vm.rs Outdated Show resolved Hide resolved
@ilitteri ilitteri enabled auto-merge November 28, 2024 13:49
crates/vm/levm/src/vm.rs Outdated Show resolved Hide resolved
@ilitteri ilitteri added this pull request to the merge queue Nov 28, 2024
Merged via the queue into main with commit f496c7c Nov 28, 2024
15 checks passed
@ilitteri ilitteri deleted the refactor_levm_new_state branch November 28, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
levm Lambda EVM implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants