-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: