Skip to content

Commit

Permalink
feat: non-inclusion gnark circuits (#559)
Browse files Browse the repository at this point in the history
feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface
  • Loading branch information
sergeytimoshin authored and Swen committed Apr 8, 2024
1 parent 0230c0e commit 178ccea
Show file tree
Hide file tree
Showing 131 changed files with 7,005 additions and 3,775 deletions.
8 changes: 8 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
self-hosted-runner:
# Labels of self-hosted runner in array of strings.
labels:
- buildjet-16vcpu-ubuntu-2204
# Configuration variables in array of strings defined in your repository or
# organization. `null` means disabling configuration variables check.
# Empty array means no configuration variable is allowed.
config-variables: null
15 changes: 15 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint GitHub Actions workflows
on: [push, pull_request]

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash
66 changes: 0 additions & 66 deletions .github/workflows/e2e-tests.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@ on:
push:
branches:
- main
paths:
- "js/stateless.js/**"
- "js/compressed-token/**"
- ".github/workflows/js.yml"
pull_request:
branches:
- main
paths:
- "js/stateless.js/**"
- "js/compressed-token/**"
- ".github/workflows/js.yml"
types:
- opened
- synchronize
Expand All @@ -34,7 +26,6 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:

- name: Setup and build
uses: ./.github/actions/setup-and-build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/light-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
IFS=', ' read -r -a sub_tests <<< "${{ join(fromJSON(matrix['sub-tests']), ', ') }}"
for subtest in "${sub_tests[@]}"
do
npx nx run $subtest
npx nx run "$subtest"
done
- name: Log out
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/light-system-programs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
IFS=', ' read -r -a sub_tests <<< "${{ join(fromJSON(matrix['sub-tests']), ', ') }}"
for subtest in "${sub_tests[@]}"
do
npx nx run $subtest
npx nx run "$subtest"
done
cd programs/light && cargo test-sbf
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV"
- uses: actions/cache@v3
name: Setup pnpm cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Lint PR"

on:
pull_request:
branch:
branches:
- main
types:
- opened
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/prover-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Build artifacts
run: |
for cfgstr in "darwin amd64" "darwin arm64" "linux amd64" "windows amd64"; do
cfg=( $cfgstr )
export GOOS=${cfg[0]}
export GOARCH=${cfg[1]}
cfg=( "$cfgstr" )
export GOOS="${cfg[0]}"
export GOARCH="${cfg[1]}"
export CGO_ENABLED=0
go build -o prover-$GOOS-$GOARCH
go build -o prover-"$GOOS"-"$GOARCH"
done
- name: Create Release
uses: softprops/action-gh-release@v1
with:
Expand Down
39 changes: 29 additions & 10 deletions .github/workflows/prover-test.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
name: Test
on: push
name: Test gnark prover
on:
push:
branches:
- main
paths:
- "gnark-prover/**"
- ".github/workflows/prover-test.yml"
- ".github/workflows/prover-release.yml"
pull_request:
branches:
- main
paths:
- "gnark-prover/**"
- ".github/workflows/prover-test.yml"
- ".github/workflows/prover-release.yml"
types:
- opened
- synchronize
- reopened
- ready_for_review

jobs:
build-and-test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 600
runs-on: buildjet-16vcpu-ubuntu-2204
timeout-minutes: 2400
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: true

- name: Cache dependencies
uses: actions/cache@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: './gnark-prover/go.mod'
- name: Download prover keys

- name: Download keys
run: |
cd gnark-prover
./scripts/download_keys.sh
- name: Build
run: |
cd gnark-prover
go build
- name: Prover unit tests
- name: Unit tests
run: |
cd gnark-prover
go test ./prover
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:

- name: Install cargo-release
run: |
VERSION=$(curl --silent "https://api.github.com/repos/crate-ci/cargo-release/releases/latest" | jq -r .tag_name)
wget https://github.com/crate-ci/cargo-release/releases/download/$VERSION/cargo-release-$VERSION-x86_64-unknown-linux-gnu.tar.gz
tar -xzvf cargo-release-$VERSION-x86_64-unknown-linux-gnu.tar.gz --wildcards '*cargo-release' --strip-components=1
cp cargo-release $HOME/.cargo/bin
VERSION="$(curl --silent "https://api.github.com/repos/crate-ci/cargo-release/releases/latest" | jq -r .tag_name)"
wget https://github.com/crate-ci/cargo-release/releases/download/"$VERSION"/cargo-release-"$VERSION"-x86_64-unknown-linux-gnu.tar.gz
tar -xzvf cargo-release-"$VERSION"-x86_64-unknown-linux-gnu.tar.gz --wildcards '*cargo-release' --strip-components=1
cp cargo-release "$HOME"/.cargo/bin
- uses: cargo-bins/release-pr@v2
with:
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,36 @@ jobs:
- name: Extract crate name from tag
id: extract-crate
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
CRATE_NAME=$(echo $TAG_NAME | rev | cut -d'-' -f2- | rev)
TAG_NAME="${GITHUB_REF#refs/tags/}"
CRATE_NAME="$(echo "$TAG_NAME" | rev | cut -d'-' -f2- | rev)"
if [ "$CRATE_NAME" == *"light-merkle-tree-program"* ]; then
if [[ "$CRATE_NAME" == *"light-merkle-tree-program"* ]]; then
ARTIFACT="light_merkle_tree_program.so"
elif [ "$CRATE_NAME" == *"light-psp2in2out"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp2in2out"* ]]; then
ARTIFACT="light_psp2in2out.so"
elif [ "$CRATE_NAME" == *"light-psp10in2out"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp10in2out"* ]]; then
ARTIFACT="light_psp10in2out.so"
elif [ "$CRATE_NAME" == *"light-psp4in4out-app-storage"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp4in4out-app-storage"* ]]; then
ARTIFACT="light_psp4in4out_app_storage.so"
elif [ "$CRATE_NAME" == *"light-psp2in2out-storage"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp2in2out-storage"* ]]; then
ARTIFACT="light_psp2in2out_storage.so"
elif [ "$CRATE_NAME" == *"macro-circom"* ]; then
elif [[ "$CRATE_NAME" == *"macro-circom"* ]]; then
ARTIFACT="macro-circom"
fi
echo "crate=$CRATE_NAME" >> $GITHUB_OUTPUT
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
echo "crate=$CRATE_NAME" >> "$GITHUB_OUTPUT"
echo "artifact=$ARTIFACT" >> "$GITHUB_OUTPUT"
- name: Prepare artifacts
run: |
if [ "$CRATE_NAME" == *"light-merkle-tree-program"* ]; then
if [[ "$CRATE_NAME" == *"light-merkle-tree-program"* ]]; then
cp target/deploy/light_merkle_tree_program.so .
elif [ "$CRATE_NAME" == *"light-psp2in2out"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp2in2out"* ]]; then
cp target/deploy/light_psp2in2out.so .
elif [ "$CRATE_NAME" == *"light-psp10in2out"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp10in2out"* ]]; then
cp target/deploy/light_psp10in2out.so .
elif [ "$CRATE_NAME" == *"light-psp4in4out-app-storage"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp4in4out-app-storage"* ]]; then
cp target/deploy/light_psp4in4out_app_storage.so .
elif [ "$CRATE_NAME" == *"light-psp2in2out-storage"* ]; then
elif [[ "$CRATE_NAME" == *"light-psp2in2out-storage"* ]]; then
cp target/deploy/light_psp2in2out_storage.so .
fi
Expand All @@ -63,12 +63,12 @@ jobs:
with:
token: ${{ secrets.PAT_TOKEN }}
files: |
${{ steps.extract-crate.outputs.artifact }}
"${{ steps.extract-crate.outputs.artifact }}"
- name: Run cargo publish
# Skip macro-circom, it has a git dependency preventing it from publishing.
if: steps.extract-crate.outputs.crate != 'macro-circom'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
cargo publish -p ${{ steps.extract-crate.outputs.crate }} --token $CARGO_REGISTRY_TOKEN
cargo publish -p "${{ steps.extract-crate.outputs.crate }}" --token "$CARGO_REGISTRY_TOKEN"
Loading

0 comments on commit 178ccea

Please sign in to comment.