Skip to content

Commit

Permalink
Merge pull request #71 from ethereum-optimism/tei/cleanup-op-program-…
Browse files Browse the repository at this point in the history
…test-data

Clean up op-program-test data
  • Loading branch information
pcw109550 authored Jun 25, 2024
2 parents c06a13c + 3b702f6 commit 057fd48
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 257,652 deletions.
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

0 comments on commit 057fd48

Please sign in to comment.