Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

eof: Update yul legacy tests #15658

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

rodiazet
Copy link
Contributor

Add bytecodeFormat: legacy to all tests which are supposed to run in legacy bytecode mode only.

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.

@rodiazet rodiazet changed the title eof: update yul legacy tests eof: Update yul legacy tests Dec 19, 2024
@rodiazet rodiazet force-pushed the eof-update-yul-legacy-tests branch 2 times, most recently from 4964479 to ccf6260 Compare December 19, 2024 15:31
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.

No problems here, but there are quite a few tests that can be easily made portable with small adjustments. And some cases where multiple tests are crammed into one file and we could easily restrict only one part and let the rest run for all backends.

Copy link
Member

Choose a reason for hiding this comment

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

Just a general note: there are a few tests like this one that don't necessarily need a separate EOF version, but are relevant to all the backends, not just legacy. Keeping them restricted to legacy runs the risk that in the future someone will assume that they can be dropped along with legacy backend. Not sure how to prevent that. Maybe we should revisit the PR and switch them to EOF when it becomes the default backend.

@rodiazet rodiazet force-pushed the eof-update-yul-legacy-tests branch from ccf6260 to d3c09aa Compare January 29, 2025 12:04
@rodiazet rodiazet requested a review from cameel January 29, 2025 12:04
// let _5 := 0
// sstore(_5, _4)
// pop(extcall(_5, _5, _5, _5))
// sstore(_5, _1)
Copy link
Member

Choose a reason for hiding this comment

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

Nice. The original test had an unresolved mload() here.

This seems to be the practical effect of the fact that we have to assume that CALL writes memory but EXTCALL can only ever read it.

CALL's write could be figured out to have no impact but apparently we ignore its length.

Copy link
Member

Choose a reason for hiding this comment

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

But I just noticed something in SemanticInfo.cpp that looks like a bug:

if (_instruction == Instruction::EXTDELEGATECALL)
{
operations.emplace_back(Operation{Location::Storage, Effect::Write, {}, {}, {}});
operations.emplace_back(Operation{Location::TransientStorage, Effect::Write, {}, {}, {}});
}

Looks like we decided to mark EXTDELEGATECALL as writing storage/tstorage, but not EXTCALL, even though CALL is marked as such. I may have been thinking only about direct writes when I reviewed it but I guess EXTCALL can modify storage indirectly, by calling a function that can do that. We should fix that (and make sure there's a test where the difference shows).

@rodiazet rodiazet force-pushed the eof-update-yul-legacy-tests branch from d3c09aa to 3dc0fea Compare January 29, 2025 22:16
@cameel
Copy link
Member

cameel commented Jan 31, 2025

There are still two unaddressed things here: #15658 (comment) and #15658 (comment). After that we can merge.

@rodiazet rodiazet force-pushed the eof-update-yul-legacy-tests branch from 3dc0fea to e96c085 Compare February 1, 2025 09:05
cameel
cameel previously approved these changes Feb 1, 2025
@rodiazet rodiazet force-pushed the eof-update-yul-legacy-tests branch from 105b6db to c9466e5 Compare February 3, 2025 12:06
@cameel cameel enabled auto-merge February 3, 2025 12:31
@cameel cameel merged commit f83e7d8 into ethereum:develop Feb 3, 2025
74 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants