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

fix(vm): Bytecode comparison #939

Merged
merged 3 commits into from
Nov 6, 2024
Merged

fix(vm): Bytecode comparison #939

merged 3 commits into from
Nov 6, 2024

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Nov 5, 2024

🗒️ Description

Fixes Bytecode equality comparison method to take other properties into account when comparing against some other Bytecode object.

The issue surfaced when I tried to implement tests for EIP-5920 that contains the PAY opcode, which collides with the EXTDELEGATECALL opcode for EOF. When both opcodes were included in the same Enum, it seems like this class internally performs an optimization that compares all items and reuses instances that return __eq__() == True, which lead to the Op.PAY being equal to the value assigned to Op.EXTDELEGATECALL.

🔗 Related Issues

None.

✅ 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: A PR with removal of converted JSON/YML tests from ethereum/tests have been opened.
  • 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.

@marioevz marioevz added type:bug Something isn't working scope:fw Scope: Framework (evm|tools|forks|pytest) labels Nov 5, 2024
@marioevz marioevz requested review from danceratopz and winsvega and removed request for danceratopz November 5, 2024 17:25
Co-authored-by: raxhvl <10168946+raxhvl@users.noreply.github.com>
Copy link
Member

@danceratopz danceratopz 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 4e8822d into main Nov 6, 2024
5 checks passed
@marioevz marioevz deleted the fix-bytecode-eq branch November 6, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:fw Scope: Framework (evm|tools|forks|pytest) type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants