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 Shl's eval arithmetic when result is larger than 2^256 #127

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

acuarica
Copy link
Owner

@acuarica acuarica commented Jun 26, 2024

This PR fixes the eval implementation of Shl which does not honor the Ethereum spec[1]. When the result of the Shl is larger than the word size, the error Val is a not a valid unsigned 256-word is raised. The Shl eval should use mod 2^256 when result is larger than the word size.

image

Related to #125.


[1] https://ethereum.github.io/yellowpaper/paper.pdf

@acuarica acuarica added the bug Something isn't working label Jun 26, 2024
Copy link

size-limit report 📦

Path Size
dist/sevm.js 17.27 KB (0%)

@acuarica acuarica changed the title Fix Shl's eval arithmetic Fix Shl's eval arithmetic when result is larger than 2^256 Jun 26, 2024
@acuarica acuarica merged commit 61303c9 into main Jun 26, 2024
13 checks passed
@acuarica acuarica deleted the fix-shl-arith-eval branch June 26, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant