-
Notifications
You must be signed in to change notification settings - Fork 331
Implement EIP-2200 #142
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
Implement EIP-2200 #142
Conversation
| storage[v1] = {v1, true}; | ||
| execute(sstore(1, push(2))); | ||
| EXPECT_EQ(result.status_code, EVMC_SUCCESS); | ||
| EXPECT_EQ(gas_used, rev == EVMC_CONSTANTINOPLE ? 206 : 5006); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all these have >= CONSTANTINOPLE?
E.g. (rev >= istanbul) elseif (rev == constantinople) else .. (because it was disabled in petersburg)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, changed now to cover post-Istanbul revisions
... although the loop iterates only till EVMC_ISTANBUL
Codecov Report
@@ Coverage Diff @@
## master #142 +/- ##
==========================================
+ Coverage 99.88% 99.88% +<.01%
==========================================
Files 5 5
Lines 845 858 +13
Branches 109 113 +4
==========================================
+ Hits 844 857 +13
Misses 1 1 |
|
"OOG if gas below stipend" is not implemented yet |
lib/evmone/instructions.cpp
Outdated
| if (state.rev >= EVMC_ISTANBUL) | ||
| { | ||
| const auto correction = state.current_block_cost - instr->arg.p.number; | ||
| const auto gas_left = static_cast<uint64_t>(state.gas_left + correction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to work right: for PUSH1 0 PUSH1 0 SSTORE with 2306 starting gas, at the beginning of SSTORE state.gas_left is 2300 and correction is 6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, arg.p.number should be filled for SSTORE in analysis
5f2da5b to
6bead9b
Compare
0dfe5c9 to
7c65f43
Compare
ethereum/EIPs#2200