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

small improvements for readability and gas #4

Conversation

zeroknots
Copy link
Contributor

Found a few points for improvements during my code review. figured its easiest to take out a PR instead of making a list.

No functionality changes, but should improve on gas and readability

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was able to axe BytesLib entirely by using calldata slicing. should reduce audit LoC

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah yeah good shout since the calldata isn't stored in memory anymore. This is a good win

address public verifierAddr;
address public dkimAddr;
address public emailAuthImplementationAddr;
address internal immutable verifierAddr;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these have getter functions. so will reduce deployment bytecode size

Copy link
Collaborator

Choose a reason for hiding this comment

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

makes sense, posted this suggestion in zkemail/email-tx-builder#28

@zeroknots zeroknots changed the title Feature/zeroknots suggestions small improvements for readability and gas Jun 13, 2024
Copy link
Collaborator

@JohnGuilding JohnGuilding left a comment

Choose a reason for hiding this comment

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

LGTM, cheers!

address public verifierAddr;
address public dkimAddr;
address public emailAuthImplementationAddr;
address internal immutable verifierAddr;
Copy link
Collaborator

Choose a reason for hiding this comment

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

makes sense, posted this suggestion in zkemail/email-tx-builder#28

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah yeah good shout since the calldata isn't stored in memory anymore. This is a good win

@JohnGuilding JohnGuilding marked this pull request as ready for review June 13, 2024 09:43
@JohnGuilding JohnGuilding merged commit 4dd50b4 into zkemail:generic-validator-module Jun 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants