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

[KGA-87] fix: high offset memory expansion computations #1604

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

enitrat
Copy link
Collaborator

@enitrat enitrat commented Nov 12, 2024

Fixes computation on high memory offsets.
The remediation proposed by the audit finding was not sufficient enough. This one looks fine, although a bit more costly (even though uint256_add is not that computationally intensive)

https://github.com/code-423n4/2024-09-kakarot-findings/issues/4


This change is Reviewable

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.

Project coverage is 63.6%. Comparing base (474951c) to head (d6eb900).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
cairo_zero/kakarot/gas.cairo 77.2% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1604     +/-   ##
=======================================
- Coverage   63.6%   63.6%   -0.1%     
=======================================
  Files         44      44             
  Lines       8332    8343     +11     
=======================================
+ Hits        5301    5307      +6     
- Misses      3031    3036      +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ClementWalter ClementWalter left a comment

Choose a reason for hiding this comment

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

use from starkware.cairo.lang.cairo_constants import DEFAULT_PRIME

@ClementWalter ClementWalter merged commit 289c2e8 into main Nov 12, 2024
16 checks passed
@ClementWalter ClementWalter deleted the fix/max-memory-offset branch November 12, 2024 10:16
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.

2 participants