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

chore: use keccak256 for blockhash #854

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

minaminao
Copy link
Contributor

@minaminao minaminao commented Nov 8, 2023

As the discussion in foundry-rs/foundry#6235 , currently, blockhash(number) returns number, but I think we should use keccak256 for blockhash.

The main reason is:

blockhash, even though it's a 256-bit value, can be represented by a much smaller number of bits from a security point of view.
For example, if a contract has a bug that the upper bits of the blockhash value are missing in inline-assembly or something, the bug would not be detected in tests.

This PR used it as we have done so before #691 .

@DaniPopes This is a minor change and mds1 agreed that so I've sent this PR to facilitate it before I get your reply. :)

@rakita
Copy link
Member

rakita commented Nov 9, 2023

@DaniPopes waiting for your approval before merging

@rakita rakita merged commit e17c529 into bluealloy:main Nov 9, 2023
@minaminao minaminao deleted the use-keccak-for-blockhash branch November 9, 2023 18:03
mattsse pushed a commit to mattsse/revm that referenced this pull request Nov 10, 2023
@github-actions github-actions bot mentioned this pull request Jan 12, 2024
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.

3 participants