-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57e9873
commit 884c2f0
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Stwo Cairo Verifier | ||
|
||
A [Cairo](https://github.com/starkware-libs/cairo) program that verifies a [Stwo](https://github.com/starkware-libs/stwo) proof. | ||
|
||
## Install dependencies | ||
|
||
[Install asdf](https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) and run: | ||
|
||
```bash | ||
asdf plugin add scarb | ||
asdf plugin add starknet-foundry | ||
asdf install | ||
``` | ||
|
||
## Run tests | ||
|
||
Make sure [dependencies are installed](#install-dependencies). Run: | ||
|
||
```bash | ||
scarb test | ||
``` | ||
|
||
## Profile tests | ||
|
||
Modify [`Scarb.toml`](./Scarb.toml) to use [Starknet Foundary](https://github.com/foundry-rs/starknet-foundry). | ||
|
||
```diff | ||
[dev-dependencies] | ||
- cairo_test = "2.8.0" | ||
+ snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.32.0" } | ||
+ assert_macros = "2.8.0" | ||
+ | ||
+ [scripts] | ||
+ test = "snforge test --max-n-steps 100000000" | ||
``` | ||
|
||
Generate trace for all tests. | ||
|
||
<!-- TODO(andrew): Debug error on Linux. --> | ||
> :warning: Command produces errors on Linux. | ||
```bash | ||
scarb test -- --save-trace-data | ||
``` | ||
|
||
Install [cairo-profiler](https://github.com/software-mansion/cairo-profiler) and run: | ||
|
||
```bash | ||
# Replace `TEST_NAME` with the name of the test you want profiled. | ||
cairo-profiler ./snfoundry_trace/TEST_NAME.json | ||
``` | ||
|
||
Visualise profile in the browser. | ||
|
||
```bash | ||
# Once opened navigate to `Sample -> steps`. | ||
go tool pprof -http=":8000" profile.pb.gz | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters