Skip to content

Commit

Permalink
Merge pull request #43 from iosis-tech/settings
Browse files Browse the repository at this point in the history
Settings object
  • Loading branch information
Okm165 authored Sep 26, 2024
2 parents 0dd95d8 + b9e11d0 commit 576052b
Show file tree
Hide file tree
Showing 24 changed files with 100 additions and 54 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/docker_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ jobs:
docker-build-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
Expand All @@ -46,8 +32,6 @@ jobs:
uses: docker/build-push-action@v5
with:
file: runtime.dockerfile
tags: "okm165/swiftness:${{ github.event.inputs.version }}-${{ matrix.layout }}-${{ matrix.hash }}"
tags: "okm165/swiftness:${{ github.event.inputs.version }}"
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
build-args: |
FEATURES=${{ matrix.layout }},${{ matrix.hash }}
24 changes: 20 additions & 4 deletions .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@ jobs:
layout:
[
"dex",
"dynamic",
"recursive",
"recursive_with_poseidon",
"small",
"starknet",
"starknet_with_keccak",
]
hash: ["blake2s", "keccak"]
hash:
[
"keccak_160_lsb",
"keccak_248_lsb",
"blake2s_160_lsb",
"blake2s_248_lsb",
]
stone:
[
"stone5",
"stone6",
]


steps:
- name: Checkout repository
Expand All @@ -32,6 +45,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "18"

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

- name: Configure npm
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
Expand Down Expand Up @@ -59,13 +75,13 @@ jobs:
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
run: wasm-pack build --out-dir pkg --target web --features ${{ matrix.layout }},${{ matrix.hash }},${{ matrix.stone }} --no-default-features
working-directory: ${{ env.WORKING_DIR }}

- name: Rename package
run: |
jq --arg layout "${{ matrix.layout }}" --arg hash "${{ matrix.hash }}" \
'.name = "swiftness-\($layout | gsub("_"; "-"))-\($hash | gsub("_"; "-"))"' \
jq --arg layout "${{ matrix.layout }}" --arg hash "${{ matrix.hash }}" --arg stone "${{ matrix.stone }}" \
'.name = "swiftness-\($layout | gsub("_"; "-"))-\($hash | gsub("_"; "-"))-\($stone | gsub("_"; "-"))"' \
package.json > tmp.json && mv tmp.json package.json
working-directory: ${{ env.WORKING_DIR }}/pkg

Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ edition = "2021"
license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/iosis-tech/swiftness"
version = "0.1.1"
version = "0.1.2"

[workspace.dependencies]
blake2 = { version = "0.10.6", default-features = false }
Expand All @@ -39,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.1.1" }
swiftness_commitment = { path = "crates/commitment", default-features = false, version = "0.1.1" }
swiftness_fri = { path = "crates/fri", default-features = false, version = "0.1.1" }
swiftness_pow = { path = "crates/pow", default-features = false, version = "0.1.1" }
swiftness_stark = { path = "crates/stark", default-features = false, version = "0.1.1" }
swiftness_transcript = { path = "crates/transcript", default-features = false, version = "0.1.1" }
swiftness_air = { path = "crates/air", default-features = false, version = "0.1.2" }
swiftness_commitment = { path = "crates/commitment", default-features = false, version = "0.1.2" }
swiftness_fri = { path = "crates/fri", default-features = false, version = "0.1.2" }
swiftness_pow = { path = "crates/pow", default-features = false, version = "0.1.2" }
swiftness_stark = { path = "crates/stark", default-features = false, version = "0.1.2" }
swiftness_transcript = { path = "crates/transcript", default-features = false, version = "0.1.2" }
2 changes: 1 addition & 1 deletion 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.1.1-green?style=flat-square&logo=git&logoColor=white&label=version)
![Version](https://img.shields.io/badge/v0.1.2-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 Down
14 changes: 7 additions & 7 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ edition = "2021"
license-file = "LICENSE"
readme = "../README.md"
repository = "https://github.com/iosis-tech/swiftness"
version = "0.1.1"
version = "0.1.2"

[dependencies]
clap = { version = "4.4.4", features = ["derive"] }

swiftness_air = { path = "../crates/air", default-features = false, features = [
"std",
], version = "0.1.1" }
], version = "0.1.2" }
swiftness_commitment = { path = "../crates/commitment", default-features = false, features = [
"std",
], version = "0.1.1" }
], version = "0.1.2" }
swiftness_fri = { path = "../crates/fri", default-features = false, features = [
"std",
], version = "0.1.1" }
], version = "0.1.2" }
swiftness_pow = { path = "../crates/pow", default-features = false, features = [
"std",
], version = "0.1.1" }
], version = "0.1.2" }
swiftness_stark = { path = "../crates/stark", default-features = false, features = [
"std",
], version = "0.1.1" }
swiftness_proof_parser = { path = "../proof_parser", version = "0.1.1" }
], version = "0.1.2" }
swiftness_proof_parser = { path = "../proof_parser", version = "0.1.2" }

[features]
default = ["recursive", "keccak_160_lsb", "stone5"]
Expand Down
2 changes: 1 addition & 1 deletion examples/no_std_build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "no_std_build"
version = "0.1.1"
version = "0.1.2"
edition = "2021"

[dependencies]
Expand Down
Git LFS file not shown
Git LFS file not shown
File renamed without changes.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
2 changes: 1 addition & 1 deletion proof_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/iosis-tech/swiftness"
version = "0.1.1"
version = "0.1.2"

[dependencies]
anyhow = "1.0.80"
Expand Down
18 changes: 14 additions & 4 deletions runtime.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ WORKDIR /swiftness
# Copy the project files into the container
COPY . .

# Define build arguments for features
ARG FEATURES="starknet_with_keccak,blake2s_160_lsb"
# Define environment variables for the different layouts, hashers, and stone versions
ENV LAYOUTS="dex recursive recursive_with_poseidon small starknet starknet_with_keccak dynamic"
ENV HASHERS="keccak_160_lsb keccak_248_lsb blake2s_160_lsb blake2s_248_lsb"
ENV STONES="stone5 stone6"

# Use the build arguments in the cargo install command
RUN cargo install -f --path cli/ --features $FEATURES --no-default-features
# Create a bash script for building and renaming all variants
RUN bash -c 'for layout in $LAYOUTS; do \
for hasher in $HASHERS; do \
for stone in $STONES; do \
echo "Building swiftness verifier with layout=$layout, hasher=$hasher, stone=$stone"; \
cargo install -f --path cli/ --no-default-features --features "${layout},${hasher},${stone}"; \
mv /usr/local/cargo/bin/swiftness /usr/local/bin/swiftness_${layout}_${hasher}_${stone}; \
done; \
done; \
done'
10 changes: 5 additions & 5 deletions wasm_bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ edition = "2021"
license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/iosis-tech/swiftness"
version = "0.1.1"
version = "0.1.2"

[dependencies]
serde_json = "1.0.114"
wasm-bindgen = "0.2"

swiftness = { path = "../cli", default-features = false, version = "0.1.1" }
swiftness = { path = "../cli", default-features = false, version = "0.1.2" }
swiftness_air = { path = "../crates/air", default-features = false, features = [
"std",
], version = "0.1.1" }
], version = "0.1.2" }
swiftness_stark = { path = "../crates/stark", default-features = false, features = [
"std",
], version = "0.1.1" }
swiftness_proof_parser = { path = "../proof_parser", version = "0.1.1" }
], version = "0.1.2" }
swiftness_proof_parser = { path = "../proof_parser", version = "0.1.2" }

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion wasm_bindings/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.1.1-green?style=flat-square&logo=git&logoColor=white&label=version)
![Version](https://img.shields.io/badge/v0.1.2-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 Down

0 comments on commit 576052b

Please sign in to comment.