From 4a2a66a92cbc2ac1b1d190cb1de4e0da567fcef5 Mon Sep 17 00:00:00 2001 From: Tei Im Date: Wed, 19 Jun 2024 16:47:35 -0600 Subject: [PATCH] Add prestate-reproducibility CI job --- .circleci/config.yml | 41 ++++++++++++++++++++++++++++++++++++++++- prestates.json | 6 ++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 prestates.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 2744ac80..4a2f2603 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,10 @@ workflows: requires: ["asterisc-prestate"] - op-e2e-asterisc-tests: requires: ["devnet-allocs-including-asterisc"] + - prestate-reproducibility: + matrix: + parameters: + version: ["1.1.0", "1.2.0"] jobs: pnpm-monorepo: @@ -359,4 +363,39 @@ jobs: path: /testlogs when: always - store_test_results: - path: /tmp/test-results \ No newline at end of file + path: /tmp/test-results + + prestate-reproducibility: + docker: + - image: <> + parameters: + version: + type: string + steps: + - checkout + - setup_remote_docker + - run: + name: Fetch submodules for asterisc + command: git submodule update --init + - run: + name: Switch to tag + command: | + cd rvsol/lib/optimism + git fetch + git checkout "op-program/v<>" + git submodule update --init --recursive + - run: + name: Build prestate + command: make reproducible-prestate + - run: + name: Verify prestate + command: | + EXPECTED_PRESTATE_HASH=$(jq -r '.["op-program"]["<>"]' ./prestates.json) + ACTUAL=$(jq -r .pre ./bin/prestate-proof.json) + echo "Expected: ${EXPECTED_PRESTATE_HASH}" + echo "Actual: ${ACTUAL}" + if [[ "${EXPECTED_PRESTATE_HASH}" != "${ACTUAL}" ]] + then + echo "Prestate did not match expected" + exit 1 + fi diff --git a/prestates.json b/prestates.json new file mode 100644 index 00000000..7b7a1ad4 --- /dev/null +++ b/prestates.json @@ -0,0 +1,6 @@ +{ + "op-program": { + "1.1.0": "0x0338dc64405def7e3b9ce8f5076b422a846d831832617d227f13baf219cb5406", + "1.2.0": "0x0399525587d7ffb173aaa43f35e21b78f807a0bd3dc80ea6527f407732726351" + } +}