Problem
CI runs forge build --sizes but there is no enforcement of contract size limits. EIP-170 sets the max at 24,576 bytes. We should fail CI if any contract exceeds say 22KB (leaving some headroom).
Approach
- Parse the output of
forge build --sizes
- Fail if any contract in
src/ exceeds the threshold
- Maybe a small shell script or a custom forge script that checks this
- Could also add contract sizes to the gas snapshot report for visibility
The Diamond contracts in particular can get large so this is worth watching.
Problem
CI runs
forge build --sizesbut there is no enforcement of contract size limits. EIP-170 sets the max at 24,576 bytes. We should fail CI if any contract exceeds say 22KB (leaving some headroom).Approach
forge build --sizessrc/exceeds the thresholdThe Diamond contracts in particular can get large so this is worth watching.