-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
EIP-210: Fixes for blockhash contracts #1094
Conversation
This fixes the issue in the contract when executed from SYSTEM account at block 1. Then the number of the previous block is 0 and the contract executes the loop forever.
Fix fixes the issue in the blockhash contract where the negative value of the argument is not properly handled.
Hi! I'm a bot, and I wanted to automerge your PR, but couldn't because of the following issue(s):
|
That blocknum 1 issue is actually very important, because otherwise it'll produce very weird results in most test scenarios |
We still don't have any tests for the contract code itself, do we? |
We do, but for old version of the contract: #641. When migrating to new code I discovered this block 1 bug. |
Because these 2 bugs are quite obvious, I'd like to fix them first before progressing with tests. |
Fix blockhash contract for block number 1
This fixes the issue in the contract when executed from SYSTEM account at block 1. Then the number of the previous block is 0 and the contract executes the loop forever.
Correctly handle argument with negative value
Fix fixes the issue in the blockhash contract where the negative value of the argument is not properly handled.