Skip to content

Commit

Permalink
Merge pull request #4 from zkmopro/feat/isolating-msm-functions
Browse files Browse the repository at this point in the history
init: isolated all the msm out of mopro-core and make it a crate
  • Loading branch information
FoodChain1028 authored Jul 4, 2024
2 parents e4bc5f2 + 14eb28a commit bef26a6
Show file tree
Hide file tree
Showing 413 changed files with 925 additions and 50,949 deletions.
130 changes: 3 additions & 127 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,124 +17,12 @@ env:
jobs:
# TODO: Add a job to run clippy
lint:
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check template formating
run: cd templates/mopro-example-app && cargo fmt --all -- --check

test-cli:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.77"
override: true
- name: Install circom
run: |
sudo wget -O ~/.cargo/bin/circom https://github.com/iden3/circom/releases/download/v2.1.9/circom-${{runner.os}}-amd64
sudo chmod +x ~/.cargo/bin/circom
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install snarkjs
run: npm install -g snarkjs
- name: Install mopro-cli
run: (cd mopro-cli && cargo install --path .)
- name: Prepare CI for Core and FFI
run: ./scripts/prepare_ci.sh
- name: Use mopro-cli
run: |
export MOPRO_ROOT=$(PWD) # Export MOPRO_ROOT path
mopro deps # Install mopro dependencies
mopro init --platforms ios android # Initialize mopro-example-app
cd mopro-example-app
mopro prepare # Prepare your circuit artifacts
mopro build --platforms ios android # Build the project
mopro test # Run end-to-end test (in Rust only)
- name: Test the project for iOS
run: |
cd mopro-example-app/ios/ExampleApp
xcodebuild test -scheme ExampleApp -workspace ExampleApp.xcworkspace -destination "platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro" -quiet
- name: Export bindings
run: |
export MOPRO_ROOT=$(PWD) # Export MOPRO_ROOT path
cd mopro-example-app
mopro export-bindings --platforms ios android --destination out
test-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.77"
override: true
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install circom
run: |
sudo wget -O ~/.cargo/bin/circom https://github.com/iden3/circom/releases/download/v2.1.9/circom-${{runner.os}}-amd64
sudo chmod +x ~/.cargo/bin/circom
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install snarkjs
run: npm install -g snarkjs
- name: Prepare CI for Core and FFI
run: ./scripts/prepare_ci.sh
- name: Run circom tests
run: |
cd mopro-core
cargo test -- --nocapture
- name: Run halo2 tests
run: |
cd mopro-core
cargo test --features=halo2 --no-default-features -- --nocapture
test-ffi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.77"
override: true
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install circom
run: |
sudo wget -O ~/.cargo/bin/circom https://github.com/iden3/circom/releases/download/v2.1.9/circom-${{runner.os}}-amd64
sudo chmod +x ~/.cargo/bin/circom
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install snarkjs
run: npm install -g snarkjs
- name: Prepare CI for Core and FFI
run: ./scripts/prepare_ci.sh
- name: Run FFI circom tests
# TODO: Fix this custom jar thing
run: |
cd mopro-ffi/
curl -L https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar -o jna-5.13.0.jar
CLASSPATH=jna-5.13.0.jar cargo test -- --nocapture
- name: Run FFI halo2 tests
run: |
cd mopro-ffi/
cargo test --features halo2 --no-default-features -- halo2

gpu-benchmarks:
runs-on: macos-latest
steps:
Expand All @@ -146,19 +34,7 @@ jobs:
override: true
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install circom
run: |
sudo wget -O ~/.cargo/bin/circom https://github.com/iden3/circom/releases/download/v2.1.9/circom-${{runner.os}}-amd64
sudo chmod +x ~/.cargo/bin/circom
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install snarkjs
run: npm install -g snarkjs
- name: Prepare CI for Core and FFI
run: ./scripts/prepare_ci.sh
- name: Run GPU Benchmarks tests
run: |
cd mopro-core
cargo test --features=gpu-benchmarks test_msm_correctness -- --nocapture
cd mopro-msm
cargo test test_msm_correctness -- --nocapture
9 changes: 1 addition & 8 deletions .github/workflows/setup-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ jobs:
override: true
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install circom
run: |
sudo wget -O ~/.cargo/bin/circom https://github.com/iden3/circom/releases/download/v2.1.9/circom-macos-amd64
sudo chmod +x ~/.cargo/bin/circom
- name: Prepare CI for Core and FFI
run: ./scripts/prepare_ci.sh
- name: Build
run: cargo build
- name: Cache build
Expand All @@ -32,5 +26,4 @@ jobs:
key: ${{ github.sha }}-setup-macos
path: |
~/.cargo
./mopro-core/examples
36 changes: 0 additions & 36 deletions .github/workflows/setup-ubuntu.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.vscode
.DS_Store
target/
mopro-example-app
!templates/mopro-example-app
vectors/
graph.bin
Loading

0 comments on commit bef26a6

Please sign in to comment.