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

core/vm: use dedicated SLOAD gas constant for EIP-2200 #20646

Merged
merged 3 commits into from
Feb 18, 2020

Conversation

GregTheGreek
Copy link
Contributor

@GregTheGreek GregTheGreek commented Feb 10, 2020

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 from 200 to 800 - but the current implementation of EIP-2200 assumes that EIP-1884 is already implemented, and only adjusts SSTORE.

This PR adds the EIP-1884 SLOAD_GAS changes to EIP-2200.

There is a Sibling PR in Parity

@GregTheGreek
Copy link
Contributor Author

Not sure why there are a few tests failing on the AMD tests, any insights would be great!

@karalabe
Copy link
Member

karalabe commented Feb 12, 2020

@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?

@GregTheGreek
Copy link
Contributor Author

GregTheGreek commented Feb 12, 2020

@karalabe makes a lot of sense to me, I've updated it

@@ -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)
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done :)

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

@fjl fjl added this to the 1.9.12 milestone Feb 18, 2020
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@fjl fjl changed the title Update EIP-2200 core/vm: update SLOAD gas in EIP-2200 table Feb 18, 2020
@fjl fjl changed the title core/vm: update SLOAD gas in EIP-2200 table core/vm: use dedicated SLOAD gas constant in EIP-2200 table Feb 18, 2020
@fjl fjl changed the title core/vm: use dedicated SLOAD gas constant in EIP-2200 table core/vm: use dedicated SLOAD gas constant for EIP-2200 Feb 18, 2020
@fjl fjl merged commit 4be8840 into ethereum:master Feb 18, 2020
@bobsummerwill
Copy link

Thanks, everyone!

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.

6 participants