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

Add an optimizer test case based on OpenZeppelin's Base64 library #12442

Closed
cameel opened this issue Dec 21, 2021 · 2 comments · Fixed by #12659
Closed

Add an optimizer test case based on OpenZeppelin's Base64 library #12442

cameel opened this issue Dec 21, 2021 · 2 comments · Fixed by #12659

Comments

@cameel
Copy link
Member

cameel commented Dec 21, 2021

OpenZeppelin is currently working on a base-64 library (OpenZeppelin/openzeppelin-contracts#2884) and it turns out that our optimizer is not yet good enough to get to the level of hand-optimized assembly in that case. We should add this code as a test case so that we can use it to evaluate our optimizer improvements.

In the PR and its comments you'll find versions of the library with and without inline assembly. Add them both as test cases. I think I'd put them in solidity/test/libsolidity/semanticTests/externalContracts/, which would allow us to see gas usage in both cases. Add some expectations with known good base-64 input/output to make sure the code works correctly (the one I originally posted in comments there was actually buggy).

It might also be helpful to have these as command-line tests with --ir-optimized ouptut to be able to see changes in the generated Yul.

@paarthmadan
Copy link
Contributor

I'm interested in taking this on! cc: @cameel

@cameel
Copy link
Member Author

cameel commented Dec 30, 2021

Great! I think everything that's needed is in the description but feel free to ask if it's not clear.

BTW, many people on the team (including me) are off this time of year so don't be discouraged if your PR does not get reviewed right away. We have a bit of a PR backlog right now but we'll get through it once more people are back :)

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

Successfully merging a pull request may close this issue.

2 participants