-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
CREATE2 gas cost update #1204
CREATE2 gas cost update #1204
Conversation
DataWord size = stack.get(stack.size() - 2); | ||
long chunkUsed = (size.longValueSafe() + 31) / 32; | ||
long size = stack.get(stack.size() - 2).longValueSafe(); | ||
if (size == Long.MAX_VALUE) { |
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.
What is this check for?
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 check is similar to check in mem gas calculation code. And looks like it's already done in a call to calcMemGas
prior to this check. I'll remove it in favor of code readability.
@@ -396,6 +400,12 @@ else if (!currentValue.isZero() && newValue.isZero()) { | |||
case CREATE2: | |||
gasCost = gasCosts.getCREATE() + calcMemGas(gasCosts, oldMemSize, | |||
memNeeded(stack.get(stack.size() - 2), stack.get(stack.size() - 3)), 0); | |||
long codeSize = stack.get(stack.size() - 3).longValueSafe(); | |||
if (codeSize == Long.MAX_VALUE) { |
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.
What is this check for?
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.
I like words count instead of magic. Great!
Includes:
SHA3
gas cost additionReference implementation: