Skip to content

Commit

Permalink
ci: Sanitize op-program for unsupported instructions (ethereum-optimi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Inphi authored and samlaf committed Nov 10, 2024
1 parent 864a61b commit 59bd763
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,9 @@ jobs:
- restore_cache:
name: Restore cannon prestate cache
key: cannon-prestate-{{ checksum "./cannon/bin/cannon" }}-{{ checksum "op-program/bin/op-program-client.elf" }}
- run:
name: Sanitize op-program guest
command: make -f cannon/Makefile sanitize-program GUEST_PROGRAM=op-program/bin/op-program-client.elf
- run:
name: generate cannon prestate
command: make cannon-prestate
Expand Down
8 changes: 8 additions & 0 deletions cannon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ clean:
elf:
make -C ./testdata/example elf

sanitize-program:
@if ! { mips-linux-gnu-objdump -d -j .text $$GUEST_PROGRAM | awk '{print $3}' | grep -Ew -m1 '(bgezal|bltzal)'; }; then \
echo "guest program is sanitized for unsupported instructions"; \
else \
echo "found unsupported instructions in the guest program"; \
exit 1; \
fi

contract:
cd ../packages/contracts-bedrock && forge build

Expand Down

0 comments on commit 59bd763

Please sign in to comment.