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

new stone version & dynamic layout - support #32

Merged
merged 57 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
21d4823
Cairo v0.13.2a0 (pre). changes applied
Okm165 Jul 31, 2024
dcaa55e
hash calcs
Okm165 Jul 31, 2024
9ce4356
keccak bit len features
Okm165 Aug 6, 2024
4ad091d
dockerfile fix
Okm165 Aug 14, 2024
90318d8
README update
Okm165 Aug 14, 2024
18140fa
Merge branch 'main' into stone6
Okm165 Aug 29, 2024
cb9c15c
rm proof verification workflow
Okm165 Aug 29, 2024
579d8bc
proof parser dynamic layout support
Okm165 Aug 29, 2024
156217b
dynamic 8 interaction elems fix
Okm165 Aug 29, 2024
883b31b
BTreeMap for preserving order
Okm165 Aug 29, 2024
1a86f76
StaticLayoutTrait
Okm165 Aug 29, 2024
f79b182
dynamic params definition
Okm165 Aug 29, 2024
ae5fed9
DynamicParams struct parsing
Okm165 Aug 29, 2024
6f12aa8
dynamic wip
Okm165 Sep 1, 2024
9d37273
dynamic wip
Okm165 Sep 1, 2024
1b9c85e
dynamic wip
Okm165 Sep 1, 2024
9f60497
dynamic wip
Okm165 Sep 1, 2024
30c69b9
dynamic wip
Okm165 Sep 1, 2024
16b7b8a
dynamic wip
Okm165 Sep 1, 2024
462af9d
dynamic eval_composition_polynomial_inner
Okm165 Sep 1, 2024
840d616
dynamic eval_composition_polynomial_inner cleanup
Okm165 Sep 1, 2024
f7c1091
features cleanup
Okm165 Sep 1, 2024
efdb5c2
eval_oods_polynomial_inner
Okm165 Sep 1, 2024
d80aa02
eval_oods_polynomial_inner refactor
Okm165 Sep 1, 2024
55a0670
eval_oods_polynomial_inner finalized
Okm165 Sep 1, 2024
73a93bb
static + dynamic layout project structuring
Okm165 Sep 1, 2024
5fe3b56
GenericLayoutTrait for column values
Okm165 Sep 2, 2024
0f30d2e
dynamic layout verification works!
Okm165 Sep 2, 2024
1586873
layout & consts refactor & dynamic layout checks fixes
Okm165 Sep 2, 2024
ff79189
cleanup & refactor
Okm165 Sep 2, 2024
127f0b1
cleanup & refactor
Okm165 Sep 2, 2024
f3a5521
autogenerated::check_asserts init
Okm165 Sep 2, 2024
3bf72bc
proof parser standardized and refactored
Okm165 Sep 3, 2024
4647b60
rm cross deps
Okm165 Sep 3, 2024
7fc1220
crude impl
Okm165 Sep 3, 2024
816645e
clippy
Okm165 Sep 3, 2024
a53d65e
continuous_page_headers support
Okm165 Sep 3, 2024
f5966ad
README
Okm165 Sep 4, 2024
142a99b
cargo fixes
Okm165 Sep 4, 2024
f4e827a
check_asserts implemented
Okm165 Sep 5, 2024
26b498e
fmt
Okm165 Sep 5, 2024
a3965dd
clippy
Okm165 Sep 5, 2024
a6a9fe6
Merge pull request #37 from iosis-tech/proof_parser_standard
Okm165 Sep 5, 2024
46552c7
fmt
Okm165 Sep 6, 2024
ba4542a
Merge pull request #36 from iosis-tech/dynamic_layout_support
Okm165 Sep 6, 2024
8a60bc9
stone versions interchangable
Okm165 Sep 9, 2024
05ae699
fmt
Okm165 Sep 9, 2024
6476221
Merge branch 'dynamic_layout_support' into stone6
Okm165 Sep 9, 2024
5a293c2
Revert "rm proof verification workflow"
Okm165 Sep 9, 2024
78aab19
ci reborn
Okm165 Sep 9, 2024
4ad7dd1
no std build reduced to just blake2s_248_lsb
Okm165 Sep 9, 2024
96476c4
public memory test fix
Okm165 Sep 9, 2024
1b84cbd
features fixes & no_std fixes
Okm165 Sep 9, 2024
f69f4c4
Heap fix in no_std
Okm165 Sep 9, 2024
695d14c
README
Okm165 Sep 9, 2024
7f2039d
README
Okm165 Sep 9, 2024
4c2d254
verison 0.0.9 - dynamic layout & new stone version support
Okm165 Sep 9, 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
52 changes: 46 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Run tests
run: cargo test -rv

