-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
core/vm: use dedicated SLOAD gas constant for EIP-2200 #20646
Conversation
Not sure why there are a few tests failing on the AMD tests, any insights would be great! |
@GregTheGreek If we're going to merge this, I really prefer the diff @meowsbits submitted to ETC. It's cleaner and more elegantly separates things. Wanna change the PR to that? |
@karalabe makes a lot of sense to me, I've updated it |
params/protocol_params.go
Outdated
@@ -90,6 +90,7 @@ const ( | |||
SloadGasFrontier uint64 = 50 | |||
SloadGasEIP150 uint64 = 200 | |||
SloadGasEIP1884 uint64 = 800 // Cost of SLOAD after EIP 1884 (part of Istanbul) | |||
SloadGasEIP2200 uint64 = 800 // Cost of SLOAD after EIP 2200 (part of Istanbul) |
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.
Pls fix formatting, otherwise linter will whine :D
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.
Ping @GregTheGreek
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.
Sorry on it! Spent the weekend without a computer... Crazy I know.
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.
done :)
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.
LGTM
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.
LGTM
Thanks, everyone! |
I was doing some bench marking and analysis surrounding some of the recent EIPs. While tinkering with EIP-1884 I accidentally created a split on a private network between Parity, Besu and Geth, where Parity and Geth forked together with SLOAD_GAS of 200 rather than 800. After investigating, I discovered that EIP-2200 was "technically" incorrectly implemented.
EIP-1884 and EIP-2200 both adjust
SLOAD_GAS
from200
to800
- but the current implementation of EIP-2200 assumes that EIP-1884 is already implemented, and only adjustsSSTORE
.This PR adds the EIP-1884
SLOAD_GAS
changes to EIP-2200.There is a Sibling PR in Parity