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

Export types with no features enables #157

Merged
merged 33 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b8294af
Update scarb
fmkra Oct 23, 2024
a130db2
Separate fact_registry interfaces and add new feature
fmkra Oct 24, 2024
9c131d2
Re-export some types
fmkra Oct 24, 2024
e341830
Update Scarb.toml
fmkra Oct 24, 2024
19c7e80
Format
fmkra Oct 24, 2024
5a135f0
Update snfoundry
fmkra Oct 24, 2024
2d54ef5
Remove snforge_std
fmkra Oct 24, 2024
f065075
Rename cairo_verifier -> integrity
fmkra Nov 5, 2024
de62cf5
Add strict/relaxed public memory verification
fmkra Nov 8, 2024
51e2ec4
Fix CI/CD
fmkra Nov 8, 2024
d9e5e56
Fix CI/CD
fmkra Nov 8, 2024
00cee89
Rename cairo_version => memory_verification
fmkra Nov 8, 2024
4e36286
Fmt
fmkra Nov 8, 2024
7a07c4f
Update deployed contracts
fmkra Nov 8, 2024
635fcbb
Update README and comment
fmkra Nov 8, 2024
5ddde54
Implement lib utils
fmkra Nov 14, 2024
c193677
Fix runner
fmkra Nov 15, 2024
6abd258
Merge remote-tracking branch 'origin/audit' into update_scarb
fmkra Nov 18, 2024
ab8eb14
Remove lfs
fmkra Nov 18, 2024
9b345da
Fix benches
fmkra Nov 18, 2024
0ff7e2f
Remove lfs from CI/CD
fmkra Nov 18, 2024
5702c4f
example proofs
Okm165 Nov 19, 2024
ea794d0
_verifier_logic feature rename
Okm165 Nov 19, 2024
2a27aeb
Merge branch 'main' into update_scarb
fmkra Nov 19, 2024
18d3e2f
Update class hashes
fmkra Nov 19, 2024
4f3de98
Redeploy contracts
fmkra Nov 19, 2024
961ec70
Update utils
fmkra Nov 19, 2024
6b70008
Fmt
fmkra Nov 19, 2024
bc3b482
Add get_fact_registry to proxy contract
fmkra Nov 19, 2024
c467455
Update utils
fmkra Nov 19, 2024
be4cbc0
Update README
fmkra Nov 19, 2024
ce1f952
Update README
fmkra Nov 19, 2024
6e27944
README reorder
fmkra Nov 19, 2024
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
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

62 changes: 30 additions & 32 deletions .github/workflows/proof_verification_tests.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
name: Continuous Integration - proof verification tests

on:
push:
branches:
- main
pull_request:
branches:
- main
push:
branches:
- main
pull_request:
branches:
- main

jobs:
verify-example-proofs:
runs-on: ubuntu-latest
strategy:
matrix:
cairo_version: ["cairo0", "cairo1"]
layout: ["recursive", "recursive_with_poseidon", "small", "dex", "starknet", "starknet_with_keccak"]
hash_function: ["keccak"]
hasher_bit_length: ["160_lsb"]
stone_version: ["stone5"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true

- name: Setup Scarb
uses: software-mansion/setup-scarb@v1

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Build project
run: scarb build --no-default-features --features monolith,${{ matrix.layout }},${{ matrix.hash_function }}

- name: Run verification
run: cargo run --release --bin runner -- --program target/dev/cairo_verifier.sierra.json --cairo-version ${{ matrix.cairo_version }} --stone-version ${{ matrix.stone_version }} --hasher-bit-length ${{ matrix.hasher_bit_length }} < examples/proofs/${{ matrix.layout }}/${{ matrix.cairo_version }}_${{ matrix.stone_version }}_${{ matrix.hash_function }}_${{ matrix.hasher_bit_length }}_example_proof.json
verify-example-proofs:
runs-on: ubuntu-latest
strategy:
matrix:
memory_verification: ['cairo0', 'cairo1']
layout: ['recursive', 'recursive_with_poseidon', 'small', 'dex', 'starknet', 'starknet_with_keccak']
hash_function: ['keccak']
hasher_bit_length: ['160_lsb']
stone_version: ['stone5']
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Scarb
uses: software-mansion/setup-scarb@v1

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Build project
run: scarb build --no-default-features --features monolith,${{ matrix.layout }},${{ matrix.hash_function }}

- name: Run verification
run: cargo run --release --bin runner -- --program target/dev/integrity.sierra.json --memory-verification ${{ matrix.memory_verification == 'cairo0' && 'strict' || 'cairo1' }} --stone-version ${{ matrix.stone_version }} --hasher-bit-length ${{ matrix.hasher_bit_length }} < examples/proofs/${{ matrix.layout }}/${{ matrix.memory_verification }}_${{ matrix.stone_version }}_${{ matrix.hash_function }}_${{ matrix.hasher_bit_length }}_example_proof.json
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
scarb 2.8.2
starknet-foundry 0.30.0
scarb 2.8.4
starknet-foundry 0.32.0
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

![Integrity](.github/readme.png)

[![Continuous Integration - tests](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/tests.yml/badge.svg)](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/tests.yml)
[![Continuous Integration - tests](https://github.com/HerodotusDev/integrity/actions/workflows/tests.yml/badge.svg)](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/tests.yml)

[![Continuous Integration - proof verification tests](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/proof_verification_tests.yml/badge.svg)](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/proof_verification_tests.yml)
[![Continuous Integration - proof verification tests](https://github.com/HerodotusDev/integrity/actions/workflows/proof_verification_tests.yml/badge.svg)](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/proof_verification_tests.yml)

## Table of contents

Expand Down Expand Up @@ -44,7 +44,7 @@ After that, you can use `verify-on-starknet.sh` script to send the transaction t
For example, run:

```bash
./verify-on-starknet.sh 0x16409cfef9b6c3e6002133b61c59d09484594b37b8e4daef7dcba5495a0ef1a examples/calldata recursive keccak_248_lsb stone5 cairo0
./verify-on-starknet.sh 0x16409cfef9b6c3e6002133b61c59d09484594b37b8e4daef7dcba5495a0ef1a examples/calldata recursive keccak_248_lsb stone5 strict
```

This bash script internally calls `verify_proof_full_and_register_fact` function on FactRegistry contract.
Expand All @@ -69,8 +69,8 @@ You can use cairo runner to run the verifier on example proof:

```bash
cargo run --release --bin runner -- \
--program target/dev/cairo_verifier.sierra.json \
--cairo-version cairo0 \
--program target/dev/integrity.sierra.json \
--memory-verification strict \
--stone-version stone5 \
--hasher-bit-length 160_lsb \
< examples/proofs/recursive/cairo0_stone5_keccak_160_lsb_example_proof.json
Expand All @@ -90,7 +90,7 @@ verifier types: [`monolith`, `split`]

There are also additional settings that can be configured at runtime:

`cairo_version`: [`cairo0`, `cairo1`]<br />
`memory_verification`: [`strict`, `relaxed`, `cairo1`]<br />
`stone_version`: [`stone5`, `stone6`]<br />
hasher bit length: [`160_lsb`, `248_lsb`]

Expand All @@ -113,7 +113,7 @@ scarb test
In order to launch benchmarking, just run this (it requires recursive layout configuration):

```bash
cargo run --release --bin benches -- target/dev/cairo_verifier.sierra.json
cargo run --release --bin benches -- target/dev/integrity.sierra.json
```

## Creating a Proof
Expand Down
21 changes: 11 additions & 10 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "cairo_verifier"
name = "integrity"
version = "0.1.0"

[dependencies]
starknet = "2.8.2"
starknet = "2.8.4"

[dev-dependencies]
cairo_test = "2.8.2"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" }
cairo_test = "2.8.4"

[[target.starknet-contract]]
casm = true
Expand All @@ -19,12 +18,14 @@ casm = false

[features]

recursive = []
recursive_with_poseidon = []
dex = []
small = []
starknet = []
starknet_with_keccak = []
feature_change_my_name = []
fmkra marked this conversation as resolved.
Show resolved Hide resolved

recursive = ["feature_change_my_name"]
recursive_with_poseidon = ["feature_change_my_name"]
dex = ["feature_change_my_name"]
small = ["feature_change_my_name"]
starknet = ["feature_change_my_name"]
starknet_with_keccak = ["feature_change_my_name"]

keccak = []
blake2s = []
Expand Down
2 changes: 1 addition & 1 deletion benches/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn bench(sierra_program: Program, function: &str) -> Result<RunResultStarkne
let func = runner.find_function(function).unwrap();
runner.run_function_with_starknet_context(
func,
&[],
vec![],
Some(u32::MAX as usize),
Default::default(),
)
Expand Down
26 changes: 13 additions & 13 deletions deployed_contracts.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
## Main contracts

FactRegistry: [0x2bcbc9dd00988db418fe0e4a9a05e9de2de7c1b68fda33db86cfd981ef313c9](https://sepolia.voyager.online/contract/0x2bcbc9dd00988db418fe0e4a9a05e9de2de7c1b68fda33db86cfd981ef313c9#readContract)
FactRegistry: [0x29c2b0814ee46fda23adc8ea45b33dbc87288ad09644d6dd8bf6729ead7663a](https://sepolia.voyager.online/contract/0x29c2b0814ee46fda23adc8ea45b33dbc87288ad09644d6dd8bf6729ead7663a#readContract)

Proxy: [0x16409cfef9b6c3e6002133b61c59d09484594b37b8e4daef7dcba5495a0ef1a](https://sepolia.voyager.online/contract/0x16409cfef9b6c3e6002133b61c59d09484594b37b8e4daef7dcba5495a0ef1a#readContract)

## Verifiers

| layout | hasher | address |
| ----------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dex | keccak | [0x00bcbb96b22a92015574ec9f91d2ed945882a575a4e9d3c210a73ba89e0e303f](https://sepolia.voyager.online/contract/0x00bcbb96b22a92015574ec9f91d2ed945882a575a4e9d3c210a73ba89e0e303f#writeContract) |
| dex | blake2s | [0x06ec76dd259017b7348ad64b0fcd275dbf09852fbd0c566ccae568a9e9946bfa](https://sepolia.voyager.online/contract/0x06ec76dd259017b7348ad64b0fcd275dbf09852fbd0c566ccae568a9e9946bfa#writeContract) |
| recursive | keccak | [0x05ab958fbb0ee6bdb22bbcdd2f14310332af8b4ae1df6670e6b27f85a164dea9](https://sepolia.voyager.online/contract/0x05ab958fbb0ee6bdb22bbcdd2f14310332af8b4ae1df6670e6b27f85a164dea9#writeContract) |
| recursive | blake2s | [0x05aC8699796B2721730Ad6bF92e0d18C28D784453194B279127c6BaCE5C3b806](https://sepolia.voyager.online/contract/0x05aC8699796B2721730Ad6bF92e0d18C28D784453194B279127c6BaCE5C3b806#writeContract) |
| recursive_with_poseidon | keccak | [0x017f154e7d7d17e597b99522f93dac9dc5fdc84fffb0c1556c384ef9b99e382d](https://sepolia.voyager.online/contract/0x017f154e7d7d17e597b99522f93dac9dc5fdc84fffb0c1556c384ef9b99e382d#writeContract) |
| recursive_with_poseidon | blake2s | [0x005a22229211254d1f47c1082d3eac421eadd2d9fa74d5c2123245c4173f239c](https://sepolia.voyager.online/contract/0x005a22229211254d1f47c1082d3eac421eadd2d9fa74d5c2123245c4173f239c#writeContract) |
| small | keccak | [0x0636b3b67a391499bcdbbbaa03c9cc2e9526dcb12162b8cd45f8d50649502ab9](https://sepolia.voyager.online/contract/0x0636b3b67a391499bcdbbbaa03c9cc2e9526dcb12162b8cd45f8d50649502ab9#writeContract) |
| small | blake2s | [0x06f23a4ca98495d556f3e320b8b8399e36975835f03aa40915354c334da2f555](https://sepolia.voyager.online/contract/0x06f23a4ca98495d556f3e320b8b8399e36975835f03aa40915354c334da2f555#writeContract) |
| starknet | keccak | [0x04042f4f32b5245ff6c4c3cdff6c6e20b2c1925ecaae8160e41295fd22817764](https://sepolia.voyager.online/contract/0x04042f4f32b5245ff6c4c3cdff6c6e20b2c1925ecaae8160e41295fd22817764#writeContract) |
| starknet | blake2s | [0x05a6c0f84179d695f0b598cc5d0be50421c247da95cfe63e4cd66fc27f32dfe6](https://sepolia.voyager.online/contract/0x05a6c0f84179d695f0b598cc5d0be50421c247da95cfe63e4cd66fc27f32dfe6#writeContract) |
| starknet_with_keccak | keccak | [0x043a7997e5cbadbdd976cb202ba24c771cb8560ed2af2823b8c7bf9f45695d8c](https://sepolia.voyager.online/contract/0x043a7997e5cbadbdd976cb202ba24c771cb8560ed2af2823b8c7bf9f45695d8c#writeContract) |
| starknet_with_keccak | blake2s | [0x016a49add364f99cbdefd5105a93c2f413a794444e116629bb37b7c4127387c7](https://sepolia.voyager.online/contract/0x016a49add364f99cbdefd5105a93c2f413a794444e116629bb37b7c4127387c7#writeContract) |
| dex | keccak | [0x02254c79b4047325a568ed5f0c470f7e2f4c5b17251bf1339486e1945474c860](https://sepolia.voyager.online/contract/0x02254c79b4047325a568ed5f0c470f7e2f4c5b17251bf1339486e1945474c860#writeContract) |
| dex | blake2s | [0x06a7326d332e0660277693d4656ba4c5e6a3049ad223ee85ee0468aa42982982](https://sepolia.voyager.online/contract/0x06a7326d332e0660277693d4656ba4c5e6a3049ad223ee85ee0468aa42982982#writeContract) |
| recursive | keccak | [0x03fdea84d2288d0162051b3606e8f42dbd74e2151ce40c077065f0623ebe84e5](https://sepolia.voyager.online/contract/0x03fdea84d2288d0162051b3606e8f42dbd74e2151ce40c077065f0623ebe84e5#writeContract) |
| recursive | blake2s | [0x01d216b505086733e3c921b46ae15054d9ca2759c9a342446dd5016561786749](https://sepolia.voyager.online/contract/0x01d216b505086733e3c921b46ae15054d9ca2759c9a342446dd5016561786749#writeContract) |
| recursive_with_poseidon | keccak | [0x00b9552c33830ffa76978caf835530b28e0fc0f05e7786e8c3026ca4ae4d7c81](https://sepolia.voyager.online/contract/0x00b9552c33830ffa76978caf835530b28e0fc0f05e7786e8c3026ca4ae4d7c81#writeContract) |
| recursive_with_poseidon | blake2s | [0x077ac0027ac4aaa5362d03c4b381481b5a37a65da78e40a0f6d5b9128bbba49e](https://sepolia.voyager.online/contract/0x077ac0027ac4aaa5362d03c4b381481b5a37a65da78e40a0f6d5b9128bbba49e#writeContract) |
| small | keccak | [0x06a990f708e81a397c71cc816193befa7f22824561f42a2e4b1d2a6a7107e8b2](https://sepolia.voyager.online/contract/0x06a990f708e81a397c71cc816193befa7f22824561f42a2e4b1d2a6a7107e8b2#writeContract) |
| small | blake2s | [0x042d089f0426781F1623f5bA47BB3452f5EF8b980a81DAc6183d80BE8F31aC40](https://sepolia.voyager.online/contract/0x042d089f0426781F1623f5bA47BB3452f5EF8b980a81DAc6183d80BE8F31aC40#writeContract) |
| starknet | keccak | [0x00d7fd266dccc369f400879e4b2245beaa843fb02ae39230434eaeffa1a40c6e](https://sepolia.voyager.online/contract/0x00d7fd266dccc369f400879e4b2245beaa843fb02ae39230434eaeffa1a40c6e#writeContract) |
| starknet | blake2s | [0x05d7577af506bd61c76b45b76dbeebf3ab24ba6a091fac4aa63476e00692ec45](https://sepolia.voyager.online/contract/0x05d7577af506bd61c76b45b76dbeebf3ab24ba6a091fac4aa63476e00692ec45#writeContract) |
| starknet_with_keccak | keccak | [0x044c71ae5394bdb96c74e449f8223e3d17f22c032990913d0961055700c487ef](https://sepolia.voyager.online/contract/0x044c71ae5394bdb96c74e449f8223e3d17f22c032990913d0961055700c487ef#writeContract) |
| starknet_with_keccak | blake2s | [0x014ddd21ec7544df1d8698e1f0a13a2e40b631ff7c0da10c81c7e5c20176406a](https://sepolia.voyager.online/contract/0x014ddd21ec7544df1d8698e1f0a13a2e40b631ff7c0da10c81c7e5c20176406a#writeContract) |
2 changes: 1 addition & 1 deletion deployment/fact_registry/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
echo -n "Owner account address: "
read OWNER

CLASSHASH=0x4012cfd3e1d5d7d10bf28ff0865a45572e4016734642adc39d87d5b653f2467
CLASSHASH=0x1fae2572ca0fb3c068d5f19242ebbb6868d926147fc0a1b36ac0fafaee1f0c8

sncast \
deploy \
Expand Down
2 changes: 1 addition & 1 deletion deployment/proxy/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
echo -n "Owner account address: "
read OWNER

CLASSHASH=0x5f5c798412f0f0e9760440a83f86ef5ff08f8de87a7f9de279edc09faa2e8dd
CLASSHASH=0x42e2c9fcdaac0d8d368b1665ff220bbf2203080229f0f506d1a9b84966ca497

sncast \
deploy \
Expand Down
2 changes: 1 addition & 1 deletion deployment/verifiers/dex/blake2s/deploy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x496ecabd17e28574acc322b7ab7852bb6da4c6a6e00a82a6b76f73e19e272c5"
class_hash = "0x568ededdacd96311b6a6534c8e36ba8bf1dde0c9e8b55cfc18e780772b852f8"
inputs = ["0", "contract_oods"]
id = "cairo_verifier"
unique = false
2 changes: 1 addition & 1 deletion deployment/verifiers/dex/keccak/deploy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x380d3fc5a62543cb8647ed40bc46f8b5965343f9514f5ec4b43d7dec4f709f0"
class_hash = "0x6f88d24fbdbac3934dbec3583500b67f98eba59e1bb92600d85aa31dadabb9e"
inputs = ["0", "contract_oods"]
id = "cairo_verifier"
unique = false
2 changes: 1 addition & 1 deletion deployment/verifiers/recursive/blake2s/deploy.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[call]]
call_type = "deploy"
class_hash = "0x69ec221ce15a515a21c65543906f8906c2fa06cd08c12b2bd96e6029340b6fd"
class_hash = "0x8335efaf34ac04001aead78e7861e40aa0aa1da7f5256121ebdb3919b8d755"
inputs = ["0", "0"]
id = "cairo_verifier"
unique = false
2 changes: 1 addition & 1 deletion deployment/verifiers/recursive/keccak/deploy.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[call]]
call_type = "deploy"
class_hash = "0x86b9ff63dcd5f683aaa189b5ad3d06e8d2ca8e0d1e6907a2ca956ae3bcc902"
class_hash = "0x6079056ad7b320d7c9d914305423d46a8de68f3a5920bdc55db3c50ef5369d7"
inputs = ["0", "0"]
id = "cairo_verifier"
unique = false
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x53b659fd4a42151ee331523146f804de0d6466987b73f9087bb427182dcba3d"
class_hash = "0x2f4e4f17af30e615534604c0755d4a2ecd1209b0ded9bfb83b86bb81dd7efe"
inputs = ["0", "contract_oods"]
id = "cairo_verifier"
unique = false
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x338e2ab9e0f32f3d46ddc8eddbf022f3d337c9a608d021b7e6439043b4ee41e"
class_hash = "0x336ded106c6838030eba86d6736bb2c7fbf680ef428d6485de2de674eb5a3b9"
inputs = ["0", "contract_oods"]
id = "cairo_verifier"
unique = false
2 changes: 1 addition & 1 deletion deployment/verifiers/small/blake2s/deploy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x3b1f5a36125009073cd3369e53340728b81142170d59007423aecf55ec9618b"
class_hash = "0x6cc759c0bce9c1db38bea8ca10f2dd2126f65f40f64167fd4d2ef3488a9ff47"
inputs = ["0", "contract_oods"]
id = "cairo_verifier"
unique = false
2 changes: 1 addition & 1 deletion deployment/verifiers/small/keccak/deploy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x73140f192d936896233424c8569270d9ad52b1dcab576a976b76c2382e93865"
class_hash = "0x60c74b410323ff74e90d30da730e8247c292f88fa3c580e6da52900fd7314de"
inputs = ["0", "contract_oods"]
id = "cairo_verifier"
unique = false
2 changes: 1 addition & 1 deletion deployment/verifiers/starknet/blake2s/deploy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x3b4262853675fd80d71d8860cfb99da12c3a7cb04de780e91a1b7f5d53a682a"
class_hash = "0x6f9bc54216975378e0c6a7ca7f8fe6e7f27ed216ef4ff6b86b3bc4d652bfe3e"
inputs = ["contract_composition", "0"]
id = "cairo_verifier"
unique = false
2 changes: 1 addition & 1 deletion deployment/verifiers/starknet/keccak/deploy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x4b8175dfef1d3198d177f8c55bef570615362ab9d1e5179e69b06d6b3aeb0f1"
class_hash = "0x710854bb20d57857bc8054c36dcd2986382336422f55f0a65fd107816de8fa3"
inputs = ["contract_composition", "0"]
id = "cairo_verifier"
unique = false
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x254f72709569beade11573184fecc8145362dcd55e718b5761dfb43733ddbf7"
class_hash = "0xaf93e3a0264ba6caeb45b0345e731d63b607b7a214d13dd9d0b30b2e05d84a"
inputs = ["contract_composition_master", "contract_oods"]
id = "cairo_verifier"
unique = false
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ unique = false

[[call]]
call_type = "deploy"
class_hash = "0x18f3341c3d0410318a12f504c930fff4aba0f953a7d1c5770acbe978942e628"
class_hash = "0x4e325bf0aa7fc8735dd5407a21281f313e3fd94dacc25267148d9f43b60825a"
inputs = ["contract_composition_master", "contract_oods"]
id = "cairo_verifier"
unique = false
16 changes: 9 additions & 7 deletions runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ use clap::ValueEnum;
pub use vec252::VecFelt252;

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum CairoVersion {
Cairo0 = 0,
Cairo1 = 1,
pub enum MemoryVerification {
Strict = 0,
Relaxed = 1,
Cairo1 = 2,
}

impl From<CairoVersion> for Felt252 {
fn from(value: CairoVersion) -> Self {
impl From<MemoryVerification> for Felt252 {
fn from(value: MemoryVerification) -> Self {
match value {
CairoVersion::Cairo0 => Felt252::from(0),
CairoVersion::Cairo1 => Felt252::from(1),
MemoryVerification::Strict => Felt252::from(0),
MemoryVerification::Relaxed => Felt252::from(1),
MemoryVerification::Cairo1 => Felt252::from(2),
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use cairo_lang_sierra::program::VersionedProgram;
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use clap::Parser;
use itertools::{chain, Itertools};
use runner::{CairoVersion, HasherBitLength, StoneVersion};
use runner::{HasherBitLength, MemoryVerification, StoneVersion};
use std::{
fs,
io::{stdin, Read},
Expand All @@ -25,7 +25,7 @@ struct Cli {
program: String,
/// Cairo version - public memory pattern
#[clap(value_enum, short, long)]
cairo_version: CairoVersion,
memory_verification: MemoryVerification,
/// Stone version
#[clap(value_enum, short, long)]
stone_version: StoneVersion,
Expand Down Expand Up @@ -69,9 +69,9 @@ fn main() -> anyhow::Result<()> {
.unwrap();

let func = runner.find_function(ENTRYPOINT).unwrap();
let args = &[
let args = vec![
Arg::Array(proof.into_iter().map(Arg::Value).collect_vec()),
Arg::Value(cli.cairo_version.into()),
Arg::Value(cli.memory_verification.into()),
Arg::Value(cli.hasher_bit_length.into()),
Arg::Value(cli.stone_version.into()),
];
Expand Down
Loading
Loading