Skip to content

Commit

Permalink
feat: v1.0.4-testnet (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored May 30, 2024
2 parents 21455d3 + 3cc3cc6 commit 2ce75c6
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 75 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR

on:
push:
branches: [main, dev]
branches: [main]
pull_request:
branches:
- "**"
Expand All @@ -15,6 +15,7 @@ on:
- "sdk/**"
- "zkvm/**"
- "tests/**"
- "examples/**"
- ".github/workflows/**"
merge_group:

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
echo "release_name=Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT
elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "tag_name=latest" >> $GITHUB_OUTPUT
echo "release_name=Latest Release" >> $GITHUB_OUTPUT
echo "release_name=Latest" >> $GITHUB_OUTPUT
else
echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
echo "release_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -205,14 +205,14 @@ jobs:
with:
name: ${{ needs.prepare.outputs.release_name }}
tag_name: ${{ needs.prepare.outputs.tag_name }}
prerelease: ${{ env.IS_NIGHTLY }}
prerelease: ${{ env.IS_NIGHTLY || needs.prepare.outputs.tag_name == 'latest' }}
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
${{ steps.man.outputs.cargo_prove_man }}
# If this is a nightly release, it also updates the release
# tagged `nightly` for compatibility with `foundryup`
# tagged `nightly` for compatibility with `sp1up`
- name: Update nightly release
if: ${{ env.IS_NIGHTLY }}
uses: softprops/action-gh-release@v1
Expand Down
20 changes: 10 additions & 10 deletions examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
hex = "0.4.3"
sha2 = "0.10.8"
sp1-zkvm = { path = "../../../../zkvm/entrypoint", features = ["verify"] }
sp1-zkvm = { path = "../../../zkvm/entrypoint", features = ["verify"] }

[patch.crates-io]
sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes.git", package = "sha2", branch = "patch-v0.10.8" }
Binary file not shown.
File renamed without changes.
20 changes: 0 additions & 20 deletions examples/aggregation/programs/fibonacci/src/main.rs

This file was deleted.

3 changes: 1 addition & 2 deletions examples/aggregation/script/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
version = "0.1.0"
name = "sp1-aggregation-example-script"
name = "aggregation-script"
edition = "2021"
default-run = "sp1-aggregation-example-script"

[dependencies]
hex = "0.4.3"
Expand Down
7 changes: 2 additions & 5 deletions examples/aggregation/script/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
fn main() {
sp1_helper::build_program(&format!("{}/../program", env!("CARGO_MANIFEST_DIR")));
sp1_helper::build_program(&format!(
"{}/../programs/aggregation",
env!("CARGO_MANIFEST_DIR")
));
sp1_helper::build_program(&format!(
"{}/../programs/fibonacci",
"{}/../../fibonacci/program",
env!("CARGO_MANIFEST_DIR")
));
}
5 changes: 2 additions & 3 deletions examples/aggregation/script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
use sp1_sdk::{HashableKey, ProverClient, SP1CompressedProof, SP1Stdin, SP1VerifyingKey};

/// A program that aggregates the proofs of the simple program.
const AGGREGATION_ELF: &[u8] =
include_bytes!("../../programs/aggregation/elf/riscv32im-succinct-zkvm-elf");
const AGGREGATION_ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf");

/// A program that just runs a simple computation.
const FIBONACCI_ELF: &[u8] =
include_bytes!("../../programs/fibonacci/elf/riscv32im-succinct-zkvm-elf");
include_bytes!("../../../fibonacci/program/elf/riscv32im-succinct-zkvm-elf");

/// An input to the aggregation program.
///
Expand Down
Binary file modified examples/chess/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Binary file modified examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Binary file modified examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Binary file modified examples/io/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Binary file modified examples/rsa/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Binary file modified examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Binary file modified examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
11 changes: 8 additions & 3 deletions recursion/gnark-ffi/go/sp1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"bytes"
"encoding/hex"

"github.com/consensys/gnark/backend/plonk"
plonk "github.com/consensys/gnark/backend/plonk"
plonk_bn254 "github.com/consensys/gnark/backend/plonk/bn254"
"github.com/consensys/gnark/frontend"
"github.com/succinctlabs/sp1-recursion-gnark/sp1/babybear"
)
Expand All @@ -17,11 +18,15 @@ func NewSP1PlonkBn254Proof(proof *plonk.Proof, witnessInput WitnessInput) Proof
var publicInputs [2]string
publicInputs[0] = witnessInput.VkeyHash
publicInputs[1] = witnessInput.CommitedValuesDigest
encodedProof := hex.EncodeToString(proofBytes)

// Cast plonk proof into plonk_bn254 proof so we can call MarshalSolidity.
p := (*proof).(*plonk_bn254.Proof)

encodedProof := p.MarshalSolidity()

return Proof{
PublicInputs: publicInputs,
EncodedProof: encodedProof,
EncodedProof: hex.EncodeToString(encodedProof),
RawProof: hex.EncodeToString(proofBytes),
}
}
Expand Down
26 changes: 0 additions & 26 deletions sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,19 +425,6 @@ mod tests {
client.execute(elf, stdin).unwrap();
}

#[test]
fn test_e2e_prove_local() {
utils::setup_logger();
let client = ProverClient::local();
let elf =
include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf");
let (pk, vk) = client.setup(elf);
let mut stdin = SP1Stdin::new();
stdin.write(&10usize);
let proof = client.prove(&pk, stdin).unwrap();
client.verify(&proof, &vk).unwrap();
}

#[test]
fn test_e2e_prove_plonk() {
utils::setup_logger();
Expand All @@ -451,19 +438,6 @@ mod tests {
client.verify_plonk(&proof, &vk).unwrap();
}

#[test]
fn test_e2e_prove_mock() {
utils::setup_logger();
let client = ProverClient::mock();
let elf =
include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf");
let (pk, vk) = client.setup(elf);
let mut stdin = SP1Stdin::new();
stdin.write(&10usize);
let proof = client.prove(&pk, stdin).unwrap();
client.verify(&proof, &vk).unwrap();
}

#[test]
fn test_e2e_prove_plonk_mock() {
utils::setup_logger();
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/provers/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Prover for LocalProver {
public_values,
})
} else {
panic!("plonk bn254 feature not enabled")
panic!("plonk feature not enabled")
}
}
}
Expand Down

0 comments on commit 2ce75c6

Please sign in to comment.