Skip to content

Commit b35be42

Browse files
authored
feat: v1.0.7-testnet (#935)
2 parents 8c0f501 + d009b0d commit b35be42

292 files changed

Lines changed: 6466 additions & 4138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/target
2+
Dockerfile*
3+
.dockerignore
4+
.git
5+
.gitignore
6+
examples
7+
tests
8+
sp1up
9+
book
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Source: https://raw.githubusercontent.com/foundry-rs/foundry/master/.github/workflows/docker-publish.yml
2+
name: docker-gnark
3+
4+
on:
5+
push:
6+
tags:
7+
- "v*.*.*"
8+
schedule:
9+
- cron: "0 0 * * *"
10+
# Trigger without any parameters a proactive rebuild
11+
workflow_dispatch:
12+
inputs:
13+
tags:
14+
description: "Docker tag to push"
15+
required: true
16+
workflow_call:
17+
18+
env:
19+
REGISTRY: ghcr.io
20+
IMAGE_NAME: succinctlabs/sp1-gnark
21+
22+
jobs:
23+
container:
24+
runs-on: ubuntu-latest
25+
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow
26+
permissions:
27+
id-token: write
28+
packages: write
29+
contents: read
30+
timeout-minutes: 120
31+
steps:
32+
- name: Checkout repository
33+
id: checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Install Docker BuildX
37+
uses: docker/setup-buildx-action@v2
38+
id: buildx
39+
with:
40+
install: true
41+
42+
# Login against a Docker registry except on PR
43+
# https://github.com/docker/login-action
44+
- name: Log into registry ${{ env.REGISTRY }}
45+
# Ensure this doesn't trigger on PR's
46+
if: github.event_name != 'pull_request'
47+
uses: docker/login-action@v2
48+
with:
49+
registry: ${{ env.REGISTRY }}
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
# Extract metadata (tags, labels) for Docker
54+
# https://github.com/docker/metadata-action
55+
- name: Extract Docker metadata
56+
id: meta
57+
uses: docker/metadata-action@v4
58+
with:
59+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
60+
61+
# Creates an additional 'latest' or 'nightly' tag
62+
# If the job is triggered via cron schedule, tag nightly and nightly-{SHA}
63+
# If the job is triggered via workflow dispatch and on a master branch, tag branch and latest
64+
# Otherwise, just tag as the branch name
65+
- name: Finalize Docker Metadata
66+
id: docker_tagging
67+
run: |
68+
if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then
69+
echo "manual trigger from workflow_dispatch, assigning tag ${{ github.event.inputs.tags }}"
70+
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tags }}" >> $GITHUB_OUTPUT
71+
elif [[ "${{ github.event_name }}" == 'schedule' ]]; then
72+
echo "cron trigger, assigning nightly tag"
73+
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
74+
else
75+
echo "Neither scheduled nor manual release from main branch. Just tagging as branch name"
76+
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
77+
fi
78+
79+
# Log docker metadata to explicitly know what is being pushed
80+
- name: Inspect Docker Metadata
81+
run: |
82+
echo "TAGS -> ${{ steps.docker_tagging.outputs.docker_tags }}"
83+
echo "LABELS -> ${{ steps.meta.outputs.labels }}"
84+
85+
# Build and push Docker image
86+
# https://github.com/docker/build-push-action
87+
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md
88+
- name: Build and push Docker image
89+
uses: docker/build-push-action@v3
90+
with:
91+
context: .
92+
file: ./Dockerfile.gnark-ffi
93+
platforms: linux/amd64,linux/arm64
94+
push: true
95+
tags: ${{ steps.docker_tagging.outputs.docker_tags }}
96+
labels: ${{ steps.meta.outputs.labels }}
97+
cache-from: type=gha
98+
cache-to: type=gha,mode=max
99+
build-args: |
100+
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
101+
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
102+
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}

.github/workflows/main.yml

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,58 @@ on:
1414
- ".github/workflows/**"
1515

1616
concurrency:
17-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18-
cancel-in-progress: true
17+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: true
1919

2020
jobs:
21-
plonk:
22-
name: Plonk
23-
runs-on: runs-on,cpu=64,ram=256,family=m7i+m7a,hdd=80,image=ubuntu22-full-x64
21+
plonk:
22+
name: Plonk Native
23+
runs-on: runs-on,cpu=64,ram=256,family=m7i+m7a,hdd=80,image=ubuntu22-full-x64
24+
env:
25+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
26+
steps:
27+
- name: Checkout sources
28+
uses: actions/checkout@v4
29+
30+
- name: Setup CI
31+
uses: ./.github/actions/setup
32+
33+
- name: Run cargo test
34+
uses: actions-rs/cargo@v1
35+
with:
36+
command: test
37+
toolchain: nightly-2024-04-17
38+
args: --release -p sp1-sdk --features native-gnark -- test_e2e_prove_plonk --nocapture
39+
env:
40+
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
41+
RUST_BACKTRACE: 1
42+
plonk-docker:
43+
name: Plonk Docker
44+
runs-on: runs-on,cpu=64,ram=256,family=m7i+m7a,hdd=80,image=ubuntu22-full-x64
45+
env:
46+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
47+
steps:
48+
- name: Checkout sources
49+
uses: actions/checkout@v4
50+
51+
- name: Setup CI
52+
uses: ./.github/actions/setup
53+
54+
- name: Run cargo test
55+
uses: actions-rs/cargo@v1
56+
with:
57+
command: test
58+
toolchain: nightly-2024-04-17
59+
args: --release -p sp1-sdk -- test_e2e_prove_plonk --nocapture
2460
env:
25-
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
26-
steps:
27-
- name: Checkout sources
28-
uses: actions/checkout@v4
29-
30-
- name: Setup CI
31-
uses: ./.github/actions/setup
32-
33-
- name: Run cargo test
34-
uses: actions-rs/cargo@v1
35-
with:
36-
command: test
37-
toolchain: nightly-2024-04-17
38-
args: --release -p sp1-sdk --features plonk -- test_e2e_prove_plonk --nocapture
39-
env:
40-
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
41-
RUST_BACKTRACE: 1
42-
check-branch:
43-
name: Check branch
44-
runs-on: ubuntu-latest
45-
steps:
46-
- name: Check branch
47-
if: github.head_ref != 'dev'
48-
run: |
49-
echo "ERROR: You can only merge to main from dev."
50-
exit 1
61+
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
62+
RUST_BACKTRACE: 1
63+
check-branch:
64+
name: Check branch
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Check branch
68+
if: github.head_ref != 'dev'
69+
run: |
70+
echo "ERROR: You can only merge to main from dev."
71+
exit 1

.github/workflows/pr.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
with:
4949
command: test
5050
toolchain: nightly-2024-04-17
51-
args: --release --features plonk
51+
args: --release --features native-gnark
5252
env:
5353
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
5454
RUST_BACKTRACE: 1
@@ -79,13 +79,38 @@ jobs:
7979
with:
8080
command: test
8181
toolchain: nightly-2024-04-17
82-
args: --release --features plonk
82+
args: --release --features native-gnark
8383
env:
8484
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
8585
RUST_BACKTRACE: 1
8686
FRI_QUERIES: 1
8787
SP1_DEV: 1
8888

89+
test-docker:
90+
name: Test Docker
91+
runs-on: runs-on,runner=64cpu-linux-arm64
92+
env:
93+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
94+
steps:
95+
- name: Checkout sources
96+
uses: actions/checkout@v4
97+
98+
- name: Setup CI
99+
uses: ./.github/actions/setup
100+
101+
- name: Build docker image
102+
run: |
103+
docker build -t sp1-gnark -f ./Dockerfile.gnark-ffi .
104+
105+
- name: Run cargo test
106+
uses: actions-rs/cargo@v1
107+
env:
108+
SP1_GNARK_IMAGE: sp1-gnark
109+
with:
110+
command: test
111+
toolchain: nightly-2024-04-17
112+
args: --release -p sp1-prover -- --exact tests::test_e2e
113+
89114
lint:
90115
name: Formatting & Clippy
91116
runs-on: runs-on,runner=8cpu-linux-x64
@@ -178,5 +203,6 @@ jobs:
178203
cargo add sp1-zkvm --path $GITHUB_WORKSPACE/zkvm/entrypoint
179204
cargo prove build
180205
cd ../script
206+
cargo remove sp1-sdk
181207
cargo add sp1-sdk --path $GITHUB_WORKSPACE/sdk
182208
SP1_DEV=1 RUST_LOG=info cargo run --release

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pgo-data.profdata
1212
.DS_Store
1313

1414
# Proofs
15-
**/proof-with-pis.json
16-
**/proof-with-io.json
15+
**/proof-with-pis.bin
16+
**/proof-with-io.bin
1717

1818
# Benchmark
1919
benchmark.csv

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
// "examples/tendermint/script/Cargo.toml",
4141
// // Tests.
4242
// "examples/ed25519/Cargo.toml",
43-
// "tests/blake3-compress/Cargo.toml",
4443
// "tests/cycle-tracker/Cargo.toml",
4544
// "tests/ecrecover/Cargo.toml",
4645
// "tests/ed-add/Cargo.toml",

0 commit comments

Comments
 (0)