py-evm icon indicating copy to clipboard operation
py-evm copied to clipboard

py-evm-issue-1466: Added test cases for EIP170

Open junning-tong opened this issue 4 years ago • 4 comments

What was wrong?

Check issue-1466 for reference

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 was it fixed?

  • Change EIP170_CODE_SIZE_LIMIT from 24577 to 24576
  • Add test cases

Cute Animal Picture

:pig2::pig2::pig2::pig2::pig2::pig2::pig2::pig2:

junning-tong avatar Apr 18 '21 21:04 junning-tong

Before we merge this, I'd like to understand why this wasn't caught using consensus tests because this seems like the type of thing that 1) I would be surprised if it wasn't in the tests and 2) if it isn't in the tests it should be added upstream

pipermerriam avatar Apr 19 '21 14:04 pipermerriam

@pipermerriam the newly added test file is in directory tests/core/vm/. Should I move it to tests/core/consensus/?

junning-tong avatar Apr 19 '21 22:04 junning-tong

No, I'm referring to these tests: https://github.com/ethereum/tests/

They exist as a submodule in the repository.

pipermerriam avatar Apr 21 '21 20:04 pipermerriam

Hi @pipermerriam I see a commit which added test cases in fixtures submodules. https://github.com/ethereum/py-evm/pull/1998/files

Should I move newly added .json to the submodule as well? tests/core/vm/fixtures/spurious_dragon_computation_test_code_size_limitation.json

junning-tong avatar Apr 28 '21 22:04 junning-tong