From 8b636e0976cfb4c704c777f72a815ba8d0023d87 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 9 Aug 2024 11:33:26 +1000 Subject: [PATCH] Run cannon-prestate if devnet cannon prestate files are missing (#11399) * Fix devnet-up when op-program/bin is missing prestate-proof.json * Fix cannon-prestate to always run * Add prestate.json --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0fdfb07655ef..08842b6feae1 100644 --- a/Makefile +++ b/Makefile @@ -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 "" @@ -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