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

eof: Update yulSyntaxTests tests for EOF #15660

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rodiazet
Copy link
Contributor

  • Disable test which don't make sense for EOF bytecode format.
  • Create EOF yul syntax tests counterparts.

Copy link

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

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

Just like in #15661, there are better ways to resolve some of these than just disabling them on EOF.

Copy link
Member

Choose a reason for hiding this comment

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

We should have a version of this for EOF, using one of the EOF builtins, e.g. auxdataloadn().

Copy link
Member

Choose a reason for hiding this comment

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

Same with passing_builtin_with_literal_argument_into_literal_argument.yul.

Copy link
Member

@cameel cameel Dec 20, 2024

Choose a reason for hiding this comment

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

Same situation as #15661 (comment): replace codesize() with calldataload(0) and it will work on EOF too.

Same for hex_switch_case_long.yul and string_literal_switch_case.yul.

Copy link
Member

Choose a reason for hiding this comment

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

And the three opcode_for_function*.yul tests will work fine with EOF if you switch from gas to mload for example.

Copy link
Member

Choose a reason for hiding this comment

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

We should have a test for accessing .metadata (and more generally data starting with a dot like in metadata_access_2.yul and metadata_access_subobject.yul) with auxdataloadn(). Is it actually disallowed as it should?

Copy link
Member

Choose a reason for hiding this comment

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

We should have EOF variants of these as well (using auxdataloadn()):

  • data.yul (accessing data objects longer than 32-bytes or using hex)
  • subobject_access.yul (accessing non-data objects - should be forbidden)
  • accessing data nested more than one level.

Copy link
Member

@cameel cameel Dec 20, 2024

Choose a reason for hiding this comment

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

Disabling tests for legacy-only opcodes here is fine, but just a reminder that we'll still need to have them covered eventually, the way I described in #15559 (comment).

Copy link
Member

Choose a reason for hiding this comment

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

Actually, while that test is not critical, we still haven't fixed the underlying issue. Those identifiers are still reserved in Yul and we absolutely have to fix that before the next release. I created an issue so that it does not get forgotten: #15672.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants