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

EIP170 Contract Size Limit #1466

Open
fubuloubu opened this issue Nov 14, 2018 · 6 comments
Open

EIP170 Contract Size Limit #1466

fubuloubu opened this issue Nov 14, 2018 · 6 comments

Comments

@fubuloubu
Copy link
Contributor

What is wrong?

Double checking this is the intended functionality.

EIP170 states that the contract size limit was changed to 2**14 + 2**13 which is 24,576 bytes. The following line implementations the constant for EIP170, but it is off by one.

EIP170_CODE_SIZE_LIMIT = 24577

How can it be fixed

Validate that the number is correctly applied. If it is, consider making the number match and modifying the condition that tests for it so that it works with the actual number described in EIP170.

@carver
Copy link
Contributor

carver commented Nov 14, 2018

Validate that the number is correctly applied.

Yup a quick search shows that it is functioning correctly.

if contract_code and len(contract_code) >= EIP170_CODE_SIZE_LIMIT:


consider making the number match and modifying the condition that tests for it

The change seems fine to me, I agree that it's at least a slight improvement.

@pipermerriam
Copy link
Member

Might be good for us to write a non-JSON-fixture based test to test for this specific thing. We rely on the JSON-fixture tests for compliance with these things, but it'd be good to have a legible test as well (similar to what @cburgdorf has done for many of our opcodes).

@glaksmono
Copy link
Contributor

glaksmono commented Nov 18, 2018

Would like to take a stab on this

@pipermerriam
Copy link
Member

@glaksmono 👍

@dherykw
Copy link
Contributor

dherykw commented Aug 2, 2019

@pipermerriam , is the issue solved with the #1799 pull request?

@e3243eric
Copy link
Contributor

e3243eric commented Oct 2, 2022

I dug into this issue. I have some thoughts about this. Please let me know if there are any mistakes.

  • opcodes for deploy contract are the "init code". It copies/stores the contract code in memory and should return the memory address at the end.

  • The condition of this line should be '>' when the EIP170_CODE_SIZE_LIMIT is 24576.

    if len(contract_code) >= EIP170_CODE_SIZE_LIMIT:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants