From 9844d088c9297d586b4b3f7ef62bee3b3a27612d Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Tue, 28 Jan 2025 13:19:27 +0200 Subject: feat(zkvms/sp1): Adapt to new input type --- zkvms/sp1/host/Cargo.toml | 1 + zkvms/sp1/host/src/main.rs | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'zkvms/sp1/host') diff --git a/zkvms/sp1/host/Cargo.toml b/zkvms/sp1/host/Cargo.toml index 6ab50a3..8f4da63 100644 --- a/zkvms/sp1/host/Cargo.toml +++ b/zkvms/sp1/host/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [dependencies] sp1-sdk = { path = "/nix/store/8g5sf8h6nfypnd736x6ns4c44s8g6qd4-sp1-unstable-2024-12-23/crates/sdk" } +generic-array = "=1.1.1" serde_json = { version = "1.0", default-features = false, features = ["alloc"] } serde = { version = "1.0", default-features = false, features = ["derive"] } clap = { version = "4.0", features = ["derive", "env"] } diff --git a/zkvms/sp1/host/src/main.rs b/zkvms/sp1/host/src/main.rs index 28cc319..ef069fb 100644 --- a/zkvms/sp1/host/src/main.rs +++ b/zkvms/sp1/host/src/main.rs @@ -1,16 +1,14 @@ -use zkvms_host_io::{read_args, RunType::{ Execute, Prove, Verify }}; +use zkvms_host_io::{Input, foreach_input_field, read_args, RunType::{ Execute, Prove, Verify }}; use sp1_sdk::{ProverClient, EnvProver, SP1Stdin, SP1ProofWithPublicValues, SP1VerifyingKey}; /// The ELF (executable and linkable format) file for the Succinct RISC-V zkVM. pub const FIBONACCI_ELF: &[u8] = include_bytes!("./guest"); -type Input = (Vec>, u32, Vec>); - -fn build_stdin((graph, colors, coloring): &Input) -> SP1Stdin { +fn build_stdin(input: &Input) -> SP1Stdin { let mut stdin = SP1Stdin::new(); - stdin.write(&graph); - stdin.write(&colors); - stdin.write(&coloring); + foreach_input_field!{ + stdin.write(&input.yield); + } stdin } -- cgit v1.2.3