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

To ensure accurate assessment of performance, a gas benchmark must be included in all gas reports. #139

Open
pavankv241 opened this issue Jan 9, 2024 · 1 comment

Comments

@pavankv241
Copy link

Summary

I'm pointing out that gas submissions should include benchmarks to help sponsors and judges accurately assess the gas savings achieved by the findings in the report. I've seen numerous reports that contain findings such as move checks to the top of functions to save gas, but in practice, this often results in lower than minimal gas savings and merely returns unused gas in some cases. Additionally, findings such as Refactor code or functions to save gas and rearrange variables or structs often lack practical data(means exact gas benchmark which could saved by refactoring) to support their potential impact. Wardens proposing changes to code structures , storage structures or function calls for gas optimization should experimentally validate their findings using tools like (Foundry, Hardhat, or others) to provide concrete gas benchmarks.

I agree that for findings like Use bitmaps instead of booleans in mapping (saves 100000), providing gas benchmarks is impractical as it would necessitate a complete overhaul of the protocol's codebase. However, these types of findings can be effectively identified by automated bots, no need of manual work

Recommendation

We recommend mandating the inclusion of gas benchmarks in gas submissions. This would encourage wardens to experimentally validate their findings with code, leading to more unique and valuable insights for sponsors.
(Correct this if wrong)

Thank you

@pavankv241
Copy link
Author

pavankv241 commented Jan 11, 2024

Any comments on this from C4 members

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

No branches or pull requests

1 participant