Skip to content

Commit

Permalink
feat: v1.0.7-testnet (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctian1 authored Jun 14, 2024
2 parents 8c0f501 + d009b0d commit b35be42
Show file tree
Hide file tree
Showing 292 changed files with 6,466 additions and 4,138 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/target
Dockerfile*
.dockerignore
.git
.gitignore
examples
tests
sp1up
book
102 changes: 102 additions & 0 deletions .github/workflows/docker-publish-gnark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Source: https://raw.githubusercontent.com/foundry-rs/foundry/master/.github/workflows/docker-publish.yml
name: docker-gnark

on:
push:
tags:
- "v*.*.*"
schedule:
- cron: "0 0 * * *"
# Trigger without any parameters a proactive rebuild
workflow_dispatch:
inputs:
tags:
description: "Docker tag to push"
required: true
workflow_call:

env:
REGISTRY: ghcr.io
IMAGE_NAME: succinctlabs/sp1-gnark

jobs:
container:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow
permissions:
id-token: write
packages: write
contents: read
timeout-minutes: 120
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4

- name: Install Docker BuildX
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# Ensure this doesn't trigger on PR's
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Creates an additional 'latest' or 'nightly' tag
# If the job is triggered via cron schedule, tag nightly and nightly-{SHA}
# If the job is triggered via workflow dispatch and on a master branch, tag branch and latest
# Otherwise, just tag as the branch name
- name: Finalize Docker Metadata
id: docker_tagging
run: |
if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then
echo "manual trigger from workflow_dispatch, assigning tag ${{ github.event.inputs.tags }}"
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tags }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == 'schedule' ]]; then
echo "cron trigger, assigning nightly tag"
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
else
echo "Neither scheduled nor manual release from main branch. Just tagging as branch name"
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
fi
# Log docker metadata to explicitly know what is being pushed
- name: Inspect Docker Metadata
run: |
echo "TAGS -> ${{ steps.docker_tagging.outputs.docker_tags }}"
echo "LABELS -> ${{ steps.meta.outputs.labels }}"
# Build and push Docker image
# https://github.com/docker/build-push-action
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.gnark-ffi
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_tagging.outputs.docker_tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
83 changes: 52 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,58 @@ on:
- ".github/workflows/**"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
plonk:
name: Plonk
runs-on: runs-on,cpu=64,ram=256,family=m7i+m7a,hdd=80,image=ubuntu22-full-x64
plonk:
name: Plonk Native
runs-on: runs-on,cpu=64,ram=256,family=m7i+m7a,hdd=80,image=ubuntu22-full-x64
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
toolchain: nightly-2024-04-17
args: --release -p sp1-sdk --features native-gnark -- test_e2e_prove_plonk --nocapture
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1
plonk-docker:
name: Plonk Docker
runs-on: runs-on,cpu=64,ram=256,family=m7i+m7a,hdd=80,image=ubuntu22-full-x64
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
toolchain: nightly-2024-04-17
args: --release -p sp1-sdk -- test_e2e_prove_plonk --nocapture
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
toolchain: nightly-2024-04-17
args: --release -p sp1-sdk --features plonk -- test_e2e_prove_plonk --nocapture
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1
check-branch:
name: Check branch
runs-on: ubuntu-latest
steps:
- name: Check branch
if: github.head_ref != 'dev'
run: |
echo "ERROR: You can only merge to main from dev."
exit 1
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1
check-branch:
name: Check branch
runs-on: ubuntu-latest
steps:
- name: Check branch
if: github.head_ref != 'dev'
run: |
echo "ERROR: You can only merge to main from dev."
exit 1
30 changes: 28 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
with:
command: test
toolchain: nightly-2024-04-17
args: --release --features plonk
args: --release --features native-gnark
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1
Expand Down Expand Up @@ -79,13 +79,38 @@ jobs:
with:
command: test
toolchain: nightly-2024-04-17
args: --release --features plonk
args: --release --features native-gnark
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1
FRI_QUERIES: 1
SP1_DEV: 1

test-docker:
name: Test Docker
runs-on: runs-on,runner=64cpu-linux-arm64
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup

- name: Build docker image
run: |
docker build -t sp1-gnark -f ./Dockerfile.gnark-ffi .
- name: Run cargo test
uses: actions-rs/cargo@v1
env:
SP1_GNARK_IMAGE: sp1-gnark
with:
command: test
toolchain: nightly-2024-04-17
args: --release -p sp1-prover -- --exact tests::test_e2e

lint:
name: Formatting & Clippy
runs-on: runs-on,runner=8cpu-linux-x64
Expand Down Expand Up @@ -178,5 +203,6 @@ jobs:
cargo add sp1-zkvm --path $GITHUB_WORKSPACE/zkvm/entrypoint
cargo prove build
cd ../script
cargo remove sp1-sdk
cargo add sp1-sdk --path $GITHUB_WORKSPACE/sdk
SP1_DEV=1 RUST_LOG=info cargo run --release
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pgo-data.profdata
.DS_Store

# Proofs
**/proof-with-pis.json
**/proof-with-io.json
**/proof-with-pis.bin
**/proof-with-io.bin

# Benchmark
benchmark.csv
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
// "examples/tendermint/script/Cargo.toml",
// // Tests.
// "examples/ed25519/Cargo.toml",
// "tests/blake3-compress/Cargo.toml",
// "tests/cycle-tracker/Cargo.toml",
// "tests/ecrecover/Cargo.toml",
// "tests/ed-add/Cargo.toml",
Expand Down
Loading

0 comments on commit b35be42

Please sign in to comment.