Skip to content

Commit eeea26f

Browse files
committed
ci: fail evm over size limit
1 parent 02160b8 commit eeea26f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/evm.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
make lint
4747
id: check
4848

49+
- name: Run size test
50+
run: |
51+
make size-test
52+
4953
echidna:
5054
name: echidna
5155
runs-on: ubuntu-latest

evm/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ gen-bindings: prod-build
2222
#######################
2323
## TESTS
2424

25-
test: forge-test push0-test
26-
25+
test: forge-test push0-test size-test
2726

2827
forge-test:
2928
forge test -vvv
@@ -33,6 +32,11 @@ push0-test:
3332
forge build --extra-output evm.bytecode.opcodes
3433
@if grep -qr --include \*.json PUSH0 ./evm/out; then echo "Contract uses PUSH0 instruction" 1>&2; exit 1; else echo "PUSH0 Verification Succeeded"; fi
3534

35+
# Verify the contract size is under the Spurious Dragon limit (24576 bytes)
36+
# Without the prod profile (using --via-ir), the contracts are too large ='(
37+
size-test:
38+
FOUNDRY_PROFILE=prod forge build --sizes --skip test
39+
3640

3741
#######################
3842
## LINT
@@ -42,4 +46,4 @@ lint:
4246

4347

4448
fix-lint:
45-
forge fmt
49+
forge fmt

0 commit comments

Comments
 (0)