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

Test EIP-7069 Address Space Extension implications #522

Merged
merged 18 commits into from
Jun 6, 2024

Conversation

shemnon
Copy link
Collaborator

@shemnon shemnon commented Apr 23, 2024

🗒️ Description

Validate ASE behaviors on legacy and EOF opcodes for ASE, when targeting
EOAs, Contracts, and empty accounts. Opcodes are EXTCALL/CALL,
EXTDELEGATECALL/DELEGATECALL, EXTSTATICCALL/STATICCALL, and CALLCODE.

🔗 Related Issues

✅ Checklist

  • 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.

Validate ASE behaviors on legacy and EOF opcodes for ASE, when targeting
EOAs, Contracts, and empty accounts.  Opcodes are BALANCE, EXTCALL/CALL,
EXTDELEGATECALL/DELEGATECALL,  EXTSTATICCALL/STATICCALL, and CALLCODE.

Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
@shemnon shemnon marked this pull request as ready for review May 9, 2024 19:32
EIP-7676 moved the critical EXTCALL sections into the main spec.
EOF does not depend on a new BALANCE op, so don't test it.

Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
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.

Just a comment about the pattern used to write these tests.

Signed-off-by: Danno Ferrin <danno@numisight.com>
@shemnon shemnon changed the title Validate EIP-7676 Prepare for Address Space Extension Test EIP-7069 Address Space Extension implications May 23, 2024
Signed-off-by: Danno Ferrin <danno@numisight.com>
@shemnon
Copy link
Collaborator Author

shemnon commented May 23, 2024

Since 7979 is out of scope for EOFv1 I migrated this into a 7069 test that only tests the ASE aspects.

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.

It looks really good overall, but one change I would probably do is:

Instead of doing all types of calls in a single shot, maybe we could simply parameterize for each call opcode.

Reason being that, running the tests like this makes it difficult to single out the failing ones to a single opcode with an incorrect behavior, but if it was parameterized, it would be very easy to do this, even if it comes at the cost of having to run more tests.

* Apply specific edits
* Parameterize by opcode as well

Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
@shemnon
Copy link
Collaborator Author

shemnon commented May 28, 2024

Refactored so it's parameterized on opcode. However the logic to determine the "correct" output is still in place. The other alternative is 7 slightly different versions of the test and parameters, dropping most if the conditional building.

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!

@marioevz
Copy link
Member

marioevz commented Jun 3, 2024

One last comment I forgot in the review (sorry), I think variables with the addresses could be renamed like this:
address_caller -> address_entry_point
address_target -> address_caller

Because, currently, there is target_address but it does not match what is being placed in the pre-alloc IMO.

Remove RETURNDATALOAD from ASE tests, to be moved to a different test

Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
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 more comments after another review pass.

Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
@marioevz marioevz dismissed winsvega’s stale review June 6, 2024 23:15

All changes have been addressed.

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.

@marioevz marioevz merged commit 53fc6d8 into ethereum:main Jun 6, 2024
5 checks passed
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

5 participants