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

new(tests): EIP-1014: Convert CREATE2 test from ethereum/tests #497

Merged
merged 7 commits into from
Jul 23, 2024

Conversation

winsvega
Copy link
Contributor

@winsvega winsvega commented Apr 8, 2024

🗒️ Description

Port

  • src/GeneralStateTestsFiller/stCreate2/call_outsize_then_create2_successful_then_returndatasizeFiller.json
  • src/GeneralStateTestsFiller/stCreate2/call_then_create2_successful_then_returndatasizeFiller.json

🔗 Related Issues

none

✅ Checklist

NOT READY FOR MERGE (NEED coverage)

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@winsvega winsvega added scope:tests Scope: Changes EL client test cases in `./tests` type:test Type: Add/refactor fw unit tests; no fw or el client test case changes labels Apr 9, 2024
@winsvega winsvega requested a review from danceratopz April 9, 2024 08:22
@winsvega
Copy link
Contributor Author

winsvega commented Apr 9, 2024

@marioevz do you want the test coverage to be mandatory checkpoint as well? or perhaps we can setup a cli job to do it using evmone script that I was developing. hm..

@marioevz
Copy link
Member

marioevz commented Apr 9, 2024

@marioevz do you want the test coverage to be mandatory checkpoint as well? or perhaps we can setup a cli job to do it using evmone script that I was developing. hm..

I think we could start with a CLI entry point to check coverage, if you have an idea of implementation we could open another PR and follow it up there.

After that PR is merged we can do a follow up PR to try to embed it into the CI to automatically check it.

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Looks great overall! Just some suggestions.

converted-ethereum-tests.txt Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
tests/constantinople/create2/test_create_returndata.py Outdated Show resolved Hide resolved
@winsvega winsvega requested a review from marioevz April 11, 2024 09:59
@winsvega winsvega force-pushed the dailytest branch 11 times, most recently from 569916e to d3b25c0 Compare April 11, 2024 13:40
@winsvega winsvega force-pushed the dailytest branch 11 times, most recently from 46c5fba to e9c5bcf Compare April 12, 2024 10:49
@winsvega winsvega force-pushed the dailytest branch 5 times, most recently from 4909a21 to e1427fc Compare April 12, 2024 12:30
@winsvega winsvega force-pushed the dailytest branch 3 times, most recently from f6b8cc4 to 1d68cb8 Compare July 8, 2024 20:28
@winsvega winsvega requested a review from marioevz July 9, 2024 08:18
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Some comments, thanks!

+ Op.SSTORE(slot_return_data_hash_before_create, Op.SHA3(0, call_return_size))
+ make_create()
+ Op.SSTORE(slot_returndatasize_after_create, Op.RETURNDATASIZE())
+ Op.SSTORE(slot_return_data_hash_after_create, Op.SHA3(0, Op.RETURNDATASIZE()))
Copy link
Member

Choose a reason for hiding this comment

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

Missing an Op.RETURNDATACOPY at some point before this.
Also, we should hard-code the size instead of trusting RETURNDATASIZE is correct, because there could be an implementation bug where RETURNDATASIZE works but RETURNDATACOPY is buggy, so doing Op.RETURNDATACOPY(0, 0, 35) for example, could uncover such a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if I call returndatacopy with the size that is > returndatasize it makes evm failure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added more parametrization

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@marioevz marioevz changed the title convert create2 test new(tests): EIP-1014: Convert CREATE2 test from ethereum/tests Jul 23, 2024
@marioevz marioevz merged commit 44b4a07 into main Jul 23, 2024
7 of 9 checks passed
@marioevz marioevz deleted the dailytest branch July 23, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:tests Scope: Changes EL client test cases in `./tests` type:test Type: Add/refactor fw unit tests; no fw or el client test case changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants