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: change less than = 0 in contracts to == 0to reduce gas costs when the number is unsigned #892

Conversation

NicolasRampoldi
Copy link
Contributor

@NicolasRampoldi NicolasRampoldi commented Aug 29, 2024

Description

  • Changes <= to == in BatcherPaymentService and AlignedLayerServiceManager when it is checked against a uint.

Copy link

Changes to gas cost

Generated at commit: 49d8534096eb1b009346e753c21611af83c98112, compared to commit: 80cbc1a79f48a0eafe04760f0241e8fdf626f9dd

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
AlignedLayerServiceManager receive -6 ✅ -0.01%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
AlignedLayerServiceManager 4,434,980 (-636) receive 45,053 (-6) -0.01% 45,053 (-6) -0.01% 45,053 (-6) -0.01% 45,053 (-6) -0.01% 256 (0)

@MauroToscano MauroToscano merged commit b2982a9 into main Aug 29, 2024
3 checks passed
@MauroToscano MauroToscano deleted the 889-change-less-than-=-0-in-contracts-to-==-0to-reduce-gas-costs-when-the-number-is-unsigned branch August 29, 2024 16:18
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.

Change less than <= 0 in contracts to == 0to reduce gas costs when the number is unsigned
4 participants