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

fix(levm): memory size calculations #1445

Merged
merged 6 commits into from
Dec 9, 2024
Merged

Conversation

JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Dec 9, 2024

Motivation

  • Currently we have some errors in gas calculations related to memory when "size" is set to 0. Memory shouldn't ever expand on that scenario.
  • Tidy code for calculating memory size.

Description

  • Create function calculate_memory_size in memory module
  • Use function in every opcode that needs it

Results

  • 7 more tests pass when comparing directly to last main changes.

Closes #1442

@JereSalo JereSalo added the levm Lambda EVM implementation label Dec 9, 2024
@JereSalo JereSalo self-assigned this Dec 9, 2024
@JereSalo JereSalo marked this pull request as ready for review December 9, 2024 20:51
@JereSalo JereSalo requested a review from a team as a code owner December 9, 2024 20:51
@ilitteri ilitteri added this pull request to the merge queue Dec 9, 2024
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

Merged via the queue into main with commit dd680ee Dec 9, 2024
6 checks passed
@ilitteri ilitteri deleted the levm/fix_memory_size_calculations branch December 9, 2024 21:11
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.

[SECURITY] Non-Compliance : Incorrect Gas Calculation for LOG Opcode in LEVM
3 participants