Skip to content

Commit

Permalink
ci: fail evm over size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Sep 17, 2024
1 parent 02160b8 commit b17b592
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/evm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jobs:
make lint
id: check

- name: Run size test
run: |
make size-test
echidna:
name: echidna
runs-on: ubuntu-latest
Expand Down
10 changes: 7 additions & 3 deletions evm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ gen-bindings: prod-build
#######################
## TESTS

test: forge-test push0-test

test: forge-test push0-test size-test

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

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


#######################
## LINT
Expand All @@ -42,4 +46,4 @@ lint:


fix-lint:
forge fmt
forge fmt

0 comments on commit b17b592

Please sign in to comment.