verify-proof:
verify-proofs-stone5-keccak-160-lsb:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -83,17 +83,57 @@ jobs:
${{ runner.os }}-cargo-build-

- name: Run verification
run: cargo run -r --bin swiftness --features ${{ matrix.layout }},keccak --no-default-features -- --proof ${{ env.PROOFS_DIR }}/${{ matrix.layout }}/cairo0_example_proof.json
run: cargo run -r --bin swiftness --features ${{ matrix.layout }},stone5,keccak_160_lsb --no-default-features -- --proof ${{ env.PROOFS_DIR }}/${{ matrix.layout }}/cairo0_stone5_example_proof.json
working-directory: ${{ env.WORKING_DIR }}

verify-proof-stone6-blake2s-248-lsb:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
layout: [ "dynamic" ]

env:
PROOFS_DIR: ${{ github.workspace }}/examples/proofs
WORKING_DIR: ${{ github.workspace }}/cli

steps:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Run verification
run: cargo run -r --bin swiftness --features ${{ matrix.layout }},stone6,blake2s_248_lsb --no-default-features -- --proof ${{ env.PROOFS_DIR }}/${{ matrix.layout }}/cairo0_stone6_example_proof.json
working-directory: ${{ env.WORKING_DIR }}

no-std-build:
runs-on: ubuntu-latest
needs: verify-proof
strategy:
fail-fast: false
matrix:
layout: ["starknet_with_keccak",]
hash: ["blake2s", "keccak"]
layout: ["dynamic"]
hash: ["blake2s_248_lsb"]
stone: ["stone5"]
target: ["armebv7r-none-eabi", "riscv64imac-unknown-none-elf", "aarch64-unknown-none-softfloat", "aarch64-unknown-none"]

env:
Expand Down Expand Up @@ -129,7 +169,7 @@ jobs:
working-directory: ${{ env.WORKING_DIR }}

- name: Build project
run: cargo build -r --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features --target ${{ matrix.target }}
run: cargo build -r --features ${{ matrix.layout }},${{ matrix.hash }},${{ matrix.stone }} --no-default-features --target ${{ matrix.target }}
working-directory: ${{ env.WORKING_DIR }}

- name: Print binary metadata
Expand Down
16 changes: 10 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ edition = "2021"
license-file = "LICENSE"
readme = "README.md"
repository = "https:/iosis-tech/swiftness"
version = "0.0.8"
version = "0.0.9"

