Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Use opcode from context and OOG in Arithmetic Operations #782

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

ClementWalter
Copy link
Member

Time spent on this PR: 0.3

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?

All the Arithmetic opcodes use the same internal exec_arithmetic_operation function with an extra opcode
parameter.

What is the new behavior?

The opcode number is taken directly from the ctx and StopAndArithmeticOperations.exec_arithmetic_operation
is consequently directly used in evm.cairo.

OOG during these opcodes is now raised.

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (cf835ce) 70.83% compared to head (94db972) 70.61%.
Report is 2 commits behind head on main.

❗ Current head 94db972 differs from pull request most recent head c5054c1. Consider uploading reports for the commit c5054c1 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #782      +/-   ##
==========================================
- Coverage   70.83%   70.61%   -0.23%     
==========================================
  Files          45       45              
  Lines        6649     6551      -98     
==========================================
- Hits         4710     4626      -84     
+ Misses       1939     1925      -14     
Files Coverage Δ
src/kakarot/evm.cairo 100.00% <ø> (ø)
.../instructions/stop_and_arithmetic_operations.cairo 79.61% <89.28%> (+3.34%) ⬆️
src/kakarot/errors.cairo 2.68% <0.00%> (-0.22%) ⬇️

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

Copy link
Member

@Eikix Eikix left a comment

Choose a reason for hiding this comment

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

a couple of questions but lgtm
also should we add a todo to fix sign extend

@Eikix
Copy link
Member

Eikix commented Nov 1, 2023

how come ef-tests are failing?

@ClementWalter ClementWalter force-pushed the cw/refacto-arithmetic-ops branch from 94db972 to c5054c1 Compare November 2, 2023 10:27
Copy link
Member

@Eikix Eikix left a comment

Choose a reason for hiding this comment

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

lgtm

@Eikix Eikix merged commit e5d4cc3 into kkrt-labs:main Nov 2, 2023
5 checks passed
@ClementWalter ClementWalter deleted the cw/refacto-arithmetic-ops branch November 2, 2023 12:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants