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

EIP-3860 Max init code size limit and extra gas charge #4740

Merged
merged 7 commits into from
Nov 1, 2022

Conversation

damian-orzechowski
Copy link
Contributor

@damian-orzechowski damian-orzechowski commented Oct 10, 2022

Resolves #4588

Changes:

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Comments about testing , should you have some (optional)

Further comments (optional)

Implements EIP-3860 which is still draft.

@damian-orzechowski damian-orzechowski marked this pull request as ready for review October 24, 2022 14:52
@@ -57,6 +57,11 @@ private static long DataCost(Transaction transaction, IReleaseSpec releaseSpec)
}
}

if (transaction.IsContractCreation && releaseSpec.IsEip3860Enabled)
{
dataCost += EvmPooledMemory.Div32Ceiling((ulong)transaction.Data.Length) * GasCostOf.InitCodeWord;
Copy link
Member

Choose a reason for hiding this comment

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

why ulong cast and not directly to UInt256?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In all the occurances I found when Div32Ceiling was called for an int parameter, it was cast to ulong.

Copy link
Member

@LukaszRozmej LukaszRozmej Oct 26, 2022

Choose a reason for hiding this comment

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

Please cast directly to UInt256, we can change those old ones to do the same.

obraz

Dunno why was cast to ulong, it was BigInteger before:
obraz

And merge it after.

@MarekM25 MarekM25 merged commit 64c1ca7 into master Nov 1, 2022
@MarekM25 MarekM25 deleted the feature/eip-3860_limit_and_meter_initcode branch November 1, 2022 17:32
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.

EIP-3860: Limit and meter initcode
4 participants