Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up op-program-test data #71

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Build op-program
run: make -C rvsol/lib/optimism/op-program op-program-host && cp rvsol/lib/optimism/op-program/bin/op-program tests/op-program-test/
- name: Run op-program
run: tar -xzvf ./preimages.tar.gz && ./local_cmd.sh
run: tar -xzvf ./test-data.tar.gz && ./local_cmd.sh
working-directory: tests/op-program-test

rvgo-abigen:
Expand Down
9 changes: 5 additions & 4 deletions tests/op-program-test/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,20 @@ async def subscribe_logs():
./asterisc run \\
--info-at '%10000000' \\
--proof-at never \\
--input ./state.json \\
--input ./test-data/state.json \\
--meta ./test-data/meta.json \\
-- \\
./op-program \\
--rollup.config ./chain-artifacts/rollup.json \\
--l2.genesis ./chain-artifacts/genesis-l2.json \\
--rollup.config ./test-data/chain-artifacts/rollup.json \\
--l2.genesis ./test-data/chain-artifacts/genesis-l2.json \\
--l1.trustrpc \\
--l1.rpckind debug_geth \\
--l1.head {logs[1]["l1BlockHash"]} \\
--l2.head {l2_head} \\
--l2.outputroot {logs[0]["outputRoot"]} \\
--l2.claim {logs[1]["outputRoot"]} \\
--l2.blocknumber {logs[1]["l2BlockNumber"]} \\
--datadir ./preimages \\
--datadir ./test-data/preimages \\
--log.format terminal \\
--server'''

Expand Down
15 changes: 9 additions & 6 deletions tests/op-program-test/capture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ cp op-program/bin/op-program $script_dir/
make devnet-up

# Copy devnet artifacts
cp .devnet/rollup.json $script_dir/chain-artifacts/
cp .devnet/genesis-l2.json $script_dir/chain-artifacts/
mkdir -p $script_dir/test-data/chain-artifacts
cp .devnet/rollup.json $script_dir/test-data/chain-artifacts/
cp .devnet/genesis-l2.json $script_dir/test-data/chain-artifacts/

# Load op-program RISCV binary
cd $script_dir
Expand All @@ -39,13 +40,15 @@ cd $script_dir
$absolute_python_path capture.py

# Capture preimages
rm -f ./preimages.tar.gz
mkdir ./preimages
rm -f ./test-data.tar.gz
mkdir -p ./test-data/preimages
mv state.json ./test-data/
mv meta.json ./test-data/
./capture_cmd.sh
tar -czvf preimages.tar.gz ./preimages
tar -czvf test-data.tar.gz ./test-data

# Clean up
rm -r ./preimages ./capture_cmd.sh ./asterisc ./op-program ./op-program-client-riscv.elf ./out.json
rm -r ./test-data ./capture_cmd.sh ./asterisc ./op-program ./op-program-client-riscv.elf ./out.json

# Write optimism version
echo $git_commit_hash > VERSION
Loading
Loading