Skip to content

Commit

Permalink
Addressing some review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
shimkiv committed Oct 22, 2024
1 parent ad4bdf1 commit 1b4c945
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/o1vm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,30 @@ on:
workflow_dispatch:
pull_request:
paths:
- "o1vm/**"
[
"o1vm/**",
"folding/**",
"groupmap/**",
"kimchi/**",
"msm/**",
"curves/**",
"poseidon/**",
"poly-commitment/",
]
push:
branches:
- master
paths:
- "o1vm/**"
[
"o1vm/**",
"folding/**",
"groupmap/**",
"kimchi/**",
"msm/**",
"curves/**",
"poseidon/**",
"poly-commitment/",
]

env:
# https://doc.rust-lang.org/cargo/reference/profiles.html#release
Expand Down Expand Up @@ -93,4 +111,4 @@ jobs:
eval $(opam env)
cd o1vm
unzip -q -o /tmp/o1vm-e2e-testing-cache.zip -d ./
FILENAME="env-for-latest-l2-block.sh" O1VM_FLAVOR="pickles" STOP_AT="=3000000" ./run-code.sh
RUN_WITH_CACHED_DATA="y" FILENAME="env-for-latest-l2-block.sh" O1VM_FLAVOR="pickles" STOP_AT="=3000000" ./run-code.sh
2 changes: 1 addition & 1 deletion o1vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ python3 -m http.server 8765 &
- Then run the o1vm with the following command:

```shell
FILENAME="env-for-latest-l2-block.sh" O1VM_FLAVOR="pickles" STOP_AT="=3000000" ./run-code.sh
RUN_WITH_CACHED_DATA="y" FILENAME="env-for-latest-l2-block.sh" O1VM_FLAVOR="pickles" STOP_AT="=3000000" ./run-code.sh
```

- Don't forget to stop the HTTP server after you are done.
Expand Down
4 changes: 2 additions & 2 deletions o1vm/run-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ set -u

source $FILENAME

if [ -d "op-program-db-for-latest-l2-block" ] && [ -f "env-for-latest-l2-block.sh" ] && [ -f "snapshot-state-3000000.json" ] && [ -f "meta.json" ]; then
echo "The Op-Program and the Cannon apps were not executed because of the cache data presence"
if [ "${RUN_WITH_CACHED_DATA:-}" == "y" ]; then
echo "The Op-Program and the Cannon apps were not executed because the cached data usage was requested"
else
./run-op-program.sh
./run-cannon.sh
Expand Down
5 changes: 3 additions & 2 deletions o1vm/run-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ O1VM_FLAVOR to one of these values to run the flavor you would like"
;;
esac

if [ -d "op-program-db-for-latest-l2-block" ] && [ -f "snapshot-state-3000000.json" ]; then
if [ "${RUN_WITH_CACHED_DATA:-}" == "y" ]; then
echo "Setting the environment variables to use the cached data"
export OP_PROGRAM_DATA_DIR="$(pwd)/op-program-db-for-latest-l2-block"
export ZKVM_STATE_FILENAME="$(pwd)/snapshot-state-3000000.json"
# We need to set the L1 and L2 RPC endpoints for op-program to run successfully
export L1_RPC="http://localhost:8765"
export L2_RPC="http://localhost:8765"
fi

RUST_BACKTRACE=full cargo run --bin ${BINARY_FLAVOR} \
cargo run --bin ${BINARY_FLAVOR} \
--all-features \
--release \
-p o1vm -- \
Expand Down

0 comments on commit 1b4c945

Please sign in to comment.