Skip to content

Commit

Permalink
feat: add v3.0.0 + chores (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwen01 authored Dec 16, 2024
1 parent d1e8b39 commit 9e9a29c
Show file tree
Hide file tree
Showing 11 changed files with 2,862 additions and 8,573 deletions.
3,870 changes: 2,836 additions & 1,034 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,23 @@ sp1-solana = { path = "verifier" }
fibonacci-verifier-contract = { path = "example/program" }

# solana
solana-program = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e" }
solana-program-test = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e" }
solana-sdk = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e" }
solana-program = { version = "=2.1.6" }
solana-program-test = { version = "=2.1.6" }
solana-sdk = { version = "=2.1.6" }
borsh = "1.5.1"

# light protocol groth16 verifier
groth16-solana = { git = "https://github.com/sp1-patches/groth16-solana", branch = "patch-v0.0.3" }

# misc
num-bigint = "0.4.6"
num-traits = "0.2.19"
tokio = "1.40.0"
sha2 = "0.10.8"

# sp1
sp1-sdk = { version = "3.0.0", default-features = false }
sp1-sdk = { version = "3.0.0" }
sp1-zkvm = { version = "3.0.0" }
sp1-build = { version = "3.0.0" }

[patch.crates-io]
# See https://github.com/anza-xyz/agave/blob/master/Cargo.toml#L551-L586
solana-curve25519 = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e"}
solana-program = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e"}
solana-bn254 = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e" }
solana-zk-sdk = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e" }
solana-zk-token-sdk = { git = "https://github.com/anza-xyz/agave", rev = "6e62af0f0de6a40e4e22628cbbcf63b1a6da560e"}

9 changes: 3 additions & 6 deletions example/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use solana_program::{
use sp1_solana::verify_proof;

#[cfg(not(feature = "no-entrypoint"))]
use solana_program::entrypoint;

#[cfg(not(feature = "no-entrypoint"))]
entrypoint!(process_instruction);
solana_program::entrypoint!(process_instruction);

#[cfg(not(doctest))]
/// Derived as follows:
Expand All @@ -20,7 +17,7 @@ entrypoint!(process_instruction);
/// let vkey_hash = vk.bytes32();
/// ```
const FIBONACCI_VKEY_HASH: &str =
"0x0054c0e58911dd8b993c6d8f249aa50a2e523114ec4b7ef9dd355c5f6bfbf3ce";
"0x007a04fa063e8b4a76f65e95923df3319e13e2187c0543368aeb372609555f83";

/// The instruction data for the program.
#[derive(BorshDeserialize, BorshSerialize)]
Expand All @@ -39,7 +36,7 @@ pub fn process_instruction(
.map_err(|_| ProgramError::InvalidInstructionData)?;

// Get the SP1 Groth16 verification key from the `sp1-solana` crate.
let vk = sp1_solana::GROTH16_VK_2_0_0_BYTES;
let vk = sp1_solana::GROTH16_VK_3_0_0_BYTES;

// Verify the proof.
verify_proof(
Expand Down
Loading

0 comments on commit 9e9a29c

Please sign in to comment.