Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Conversation

@mkalinin
Copy link
Contributor

@mkalinin mkalinin commented Oct 4, 2018

Includes:

  • Latest update to EIP-1014 regarding SHA3 gas cost addition
  • a bit of refactor

Reference implementation:

@mkalinin mkalinin added this to the 1.9.0-Constantinople milestone Oct 4, 2018
@mkalinin mkalinin requested review from Nashatyrev and zilm13 October 4, 2018 11:54
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) {
Copy link
Member

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?

Copy link
Contributor Author

@mkalinin mkalinin Oct 4, 2018

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

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?

@coveralls
Copy link

coveralls commented Oct 4, 2018

Coverage Status

Coverage decreased (-0.03%) to 56.605% when pulling fe10be2 on feature/create2-gas-cost-update into c27dc0f on develop.

Copy link
Collaborator

@zilm13 zilm13 left a 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!

@mkalinin mkalinin merged commit b2bdc82 into develop Oct 5, 2018
@mkalinin mkalinin deleted the feature/create2-gas-cost-update branch December 26, 2018 06:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants