EIP170 Contract Size Limit
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.
https://github.com/ethereum/py-evm/blob/0ff7bc0f820250d7f15e804bc09870776ea34eb5/eth/vm/forks/spurious_dragon/constants.py#L13
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.
Validate that the number is correctly applied.
Yup a quick search shows that it is functioning correctly.
https://github.com/ethereum/py-evm/blob/ae1e3e4fc133f36db2238f61dac05a4e4e344319/eth/vm/forks/spurious_dragon/computation.py#L41
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.
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).
Would like to take a stab on this
@glaksmono :+1:
@pipermerriam , is the issue solved with the #1799 pull request?
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. https://github.com/ethereum/py-evm/blob/12f3bee964dc07bf3425beb3776639ad06f0648c/eth/vm/forks/spurious_dragon/computation.py#L86