Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from Sovereign-Labs/blaze/sov_prover_mode
Browse files Browse the repository at this point in the history
Run prover in `Execute` mode in the CI
  • Loading branch information
bkolad authored Mar 11, 2024
2 parents cc7b03c + 0f9fea5 commit a3ff620
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ $ make clean-db

#### 3. Start the rollup node:

```sh,test-ci
export SOV_PROVER_MODE=execute
```

This will compile and start the rollup node:

```shell,test-ci,bashtestmd:long-running,bashtestmd:wait-until=RPC
Expand Down Expand Up @@ -127,9 +131,9 @@ $ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method"
```

## Enabling the prover
By default, demo-rollup disables proving (i.e. the default behavior is `SOV_PROVER_CONFIG=skip`). If we want to enable proving, several options are available:
By default, demo-rollup disables proving (i.e. the default behavior is. If we want to enable proving, several options are available:

* `export SOV_PROVER_CONFIG=skip` Skips verification logic.
* `export SOV_PROVER_CONFIG=simulate` Run the rollup verification logic inside the current process.
* `export SOV_PROVER_CONFIG=execute` Run the rollup verifier in a zkVM executor.
* `export SOV_PROVER_CONFIG=prove` Run the rollup verifier and create a SNARK of execution.
* `export SOV_PROVER_MODE=skip` Skips verification logic.
* `export SOV_PROVER_MODE=simulate` Run the rollup verification logic inside the current process.
* `export SOV_PROVER_MODE=execute` Run the rollup verifier in a zkVM executor.
* `export SOV_PROVER_MODE=prove` Run the rollup verifier and create a SNARK of execution.
24 changes: 21 additions & 3 deletions sov-rollup-starter.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,52 @@ if [ $? -ne 0 ]; then
echo "Expected exit code 0, got $?"
exit 1
fi

echo 'Running: '\''make clean-db'\'''
make clean-db
if [ $? -ne 0 ]; then
echo "Expected exit code 0, got $?"
exit 1
fi

echo 'Running: '\''cargo run --bin node'\'''
cargo run --bin node &
sleep 20
output=$(mktemp)
cargo run --bin node &> $output &
background_process_pid=$!
echo "Waiting for process with PID: $background_process_pid"
until grep -q -i RPC $output
do
if ! ps $background_process_pid > /dev/null
then
echo "The background process died" >&2
exit 1
fi
echo -n "."
sleep 5
done

echo 'Running: '\''make test-create-token'\'''
make test-create-token
if [ $? -ne 0 ]; then
echo "Expected exit code 0, got $?"
exit 1
fi

echo 'Running: '\''make wait-ten-seconds'\'''
make wait-ten-seconds
if [ $? -ne 0 ]; then
echo "Expected exit code 0, got $?"
exit 1
fi

echo 'Running: '\''make test-bank-supply-of'\'''
make test-bank-supply-of
if [ $? -ne 0 ]; then
echo "Expected exit code 0, got $?"
exit 1
fi
echo 'Running: '\''curl -X POST -H "Content-Type: application/json" -d '\''{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}'\'' http://127.0.0.1:12345'\'''

echo 'Running: '\''curl -X POST -H "Content-Type: application/json" -d '\''{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}'\'' http://127.0.0.1:12345'\'''
output=$(curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"bank_supplyOf","params":{"token_address":"sov1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27svq9m72"},"id":1}' http://127.0.0.1:12345)
expected='{"jsonrpc":"2.0","result":{"amount":1000},"id":1}
'
Expand All @@ -50,4 +67,5 @@ if [ $? -ne 0 ]; then
echo "Expected exit code 0, got $?"
exit 1
fi

echo "All tests passed!"; exit 0

0 comments on commit a3ff620

Please sign in to comment.