Skip to content

Commit

Permalink
Run cannon-prestate if devnet cannon prestate files are missing (ethe…
Browse files Browse the repository at this point in the history
…reum-optimism#11399)

* Fix devnet-up when op-program/bin is missing prestate-proof.json

* Fix cannon-prestate to always run

* Add prestate.json
  • Loading branch information
anacrolix authored Aug 9, 2024
1 parent 770cbc6 commit 8b636e0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ reproducible-prestate: ## Builds reproducible-prestate binary
make -C ./op-program reproducible-prestate
.PHONY: reproducible-prestate

# Include any files required for the devnet to build and run. This appears to be the only one that's actually needed.
DEVNET_CANNON_PRESTATE_FILES := op-program/bin/prestate-proof.json op-program/bin/prestate.json

$(DEVNET_CANNON_PRESTATE_FILES):
make cannon-prestate

cannon-prestate: op-program cannon ## Generates prestate using cannon and op-program
./cannon/bin/cannon load-elf --path op-program/bin/op-program-client.elf --out op-program/bin/prestate.json --meta op-program/bin/meta.json
./cannon/bin/cannon run --proof-at '=0' --stop-at '=1' --input op-program/bin/prestate.json --meta op-program/bin/meta.json --proof-fmt 'op-program/bin/%d.json' --output ""
Expand All @@ -152,16 +158,14 @@ nuke: clean devnet-clean ## Completely clean the project directory
git clean -Xdf
.PHONY: nuke

pre-devnet: submodules ## Prepares for running a local devnet
## Prepares for running a local devnet
pre-devnet: submodules $(DEVNET_CANNON_PRESTATE_FILES)
@if ! [ -x "$(command -v geth)" ]; then \
make install-geth; \
fi
@if ! [ -x "$(command -v eth2-testnet-genesis)" ]; then \
make install-eth2-testnet-genesis; \
fi
@if [ ! -e op-program/bin ]; then \
make cannon-prestate; \
fi
.PHONY: pre-devnet

devnet-up: pre-devnet ## Starts the local devnet
Expand Down

0 comments on commit 8b636e0

Please sign in to comment.