Merge branch 'master' into kw/r0-gpu

This commit is contained in:
Kevaundray Wedderburn
2025-05-24 20:26:23 +01:00
3 changed files with 26 additions and 19 deletions

18
Cargo.lock generated
View File

@@ -2637,7 +2637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
dependencies = [
"libc",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -6760,7 +6760,7 @@ dependencies = [
[[package]]
name = "pico-derive"
version = "0.1.0"
source = "git+https://github.com/brevis-network/pico#1aa4bfdef1d0a7aa5eef484b4875728c4a42dc07"
source = "git+https://github.com/brevis-network/pico?tag=v1.1.3#d67fb4389d7d14d55f8ae6d156f436649b9dab2d"
dependencies = [
"proc-macro2",
"quote",
@@ -6769,8 +6769,8 @@ dependencies = [
[[package]]
name = "pico-patch-libs"
version = "1.1.2"
source = "git+https://github.com/brevis-network/pico#1aa4bfdef1d0a7aa5eef484b4875728c4a42dc07"
version = "1.1.3"
source = "git+https://github.com/brevis-network/pico?tag=v1.1.3#d67fb4389d7d14d55f8ae6d156f436649b9dab2d"
dependencies = [
"bincode",
"serde",
@@ -6778,8 +6778,8 @@ dependencies = [
[[package]]
name = "pico-sdk"
version = "1.1.2"
source = "git+https://github.com/brevis-network/pico#1aa4bfdef1d0a7aa5eef484b4875728c4a42dc07"
version = "1.1.3"
source = "git+https://github.com/brevis-network/pico?tag=v1.1.3#d67fb4389d7d14d55f8ae6d156f436649b9dab2d"
dependencies = [
"anyhow",
"bincode",
@@ -6804,8 +6804,8 @@ dependencies = [
[[package]]
name = "pico-vm"
version = "1.1.2"
source = "git+https://github.com/brevis-network/pico#1aa4bfdef1d0a7aa5eef484b4875728c4a42dc07"
version = "1.1.3"
source = "git+https://github.com/brevis-network/pico?tag=v1.1.3#d67fb4389d7d14d55f8ae6d156f436649b9dab2d"
dependencies = [
"anyhow",
"arrayref",
@@ -7235,7 +7235,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]

View File

@@ -8,7 +8,7 @@ license.workspace = true
[dependencies]
zkvm-interface = { workspace = true }
thiserror = "2"
pico-sdk = { git = "https://github.com/brevis-network/pico" }
pico-sdk = { git = "https://github.com/brevis-network/pico", tag = "v1.1.3" }
bincode = "1.3.3"
[lints]

View File

@@ -1,7 +1,8 @@
use pico_sdk::client::DefaultProverClient;
use std::process::Command;
use zkvm_interface::{
Compiler, InputItem, ProgramProvingReport, ProverResourceType, zkVM, zkVMError,
Compiler, Input, InputItem, ProgramExecutionReport, ProgramProvingReport, ProverResourceType,
zkVM, zkVMError,
};
mod error;
@@ -64,16 +65,24 @@ impl ErePico {
}
}
impl zkVM for ErePico {
fn execute(
&self,
_inputs: &zkvm_interface::Input,
) -> Result<zkvm_interface::ProgramExecutionReport, zkVMError> {
todo!("pico currently does not have an execute method exposed via the SDK")
fn execute(&self, inputs: &Input) -> Result<ProgramExecutionReport, zkVMError> {
let client = DefaultProverClient::new(&self.program);
let mut stdin = client.new_stdin_builder();
for input in inputs.iter() {
match input {
InputItem::Object(serialize) => stdin.write(serialize),
InputItem::Bytes(items) => stdin.write_slice(items),
}
}
let num_cycles = client.emulate(stdin);
Ok(ProgramExecutionReport::new(num_cycles))
}
fn prove(
&self,
inputs: &zkvm_interface::Input,
inputs: &Input,
) -> Result<(Vec<u8>, zkvm_interface::ProgramProvingReport), zkVMError> {
let client = DefaultProverClient::new(&self.program);
@@ -108,9 +117,7 @@ impl zkVM for ErePico {
fn verify(&self, _proof: &[u8]) -> Result<(), zkVMError> {
let client = DefaultProverClient::new(&self.program);
let _vk = client.riscv_vk();
todo!("Verification method missing from sdk")
}
}