From 47910eb8391eefc364371ae257dc05036c5ff152 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Thu, 25 Jul 2024 23:19:03 +0200 Subject: [PATCH 1/8] proof_parser publish adjustments --- proof_parser/Cargo.toml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/proof_parser/Cargo.toml b/proof_parser/Cargo.toml index 0e58c48..8db1799 100644 --- a/proof_parser/Cargo.toml +++ b/proof_parser/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/iosis-tech/swiftness" version = "0.0.5" [features] -default = ["std", "keccak", "recursive"] +default = ["std"] std = [ "swiftness_air/std", "swiftness_commitment/std", @@ -17,14 +17,6 @@ std = [ "swiftness_stark/std", "swiftness_transcript/std", ] -dex = [] -recursive = [] -recursive_with_poseidon = [] -small = [] -starknet = [] -starknet_with_keccak = [] -keccak = [] -blake2s = [] [dependencies] @@ -37,9 +29,9 @@ clap = { version = "4.5.1", features = ["derive"] } regex = "1.10.3" serde_json = "1.0.114" -swiftness_air = { path = "../crates/air", default-features = false, version = "0.0.5" } -swiftness_commitment = { path = "../crates/commitment", default-features = false, version = "0.0.5" } -swiftness_fri = { path = "../crates/fri", default-features = false, version = "0.0.5" } -swiftness_pow = { path = "../crates/pow", default-features = false, version = "0.0.5" } -swiftness_stark = { path = "../crates/stark", default-features = false, version = "0.0.5" } -swiftness_transcript = { path = "../crates/transcript", default-features = false, version = "0.0.5" } +swiftness_air = { path = "../crates/air", version = "0.0.5" } +swiftness_commitment = { path = "../crates/commitment", version = "0.0.5" } +swiftness_fri = { path = "../crates/fri", version = "0.0.5" } +swiftness_pow = { path = "../crates/pow", version = "0.0.5" } +swiftness_stark = { path = "../crates/stark", version = "0.0.5" } +swiftness_transcript = { path = "../crates/transcript", version = "0.0.5" } From afbd14ad8005654e9f5333a161507211396d611c Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Thu, 25 Jul 2024 23:40:31 +0200 Subject: [PATCH 2/8] new publishing ci --- .github/workflows/cargo_publish.yaml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/cargo_publish.yaml diff --git a/.github/workflows/cargo_publish.yaml b/.github/workflows/cargo_publish.yaml new file mode 100644 index 0000000..e50e007 --- /dev/null +++ b/.github/workflows/cargo_publish.yaml @@ -0,0 +1,61 @@ +name: Manual Publish to Crates.io + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + + env: + WORKING_DIR: ${{ github.workspace }} + WORKING_DIR_CLI: ${{ github.workspace }}/cli + WORKING_DIR_PROOF_PARSER: ${{ github.workspace }}/proof_parser + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - 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: Install dependencies + run: cargo fetch + + - name: Run tests + run: cargo test --all + + - name: Publish crates to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + run: | + cargo publish -p swiftness_transcript --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml + cargo publish -p swiftness_pow --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml + cargo publish -p swiftness_commitment --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml + cargo publish -p swiftness_fri --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml + cargo publish -p swiftness_air --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml + cargo publish -p swiftness_stark --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR }}/Cargo.toml + cargo publish -p swiftness_proof_parser --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR_PROOF_PARSER }}/Cargo.toml + cargo publish -p swiftness --token $CARGO_REGISTRY_TOKEN --manifest-path ${{ env.WORKING_DIR_CLI }}/Cargo.toml From e675fe7e384cc1405926179daed7f2bcd5d34686 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 26 Jul 2024 12:19:52 +0200 Subject: [PATCH 3/8] style improvements --- README.md | 7 +++++++ cli/Cargo.toml | 2 +- wasm_bindings/README.md | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5de37f3..cc97316 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,17 @@ # Swiftness CairoVM Verifier +
+ ![Version](https://img.shields.io/badge/v0.0.5-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&link=https%3A%2F%2Fcrates.io%2Fcrates%2Fswiftness) +![docs.rs](https://img.shields.io/docsrs/swiftness?style=flat-square&logo=docsdotrs&link=https%3A%2F%2Fdocs.rs%2Fswiftness%2Flatest%2Fswiftness%2F) + +
Swiftness is a Rust implementation of the Cairo-VM STARK verifier with layouts, inspired by StarkWare's [Cairo-verifier](https://github.com/starkware-libs/cairo-lang) in Cairo0. + ## Getting Started ### Verify an Example Proof diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 762baa2..ec8fe9c 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swiftness" -description = "CLI toolkit to use Swiftness - Rust CairoVM Verifier implementation" +description = "Swiftness - Rust CairoVM Verifier implementation" edition = "2021" license-file = "LICENSE" readme = "../README.md" diff --git a/wasm_bindings/README.md b/wasm_bindings/README.md index 64f19c5..1511ca6 100644 --- a/wasm_bindings/README.md +++ b/wasm_bindings/README.md @@ -1,7 +1,13 @@ -# Swiftness CairoVM Verifier (WASM Support) +# Swiftness CairoVM Verifier + +
![Version](https://img.shields.io/badge/v0.0.5-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&link=https%3A%2F%2Fcrates.io%2Fcrates%2Fswiftness) +![docs.rs](https://img.shields.io/docsrs/swiftness?style=flat-square&logo=docsdotrs&link=https%3A%2F%2Fdocs.rs%2Fswiftness%2Flatest%2Fswiftness%2F) + +
Swiftness is a Rust implementation of the Cairo-VM STARK verifier with layouts, inspired by StarkWare's [Cairo-verifier](https://github.com/starkware-libs/cairo-lang) in Cairo0. From d5d4d7dff3bd3cd6b5ad091a0a1cf6667967308e Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 26 Jul 2024 12:23:57 +0200 Subject: [PATCH 4/8] fmt --- .github/workflows/cargo_publish.yaml | 4 ++-- .github/workflows/npm_publish.yaml | 20 ++++++++++++++------ proof_parser/README.md | 2 +- wasm_bindings/README.md | 10 ++++++---- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cargo_publish.yaml b/.github/workflows/cargo_publish.yaml index e50e007..1e0151f 100644 --- a/.github/workflows/cargo_publish.yaml +++ b/.github/workflows/cargo_publish.yaml @@ -32,7 +32,7 @@ jobs: key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-registry- - + - name: Cache Cargo build uses: actions/cache@v2 with: @@ -40,7 +40,7 @@ jobs: key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-build- - + - name: Install dependencies run: cargo fetch diff --git a/.github/workflows/npm_publish.yaml b/.github/workflows/npm_publish.yaml index 1b6baae..a94ba18 100644 --- a/.github/workflows/npm_publish.yaml +++ b/.github/workflows/npm_publish.yaml @@ -13,7 +13,15 @@ jobs: strategy: fail-fast: false matrix: - layout: ["dex", "recursive", "recursive_with_poseidon", "small", "starknet", "starknet_with_keccak"] + layout: + [ + "dex", + "recursive", + "recursive_with_poseidon", + "small", + "starknet", + "starknet_with_keccak", + ] hash: ["blake2s", "keccak"] steps: @@ -23,7 +31,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '18' # specify your desired Node.js version + node-version: "18" # specify your desired Node.js version - name: Configure npm run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} @@ -38,7 +46,7 @@ jobs: key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-registry- - + - name: Cache Cargo build uses: actions/cache@v2 with: @@ -46,14 +54,14 @@ jobs: key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-build- - + - name: Install wasm-pack run: cargo install wasm-pack - + - name: Build package run: wasm-pack build --out-dir pkg --target web --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features working-directory: ${{ env.WORKING_DIR }} - + - name: Rename package run: | jq --arg layout "${{ matrix.layout }}" --arg hash "${{ matrix.hash }}" \ diff --git a/proof_parser/README.md b/proof_parser/README.md index 7d4e2bc..63601c7 100644 --- a/proof_parser/README.md +++ b/proof_parser/README.md @@ -1 +1 @@ -# Swiftness Proof Parser CairoVM Verifier \ No newline at end of file +# Swiftness Proof Parser CairoVM Verifier diff --git a/wasm_bindings/README.md b/wasm_bindings/README.md index 1511ca6..c43b2fd 100644 --- a/wasm_bindings/README.md +++ b/wasm_bindings/README.md @@ -14,12 +14,14 @@ Swiftness is a Rust implementation of the Cairo-VM STARK verifier with layouts, ## Example Usage ```js -import init, { verify_proof } from 'swiftness-{layout}-{commitment hash}'; +import init, { verify_proof } from "swiftness-{layout}-{commitment hash}"; async function run(proof_json) { - await init(); // Initialize the Wasm module + await init(); // Initialize the Wasm module try { - const [programHash, programOutput] = JSON.parse(await verify_proof(proof_json)); + const [programHash, programOutput] = JSON.parse( + await verify_proof(proof_json), + ); } catch (err) { console.error(`Verification failed: ${err}`); } @@ -28,4 +30,4 @@ async function run(proof_json) { ## Contributing -Contributions are welcome! Feel free to open issues or submit pull requests to help improve this project. \ No newline at end of file +Contributions are welcome! Feel free to open issues or submit pull requests to help improve this project. From 6348c64553f5e5f3822f8fb84a523287a0ab4dbf Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 26 Jul 2024 13:34:02 +0200 Subject: [PATCH 5/8] docker publish --- .dockerignore | 36 + .github/workflows/docker_publish.yaml | 39 ++ Dockerfile | 11 - cli/Cargo.toml | 12 +- proof_parser/Cargo.lock | 971 ++++++++++++++++++++++++++ proof_parser/Cargo.toml | 22 +- runtime.dockerfile | 17 + 7 files changed, 1088 insertions(+), 20 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/docker_publish.yaml delete mode 100644 Dockerfile create mode 100644 proof_parser/Cargo.lock create mode 100644 runtime.dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..189c7b3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,36 @@ +# Ignore the entire target directory, as it's used for build artifacts +/target + +# Ignore any generated documentation +/doc + +# Ignore temporary files +*.rs.bk +*.rs.swp +*.rs.swo + +# Ignore build scripts output +/build.rs + +# Ignore files for specific editors or IDEs +*.iml +*.idea +.vscode +*.swp + +# Ignore OS generated files +.DS_Store +Thumbs.db + +# Ignore backup and log files +*.log +*.bak +*.tmp +*.old +*.swp + +# Ignore git-related files +.git +.gitignore + +Dockerfile \ No newline at end of file diff --git a/.github/workflows/docker_publish.yaml b/.github/workflows/docker_publish.yaml new file mode 100644 index 0000000..6a7421a --- /dev/null +++ b/.github/workflows/docker_publish.yaml @@ -0,0 +1,39 @@ +name: Publish Docker Image + +on: + workflow_dispatch: + inputs: + version: + description: "Docker image version" + required: true + default: "latest" + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest + driver: docker-container + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + file: runtime.dockerfile + tags: "okm165/swiftness:${{ github.event.inputs.version }}" + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + build-args: | + FEATURES=starknet_with_keccak,blake2s diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index bf006bf..0000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Use the official Rust image from Docker Hub -FROM rust:1.79.0-slim - -# Set the working directory inside the container -WORKDIR /builder - -# Copy the project files into the container -COPY . . - -# Build the Rust project with optimizations -RUN cargo build --release \ No newline at end of file diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ec8fe9c..995eb60 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -34,5 +34,13 @@ starknet_with_keccak = [ "swiftness_air/starknet_with_keccak", "swiftness_stark/starknet_with_keccak", ] -keccak = ["swiftness_stark/keccak"] -blake2s = ["swiftness_stark/blake2s"] +keccak = [ + "swiftness_air/keccak", + "swiftness_stark/keccak", + "swiftness_proof_parser/keccak" +] +blake2s = [ + "swiftness_air/blake2s", + "swiftness_stark/blake2s", + "swiftness_proof_parser/blake2s" +] diff --git a/proof_parser/Cargo.lock b/proof_parser/Cargo.lock new file mode 100644 index 0000000..d20d4b4 --- /dev/null +++ b/proof_parser/Cargo.lock @@ -0,0 +1,971 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "clap" +version = "4.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.72", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lambdaworks-crypto" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb5d4f22241504f7c7b8d2c3a7d7835d7c07117f10bff2a7d96a9ef6ef217c3" +dependencies = [ + "lambdaworks-math", + "serde", + "sha2", + "sha3", +] + +[[package]] +name = "lambdaworks-math" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358e172628e713b80a530a59654154bfc45783a6ed70ea284839800cebdf8f97" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "serde_json" +version = "1.0.120" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_json_pythonic" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62212da9872ca2a0cad0093191ee33753eddff9266cbbc1b4a602d13a3a768db" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "serde", + "serde_json", + "serde_with_macros 2.3.3", + "time", +] + +[[package]] +name = "serde_with" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros 3.9.0", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "serde_with_macros" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "starknet-core" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d506e02a4083290d13b427dfe437fd95aa8b56315c455bb2f9cdeca76620d457" +dependencies = [ + "base64 0.21.7", + "crypto-bigint", + "flate2", + "hex", + "serde", + "serde_json", + "serde_json_pythonic", + "serde_with 2.3.3", + "sha3", + "starknet-crypto", + "starknet-types-core", +] + +[[package]] +name = "starknet-crypto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2a821ad8d98c6c3e4d0e5097f3fe6e2ed120ada9d32be87cd1330c7923a2f0" +dependencies = [ + "crypto-bigint", + "hex", + "hmac", + "num-bigint", + "num-integer", + "num-traits", + "rfc6979", + "sha2", + "starknet-crypto-codegen", + "starknet-curve", + "starknet-types-core", + "zeroize", +] + +[[package]] +name = "starknet-crypto-codegen" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e179dedc3fa6da064e56811d3e05d446aa2f7459e4eb0e3e49378a337235437" +dependencies = [ + "starknet-curve", + "starknet-types-core", + "syn 2.0.72", +] + +[[package]] +name = "starknet-curve" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56935b306dcf0b8f14bb2a1257164b8478bb8be4801dfae0923f5b266d1b457c" +dependencies = [ + "starknet-types-core", +] + +[[package]] +name = "starknet-types-core" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6bacf0ba19bc721e518bc4bf389ff13daa8a7c5db5fd320600473b8aa9fcbd" +dependencies = [ + "lambdaworks-crypto", + "lambdaworks-math", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "swiftness_air" +version = "0.0.5" +dependencies = [ + "serde", + "serde_with 3.9.0", + "starknet-core", + "starknet-crypto", + "swiftness_commitment", + "swiftness_transcript", + "thiserror", + "thiserror-no-std", +] + +[[package]] +name = "swiftness_commitment" +version = "0.0.5" +dependencies = [ + "blake2", + "serde", + "serde_with 3.9.0", + "sha3", + "starknet-core", + "starknet-crypto", + "starknet-types-core", + "swiftness_transcript", + "thiserror", + "thiserror-no-std", +] + +[[package]] +name = "swiftness_fri" +version = "0.0.5" +dependencies = [ + "serde", + "serde_with 3.9.0", + "sha3", + "starknet-core", + "starknet-crypto", + "swiftness_commitment", + "swiftness_transcript", + "thiserror", + "thiserror-no-std", +] + +[[package]] +name = "swiftness_pow" +version = "0.0.5" +dependencies = [ + "blake2", + "serde", + "sha3", + "starknet-crypto", + "starknet-types-core", + "swiftness_transcript", + "thiserror", + "thiserror-no-std", +] + +[[package]] +name = "swiftness_proof_parser" +version = "0.0.5" +dependencies = [ + "anyhow", + "clap", + "num-bigint", + "regex", + "serde", + "serde_json", + "starknet-types-core", + "swiftness_air", + "swiftness_commitment", + "swiftness_fri", + "swiftness_pow", + "swiftness_stark", + "swiftness_transcript", + "thiserror", +] + +[[package]] +name = "swiftness_stark" +version = "0.0.5" +dependencies = [ + "serde", + "serde_with 3.9.0", + "starknet-core", + "starknet-crypto", + "swiftness_air", + "swiftness_commitment", + "swiftness_fri", + "swiftness_pow", + "swiftness_transcript", + "thiserror", + "thiserror-no-std", +] + +[[package]] +name = "swiftness_transcript" +version = "0.0.5" +dependencies = [ + "starknet-crypto", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "thiserror-impl-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58e6318948b519ba6dc2b442a6d0b904ebfb8d411a3ad3e07843615a72249758" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "thiserror-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ad459d94dd517257cc96add8a43190ee620011bb6e6cdc82dafd97dfafafea" +dependencies = [ + "thiserror-impl-no-std", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/proof_parser/Cargo.toml b/proof_parser/Cargo.toml index 8db1799..e1f5d05 100644 --- a/proof_parser/Cargo.toml +++ b/proof_parser/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/iosis-tech/swiftness" version = "0.0.5" [features] -default = ["std"] +default = ["std", "keccak"] std = [ "swiftness_air/std", "swiftness_commitment/std", @@ -17,6 +17,14 @@ std = [ "swiftness_stark/std", "swiftness_transcript/std", ] +keccak = [ + "swiftness_pow/keccak", + "swiftness_commitment/keccak", +] +blake2s = [ + "swiftness_pow/blake2s", + "swiftness_commitment/blake2s", +] [dependencies] @@ -29,9 +37,9 @@ clap = { version = "4.5.1", features = ["derive"] } regex = "1.10.3" serde_json = "1.0.114" -swiftness_air = { path = "../crates/air", version = "0.0.5" } -swiftness_commitment = { path = "../crates/commitment", version = "0.0.5" } -swiftness_fri = { path = "../crates/fri", version = "0.0.5" } -swiftness_pow = { path = "../crates/pow", version = "0.0.5" } -swiftness_stark = { path = "../crates/stark", version = "0.0.5" } -swiftness_transcript = { path = "../crates/transcript", version = "0.0.5" } +swiftness_air = { path = "../crates/air", default-features = false, version = "0.0.5" } +swiftness_commitment = { path = "../crates/commitment", default-features = false, version = "0.0.5" } +swiftness_fri = { path = "../crates/fri", default-features = false, version = "0.0.5" } +swiftness_pow = { path = "../crates/pow", default-features = false, version = "0.0.5" } +swiftness_stark = { path = "../crates/stark", default-features = false, version = "0.0.5" } +swiftness_transcript = { path = "../crates/transcript", default-features = false, version = "0.0.5" } diff --git a/runtime.dockerfile b/runtime.dockerfile new file mode 100644 index 0000000..abad2df --- /dev/null +++ b/runtime.dockerfile @@ -0,0 +1,17 @@ +# Use the official Rust image from Docker Hub +FROM rust:1.79.0-slim + +# Set the working directory inside the container +WORKDIR /swiftness + +# Copy the project files into the container +COPY . . + +# Build the Rust project with optimizations +RUN cargo build --release + +# Define build arguments for features +ARG FEATURES="starknet_with_keccak,blake2s" + +# Use the build arguments in the cargo install command +RUN cargo install -f --path cli/ --features $FEATURES --no-default-features \ No newline at end of file From 8d7588e9af8303018dcc4668b2e90e55aea0566d Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 26 Jul 2024 14:41:07 +0200 Subject: [PATCH 6/8] matrix docker build --- .github/workflows/docker_publish.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_publish.yaml b/.github/workflows/docker_publish.yaml index 6a7421a..96b503a 100644 --- a/.github/workflows/docker_publish.yaml +++ b/.github/workflows/docker_publish.yaml @@ -12,6 +12,20 @@ jobs: build-and-push: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + layout: + [ + "dex", + "recursive", + "recursive_with_poseidon", + "small", + "starknet", + "starknet_with_keccak", + ] + hash: ["blake2s", "keccak"] + steps: - name: Checkout code uses: actions/checkout@v2 @@ -36,4 +50,4 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true build-args: | - FEATURES=starknet_with_keccak,blake2s + FEATURES=${{ matrix.layout }},${{ matrix.hash }} From 66d4a3a9bdd54cabddedbf35d3e1d4ebf8ed8fc9 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 26 Jul 2024 15:18:38 +0200 Subject: [PATCH 7/8] docker image --- runtime.dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/runtime.dockerfile b/runtime.dockerfile index abad2df..177f1ba 100644 --- a/runtime.dockerfile +++ b/runtime.dockerfile @@ -7,9 +7,6 @@ WORKDIR /swiftness # Copy the project files into the container COPY . . -# Build the Rust project with optimizations -RUN cargo build --release - # Define build arguments for features ARG FEATURES="starknet_with_keccak,blake2s" From b2ff642126a25c163f31d227073bcb0d3cba4ac5 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Fri, 26 Jul 2024 15:48:59 +0200 Subject: [PATCH 8/8] readme updates --- README.md | 2 ++ wasm_bindings/README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index cc97316..e09204c 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ ![Version](https://img.shields.io/badge/v0.0.5-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&link=https%3A%2F%2Fcrates.io%2Fcrates%2Fswiftness) ![docs.rs](https://img.shields.io/docsrs/swiftness?style=flat-square&logo=docsdotrs&link=https%3A%2F%2Fdocs.rs%2Fswiftness%2Flatest%2Fswiftness%2F) +![hub.docker](https://img.shields.io/docker/pulls/okm165/swiftness?style=flat-square&logo=docker&logoColor=white&label=docker&link=https%3A%2F%2Fhub.docker.com%2Frepository%2Fdocker%2Fokm165%2Fswiftness%2Fgeneral) diff --git a/wasm_bindings/README.md b/wasm_bindings/README.md index c43b2fd..0f9bfe2 100644 --- a/wasm_bindings/README.md +++ b/wasm_bindings/README.md @@ -4,8 +4,10 @@ ![Version](https://img.shields.io/badge/v0.0.5-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&link=https%3A%2F%2Fcrates.io%2Fcrates%2Fswiftness) ![docs.rs](https://img.shields.io/docsrs/swiftness?style=flat-square&logo=docsdotrs&link=https%3A%2F%2Fdocs.rs%2Fswiftness%2Flatest%2Fswiftness%2F) +![hub.docker](https://img.shields.io/docker/pulls/okm165/swiftness?style=flat-square&logo=docker&logoColor=white&label=docker&link=https%3A%2F%2Fhub.docker.com%2Frepository%2Fdocker%2Fokm165%2Fswiftness%2Fgeneral)