From 64faf8b2de5edd69e60d14711f9b32f8af667396 Mon Sep 17 00:00:00 2001 From: nhtyy Date: Mon, 25 Nov 2024 10:01:18 -0800 Subject: [PATCH 1/7] chore: all feats, no feats, default feats top level workspace checks --- .github/workflows/pr.yml | 20 ++++++++++++++++++++ crates/core/executor/Cargo.toml | 2 +- crates/verifier/src/tests.rs | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 391d00322c..082b3bc16b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -146,6 +146,26 @@ jobs: env: CARGO_INCREMENTAL: 1 + - name: Check workspace no features + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets --no-default-features + + - name: Check workspace with default features + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets + + - name: Check workspace with all features + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets --all-features + + + examples: name: Examples runs-on: diff --git a/crates/core/executor/Cargo.toml b/crates/core/executor/Cargo.toml index 3c09170d6f..2cbf03a117 100644 --- a/crates/core/executor/Cargo.toml +++ b/crates/core/executor/Cargo.toml @@ -44,7 +44,7 @@ enum-map = { version = "2.7.3", features = ["serde"] } test-artifacts = { workspace = true, optional = true } [dev-dependencies] -sp1-zkvm = { workspace = true } +sp1-zkvm = { workspace = true, features = ["lib"] } [features] programs = ["dep:test-artifacts"] diff --git a/crates/verifier/src/tests.rs b/crates/verifier/src/tests.rs index c6d9a853c6..f33500875d 100644 --- a/crates/verifier/src/tests.rs +++ b/crates/verifier/src/tests.rs @@ -1,6 +1,8 @@ +#[cfg(feature = "std")] use sp1_sdk::{install::try_install_circuit_artifacts, SP1ProofWithPublicValues}; #[test] +#[cfg(feature = "std")] fn test_verify_groth16() { // Location of the serialized SP1ProofWithPublicValues. See README.md for more information. let proof_file = "test_binaries/fibonacci-groth16.bin"; @@ -19,6 +21,7 @@ fn test_verify_groth16() { } #[test] +#[cfg(feature = "std")] fn test_verify_plonk() { // Location of the serialized SP1ProofWithPublicValues. See README.md for more information. let proof_file = "test_binaries/fibonacci-plonk.bin"; @@ -37,6 +40,7 @@ fn test_verify_plonk() { } #[test] +#[cfg(feature = "std")] fn test_vkeys() { let groth16_path = try_install_circuit_artifacts("groth16"); let s3_vkey_path = groth16_path.join("groth16_vk.bin"); From f92a753ed5b5593f45f41b82ed216b7de778018b Mon Sep 17 00:00:00 2001 From: nhtyy Date: Mon, 25 Nov 2024 10:03:01 -0800 Subject: [PATCH 2/7] fix: better test gating --- .github/workflows/pr.yml | 20 ++++++++++++++++++-- crates/verifier/src/lib.rs | 2 +- crates/verifier/src/tests.rs | 4 ---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 082b3bc16b..6fec774404 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -146,6 +146,24 @@ jobs: env: CARGO_INCREMENTAL: 1 + check: + name: Cargo Check + runs-on: [runs-on, runner=8cpu-linux-x64, disk=large, "run-id=${{ github.run_id }}"] + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Setup CI + uses: ./.github/actions/setup + + - name: Install SP1 toolchain + run: | + curl -L https://sp1.succinct.xyz | bash + ~/.sp1/bin/sp1up + ~/.sp1/bin/cargo-prove prove --version + - name: Check workspace no features uses: actions-rs/cargo@v1 with: @@ -164,8 +182,6 @@ jobs: command: check args: --workspace --all-targets --all-features - - examples: name: Examples runs-on: diff --git a/crates/verifier/src/lib.rs b/crates/verifier/src/lib.rs index 84d5d157a6..2220e60cb0 100644 --- a/crates/verifier/src/lib.rs +++ b/crates/verifier/src/lib.rs @@ -1,7 +1,7 @@ //! This crate provides verifiers for SP1 Groth16 and Plonk BN254 proofs in a no-std environment. //! It is patched for efficient verification within the SP1 zkVM context. -#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(not(any(feature = "std", test)), no_std)] extern crate alloc; use lazy_static::lazy_static; diff --git a/crates/verifier/src/tests.rs b/crates/verifier/src/tests.rs index f33500875d..c6d9a853c6 100644 --- a/crates/verifier/src/tests.rs +++ b/crates/verifier/src/tests.rs @@ -1,8 +1,6 @@ -#[cfg(feature = "std")] use sp1_sdk::{install::try_install_circuit_artifacts, SP1ProofWithPublicValues}; #[test] -#[cfg(feature = "std")] fn test_verify_groth16() { // Location of the serialized SP1ProofWithPublicValues. See README.md for more information. let proof_file = "test_binaries/fibonacci-groth16.bin"; @@ -21,7 +19,6 @@ fn test_verify_groth16() { } #[test] -#[cfg(feature = "std")] fn test_verify_plonk() { // Location of the serialized SP1ProofWithPublicValues. See README.md for more information. let proof_file = "test_binaries/fibonacci-plonk.bin"; @@ -40,7 +37,6 @@ fn test_verify_plonk() { } #[test] -#[cfg(feature = "std")] fn test_vkeys() { let groth16_path = try_install_circuit_artifacts("groth16"); let s3_vkey_path = groth16_path.join("groth16_vk.bin"); From c714596ae0dc9038b7a64e7871aab9c65e9d1f68 Mon Sep 17 00:00:00 2001 From: nhtyy Date: Mon, 25 Nov 2024 10:46:52 -0800 Subject: [PATCH 3/7] try smaller disk --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6fec774404..2853bfcbfc 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -148,7 +148,7 @@ jobs: check: name: Cargo Check - runs-on: [runs-on, runner=8cpu-linux-x64, disk=large, "run-id=${{ github.run_id }}"] + runs-on: [runs-on, runner=8cpu-linux-x64, disk=medium, "run-id=${{ github.run_id }}"] env: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: From bc311fd91c2d09895aedafe17b59d43180688e53 Mon Sep 17 00:00:00 2001 From: nhtyy Date: Mon, 25 Nov 2024 13:08:23 -0800 Subject: [PATCH 4/7] fix: bump cli job diskspaace --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2853bfcbfc..5c21994aa4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -222,7 +222,7 @@ jobs: cli: name: CLI - runs-on: [runs-on, runner=8cpu-linux-x64, "run-id=${{ github.run_id }}"] + runs-on: [runs-on, runner=8cpu-linux-x64, disk=medium, "run-id=${{ github.run_id }}"] env: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: From 19721cc397db4cae996e24a04809d38281c483ad Mon Sep 17 00:00:00 2001 From: N Date: Tue, 26 Nov 2024 00:49:03 -0800 Subject: [PATCH 5/7] disk -> large --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5c21994aa4..35baae1eac 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -222,7 +222,7 @@ jobs: cli: name: CLI - runs-on: [runs-on, runner=8cpu-linux-x64, disk=medium, "run-id=${{ github.run_id }}"] + runs-on: [runs-on, runner=8cpu-linux-x64, disk=large, "run-id=${{ github.run_id }}"] env: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: From 112d62516770da025af5ee81d3968161d70fa6fb Mon Sep 17 00:00:00 2001 From: nhtyy Date: Tue, 26 Nov 2024 11:18:08 -0800 Subject: [PATCH 6/7] fix: toolchain install from repo always --- .github/workflows/pr.yml | 69 +++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 35baae1eac..6adddf8ea0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -37,11 +37,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain + - name: Install SP1 toolchain from repo run: | - curl -L https://sp1.succinct.xyz | bash - ~/.sp1/bin/sp1up - ~/.sp1/bin/cargo-prove prove --version + cargo run -p sp1-cli -- prove install-toolchain + cd crates/cli + cargo install --locked --path . - name: Run cargo check uses: actions-rs/cargo@v1 @@ -80,11 +80,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain + - name: Install SP1 toolchain from repo run: | - curl -L https://sp1.succinct.xyz | bash - ~/.sp1/bin/sp1up - ~/.sp1/bin/cargo-prove prove --version + cargo run -p sp1-cli -- prove install-toolchain + cd crates/cli + cargo install --locked --path . - name: Run cargo check uses: actions-rs/cargo@v1 @@ -116,11 +116,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain + - name: Install SP1 toolchain from repo run: | - curl -L https://sp1.succinct.xyz | bash - ~/.sp1/bin/sp1up - ~/.sp1/bin/cargo-prove prove --version + cargo run -p sp1-cli -- prove install-toolchain + cd crates/cli + cargo install --locked --path . - name: Run cargo fmt uses: actions-rs/cargo@v1 @@ -158,11 +158,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain + - name: Install SP1 toolchain from repo run: | - curl -L https://sp1.succinct.xyz | bash - ~/.sp1/bin/sp1up - ~/.sp1/bin/cargo-prove prove --version + cargo run -p sp1-cli -- prove install-toolchain + cd crates/cli + cargo install --locked --path . - name: Check workspace no features uses: actions-rs/cargo@v1 @@ -201,9 +201,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain + - name: Install SP1 toolchain from repo run: | cargo run -p sp1-cli -- prove install-toolchain + cd crates/cli + cargo install --locked --path . - name: Run cargo fmt run: | @@ -232,17 +234,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain - run: | - curl -L https://sp1.succinct.xyz | bash - ~/.sp1/bin/sp1up - ~/.sp1/bin/cargo-prove prove --version - - - name: Install SP1 CLI + - name: Install SP1 toolchain from repo run: | + cargo run -p sp1-cli -- prove install-toolchain cd crates/cli - cargo install --force --locked --path . - cd ~ + cargo install --locked --path . - name: Run cargo prove new run: | @@ -271,11 +267,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain + - name: Install SP1 toolchain from repo run: | - curl -L https://sp1.succinct.xyz | bash - ~/.sp1/bin/sp1up - ~/.sp1/bin/cargo-prove prove --version + cargo run -p sp1-cli -- prove install-toolchain + cd crates/cli + cargo install --locked --path . - name: Run Evaluation run: | @@ -303,6 +299,7 @@ jobs: [ runs-on, "ram=${{ matrix.mem_limit}}", + disk=large, family=c7a, image=ubuntu22-full-x64, "run-id=${{ github.run_id }}", @@ -316,17 +313,11 @@ jobs: - name: Setup CI uses: ./.github/actions/setup - - name: Install SP1 toolchain - run: | - curl -L https://sp1.succinct.xyz | bash - ~/.sp1/bin/sp1up - ~/.sp1/bin/cargo-prove prove --version - - - name: Install SP1 CLI + - name: Install SP1 toolchain from repo run: | + cargo run -p sp1-cli -- prove install-toolchain cd crates/cli - cargo install --force --locked --path . - cd ~ + cargo install --locked --path . - name: Run tendermint script run: | From d3d31ddcc8d1f4256a64060131d77fc05d073a68 Mon Sep 17 00:00:00 2001 From: nhtyy Date: Tue, 26 Nov 2024 12:04:39 -0800 Subject: [PATCH 7/7] fix: try bumping cpus on lint, cargo clean afte cli install --- .github/workflows/pr.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6adddf8ea0..cd4b03bc2e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -42,6 +42,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Run cargo check uses: actions-rs/cargo@v1 @@ -85,6 +86,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Run cargo check uses: actions-rs/cargo@v1 @@ -106,7 +108,7 @@ jobs: lint: name: Formatting & Clippy - runs-on: [runs-on, runner=8cpu-linux-x64, "run-id=${{ github.run_id }}"] + runs-on: [runs-on, runner=16cpu-linux-x64, "run-id=${{ github.run_id }}"] env: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: @@ -121,6 +123,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Run cargo fmt uses: actions-rs/cargo@v1 @@ -148,7 +151,7 @@ jobs: check: name: Cargo Check - runs-on: [runs-on, runner=8cpu-linux-x64, disk=medium, "run-id=${{ github.run_id }}"] + runs-on: [runs-on, runner=16cpu-linux-x64, disk=medium, "run-id=${{ github.run_id }}"] env: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: @@ -163,6 +166,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Check workspace no features uses: actions-rs/cargo@v1 @@ -206,6 +210,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Run cargo fmt run: | @@ -239,6 +244,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Run cargo prove new run: | @@ -272,6 +278,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Run Evaluation run: | @@ -318,6 +325,7 @@ jobs: cargo run -p sp1-cli -- prove install-toolchain cd crates/cli cargo install --locked --path . + cargo clean - name: Run tendermint script run: |