diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f3706e24340d..262e8ac6d6be4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1101,6 +1101,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 diff --git a/cannon/Makefile b/cannon/Makefile index 0f3836fb62fbb..d6a1d85eff898 100644 --- a/cannon/Makefile +++ b/cannon/Makefile @@ -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