[workspace.dependencies]
blake2 = { version = "0.10.6", default-features = false }
num-bigint = { version = "0.4.6", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.114", default-features = false }
serde_with = { version = "3.8.3", default-features = false, features = ["macros"] }
Expand All @@ -38,9 +39,9 @@ starknet-types-core = { version = "0.1.5", default-features = false }
thiserror = "1.0.61"
thiserror-no-std = "2.0.2"

swiftness_air = { path = "crates/air", default-features = false, version = "0.0.8" }
swiftness_commitment = { path = "crates/commitment", default-features = false, version = "0.0.8" }
swiftness_fri = { path = "crates/fri", default-features = false, version = "0.0.8" }
swiftness_pow = { path = "crates/pow", default-features = false, version = "0.0.8" }
swiftness_stark = { path = "crates/stark", default-features = false, version = "0.0.8" }
swiftness_transcript = { path = "crates/transcript", default-features = false, version = "0.0.8" }
swiftness_air = { path = "crates/air", default-features = false, version = "0.0.9" }
swiftness_commitment = { path = "crates/commitment", default-features = false, version = "0.0.9" }
swiftness_fri = { path = "crates/fri", default-features = false, version = "0.0.9" }
swiftness_pow = { path = "crates/pow", default-features = false, version = "0.0.9" }
swiftness_stark = { path = "crates/stark", default-features = false, version = "0.0.9" }
swiftness_transcript = { path = "crates/transcript", default-features = false, version = "0.0.9" }
54 changes: 15 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div align="center">

![Version](https://img.shields.io/badge/v0.0.8-green?style=flat-square&logo=git&logoColor=white&label=version)
![Version](https://img.shields.io/badge/v0.0.9-green?style=flat-square&logo=git&logoColor=white&label=version)
![Continuous Integration](https://img.shields.io/github/actions/workflow/status/iosis-tech/swiftness/ci.yml?style=flat-square&logo=githubactions&logoColor=white&label=Continuous%20Integration)

[![Crates.io Version](https://img.shields.io/crates/v/swiftness?style=flat-square&logo=lootcrate)](https://crates.io/crates/swiftness)
Expand All @@ -16,25 +16,8 @@ Swiftness is a Rust implementation of the Cairo-VM STARK verifier with layouts,
## Getting Started

### Verify an Example Proof

1. **Install `swiftness`:**

```sh
cargo install -f --path cli/ --features starknet_with_keccak,keccak --no-default-features
```

2. **Verify the proof:**

Ensure you use a proof corresponding to the layout and hash used to build the binary.

```sh
swiftness --proof examples/proofs/starknet_with_keccak/cairo0_example_proof.json
```

3. **Local Run:**

```sh
cd cli && cargo run --release --bin swiftness --features starknet_with_keccak,keccak --no-default-features -- --proof ../examples/proofs/starknet_with_keccak/cairo0_example_proof.json
cd cli && cargo run --release --bin swiftness --features starknet_with_keccak,keccak_160_lsb,stone5 --no-default-features -- --proof ../examples/proofs/starknet_with_keccak/cairo0_stone5_example_proof.json
```

## Running Tests
Expand All @@ -54,15 +37,11 @@ cargo test
2. **Build WASM:**

```sh
cd wasm_bindings && wasm-pack build --target web --features starknet_with_keccak,blake2s --no-default-features
cd wasm_bindings && wasm-pack build --target web --features recursive_with_poseidon,blake2s_248_lsb,stone5 --no-default-features
```

## Features

### Usage

- [x] CLI

### Implemented Layouts

- [x] dex
Expand All @@ -71,29 +50,26 @@ cargo test
- [x] small
- [x] starknet
- [x] starknet_with_keccak
- [x] dynamic

### Commitment Hashes

- [x] keccak
- [x] blake2s
- [x] keccak_160_lsb
- [x] keccak_248_lsb
- [x] blake2s_160_lsb
- [x] blake2s_248_lsb

### Stone Prover versions

- [x] Stone5
- [x] Stone6

### Web Support

- [x] WASM support
- [x] NO_STD support
- [x] [Web Demo](https://demo.swiftness.iosis.tech/)
- [x] NPM packages:
- [swiftness-dex-blake2s](https://www.npmjs.com/package/swiftness-dex-blake2s)
- [swiftness-dex-keccak](https://www.npmjs.com/package/swiftness-dex-keccak)
- [swiftness-recursive-blake2s](https://www.npmjs.com/package/swiftness-recursive-blake2s)
- [swiftness-recursive-keccak](https://www.npmjs.com/package/swiftness-recursive-keccak)
- [swiftness-recursive-with-poseidon-blake2s](https://www.npmjs.com/package/swiftness-recursive-with-poseidon-blake2s)
- [swiftness-recursive-with-poseidon-keccak](https://www.npmjs.com/package/swiftness-recursive-with-poseidon-keccak)
- [swiftness-small-blake2s](https://www.npmjs.com/package/swiftness-small-blake2s)
- [swiftness-small-keccak](https://www.npmjs.com/package/swiftness-small-keccak)
- [swiftness-starknet-blake2s](https://www.npmjs.com/package/swiftness-starknet-blake2s)
- [swiftness-starknet-keccak](https://www.npmjs.com/package/swiftness-starknet-keccak)
- [swiftness-starknet-with-keccak-blake2s](https://www.npmjs.com/package/swiftness-starknet-with-keccak-blake2s)
- [swiftness-starknet-with-keccak-keccak](https://www.npmjs.com/package/swiftness-starknet-with-keccak-keccak)
- [x] [NPM packages](https://www.npmjs.com/search?q=swiftness)

### Other Platforms Support

Expand Down
30 changes: 16 additions & 14 deletions cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading