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

tests/cancun/eip6780: add test cases which use revert #270

Merged
merged 17 commits into from Sep 7, 2023

Conversation

jwasinger
Copy link
Contributor

@jwasinger jwasinger commented Aug 24, 2023

This adds two test cases based on a go-ethereum implementation mistake that was caught in PR review:

given contract A which has methods to receive balance (a no-op) and selfdestruct, and was created in current tx.
Test the following call sequence in the same transaction:

Transfer value to A and call A.selfdestruct. Recurse into a new call which transfers value to A, calls A.selfdestruct, and reverts.

I have add two variants of this scenario: one test where A is pre-existing and another where it is created in the same transaction that the test occurs in.

@jwasinger jwasinger marked this pull request as ready for review August 29, 2023 07:29
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 very good, just some comments that would be nice to have.

Co-authored-by: Mario Vega <marioevz@gmail.com>
@jwasinger
Copy link
Contributor Author

@marioevz I have addressed your points above and I think this is ready for further review when you get the time.

@marioevz
Copy link
Member

marioevz commented Sep 6, 2023

@marioevz I have addressed your points above and I think this is ready for further review when you get the time.

Thanks! I'll try to get it done today :)

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 for implementing these

@marioevz marioevz changed the title add eip6780 test cases which use revert tests/cancun/eip6780: add test cases which use revert Sep 7, 2023
@marioevz marioevz merged commit e8486c3 into ethereum:main Sep 7, 2023
4 checks passed
@jwasinger jwasinger deleted the eip6780-revert-tests branch September 7, 2023 04:07
spencer-tb pushed a commit to spencer-tb/execution-spec-tests that referenced this pull request Sep 18, 2023
* introduce eip6780 tests which make use of revert

* fixed another test

* better comments for tests

* format comments

* try to appease the linter

* try again

* wip

* make outer selfdestruct optional via parametrization

* Update tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py

Co-authored-by: Mario Vega <marioevz@gmail.com>

* check that selfdestructable address was created

* wip

* fix lint

* fix lint

* try fix lint again

* try fix lint

* fix typo

* Add another variant of outer selfdestruct

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
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.

None yet

2 participants