mirror of
https://github.com/eth-act/ere.git
synced 2026-02-19 11:54:42 -05:00
Merge pull request #8 from eth-applied-research-group/kw/enable-pico
chore: add execute for pico
This commit is contained in:
22
Cargo.lock
generated
22
Cargo.lock
generated
@@ -2503,7 +2503,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]]
|
||||
@@ -6405,7 +6405,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",
|
||||
@@ -6414,8 +6414,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",
|
||||
@@ -6423,8 +6423,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",
|
||||
@@ -6449,8 +6449,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",
|
||||
@@ -6865,7 +6865,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"socket2",
|
||||
"tracing",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7574,7 +7574,7 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -8783,7 +8783,7 @@ dependencies = [
|
||||
"getrandom 0.3.3",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user