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

bug: checks memory expansion costs utils #1322

Conversation

obatirou
Copy link
Collaborator

@obatirou obatirou commented Aug 2, 2024

Time spent on this PR:

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Resolves #1266

  • memory_expansion_cost_saturated: offset.high + size.high != 0 can be broken when selecting (P - 1)/2 and (P + 1)/2
  • calculate_gas_extend_memory: max_offset is a felt possibly > 2**128 so one needs to use is_le_felt

What is the new behavior?

  • Condition is updated for memory_expansion_cost_saturated
  • Usage of is_le_felt in calculate_gas_extend_memory

This change is Reviewable

@obatirou obatirou force-pushed the oba/overflow-checks-memory-expansion-costs-utils branch from 32c8592 to ea9fd68 Compare August 2, 2024 12:42
@obatirou obatirou force-pushed the oba/overflow-checks-memory-expansion-costs-utils branch from ea9fd68 to 621708e Compare August 2, 2024 12:54
@obatirou obatirou marked this pull request as ready for review August 2, 2024 12:56
@obatirou obatirou merged commit a4deff5 into kkrt-labs:main Aug 5, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: no overflow checks in memory expansion costs utils
2 participants