Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add revert reasons to proxies #440
Solidity doesn't optimize revert reasons well, adding just one character of reason results in ~115 bytes added to the contract (23k gas). Because it pads string constants with 0s so they fit in a 32 byte word, having short strings as we do in this PR doesn't save any gas (contract bytecode gets charged at 200 gas per byte regardless of whether it is 0 or not).
After discussing it offline, I think we shouldn't add revert reasons to proxies and just have them everywhere else, so proxies remain cheap to deploy. Adding revert reasons has resulted in a 33% gas increase for deploying proxies (300k to 400k), which given how easy it would be to debug them (if everything running in the implementation code has reasons, if there is no error data returned then it must be an issue in the proxy which is easier to debug)