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

evmzero: Add check for range in blockHash op #461

Merged
merged 2 commits into from
May 27, 2024

Conversation

facuMH
Copy link
Contributor

@facuMH facuMH commented May 14, 2024

This PR fixes the BLOCKHASH operation by adding a check that the number of the block to be hashed is within 256 of the current block.
This PR adds a test for the case when the block to be hashed is outside of this range, in this case the returned hash is 0 and a regression test case for the CT.

@facuMH facuMH self-assigned this May 14, 2024
@facuMH facuMH force-pushed the facundo/evmzero-blockhash-range branch from b2f4b5e to 193c401 Compare May 14, 2024 10:31
@facuMH facuMH force-pushed the facundo/evmzero-blockhash-range branch from 193c401 to b8c5272 Compare May 14, 2024 10:34
@facuMH facuMH marked this pull request as ready for review May 14, 2024 10:37
cpp/vm/evmzero/interpreter.cc Show resolved Hide resolved
cpp/vm/evmzero/interpreter_test.cc Show resolved Hide resolved
@HerbertJordan HerbertJordan added this to the Complete Tosca CT milestone May 17, 2024
@facuMH facuMH requested review from HerbertJordan and LuisPH3 May 21, 2024 07:54
HerbertJordan
HerbertJordan previously approved these changes May 21, 2024
Copy link
Collaborator

@HerbertJordan HerbertJordan left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this.

cpp/vm/evmzero/interpreter.cc Outdated Show resolved Hide resolved
cpp/vm/evmzero/interpreter_test.cc Outdated Show resolved Hide resolved
cpp/vm/evmzero/interpreter_test.cc Outdated Show resolved Hide resolved
cpp/vm/evmzero/interpreter.cc Show resolved Hide resolved
cpp/vm/evmzero/interpreter_test.cc Outdated Show resolved Hide resolved
LuisPH3
LuisPH3 previously approved these changes May 21, 2024
@facuMH facuMH dismissed stale reviews from LuisPH3 and HerbertJordan via c0e6d70 May 22, 2024 12:04
@facuMH facuMH force-pushed the facundo/evmzero-blockhash-range branch from d42b8e2 to c0e6d70 Compare May 22, 2024 12:04
Copy link
Collaborator

@HerbertJordan HerbertJordan left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

@facuMH facuMH merged commit 7051d20 into main May 27, 2024
5 checks passed
@facuMH facuMH deleted the facundo/evmzero-blockhash-range branch May 27, 2024 12:01
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.

4 participants