-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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.
| 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?
zilm13
left a comment
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:
SHA3gas cost additionReference implementation: