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): EOF - EIP-3540: test all opcodes in valid code section #634

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

winsvega
Copy link
Collaborator

πŸ—’οΈ Description

Put every instruction with valid stack / data in between a valid eof code section

πŸ”— 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.

@winsvega winsvega added the scope:pytest Scope: Pytest plugins label Jun 19, 2024
@winsvega winsvega requested a review from marioevz June 19, 2024 11:42
@winsvega winsvega force-pushed the alleofopcodes branch 2 times, most recently from 77ae17b to 6112be7 Compare June 19, 2024 15:40
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.

Fantastic, thanks!

@marioevz marioevz changed the title test all opcodes in valid eof code section new(tests): EOF - EIP-3540: test all opcodes in valid code section Jun 19, 2024
@winsvega
Copy link
Collaborator Author

winsvega commented Jun 20, 2024

Hi, I think all tests can benefit from UndefinedOpcodes enum.
Also I think Unrechable instruction exception if for another test case. here we just check that if opcode is valid and in eof then no exception happens. (the only exception here is retf)
I applied your commit also

the tox error:

        File "/tmp/pip-build-env-agpk7lji/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 862, in get_command_obj
 cmd_obj = self.command_obj[command] = klass(self)
                                                ^^^^^^^^^^^
      TypeError: 'NoneType' object is not callable
      [end of output]
  

is this related to my code or a global issue?

@winsvega winsvega requested a review from marioevz June 20, 2024 08:11
@marioevz
Copy link
Member

is this related to my code or a global issue?

Global issue, I'll help rebase because I just merged a big PR πŸ‘

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.

Thanks!

@marioevz marioevz merged commit f96e7b5 into main Jun 20, 2024
9 checks passed
@marioevz marioevz deleted the alleofopcodes branch June 20, 2024 15:59
spencer-tb pushed a commit that referenced this pull request Jun 26, 2024
)

* test all opcodes in valid eof code section

* make UndefinedOpcodes global

* do not produce unreachable code on halting instructions
if opcode is halting in eof, let it act as returning opcode
to check that no exception happens

* types fix after rebase

* changelog

* feat(fw): implement hash for bytecode

* fix(tests): remove ._name_

---------

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
scope:pytest Scope: Pytest plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants