From 6b9a3fa1f373f975c3d72960036c4996c7ba0389 Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Fri, 7 Feb 2025 09:34:43 +0200 Subject: feat(zkvms): Use std (or alloc) collections in all guests --- zkvms/jolt/guest/src/lib.rs | 1 + zkvms/nexus/guest/src/main.rs | 7 +------ zkvms/risc0/guest/src/main.rs | 1 + zkvms/sp1/guest/src/main.rs | 1 + zkvms/zkm/guest/src/main.rs | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/zkvms/jolt/guest/src/lib.rs b/zkvms/jolt/guest/src/lib.rs index 3fec863..d90b3f2 100644 --- a/zkvms/jolt/guest/src/lib.rs +++ b/zkvms/jolt/guest/src/lib.rs @@ -2,5 +2,6 @@ #![no_main] use wrapper_macro::make_wrapper; +use std::collections::*; zkp::entrypoint_expr!{} diff --git a/zkvms/nexus/guest/src/main.rs b/zkvms/nexus/guest/src/main.rs index eb82cde..bb2e0c8 100644 --- a/zkvms/nexus/guest/src/main.rs +++ b/zkvms/nexus/guest/src/main.rs @@ -3,14 +3,9 @@ use nexus_rt::{ postcard, println, read_private_input, write_output }; extern crate alloc; -use alloc::vec::Vec; +use alloc::{ vec::*, collections::* }; use wrapper_macro::make_wrapper; -type Input = (Vec>, u32, Vec>); -type Output = bool; - -const VERTICES: usize = 100; - #[nexus_rt::main] fn main() { zkp::entrypoint_expr!() diff --git a/zkvms/risc0/guest/src/main.rs b/zkvms/risc0/guest/src/main.rs index c849d87..2097259 100644 --- a/zkvms/risc0/guest/src/main.rs +++ b/zkvms/risc0/guest/src/main.rs @@ -1,5 +1,6 @@ use wrapper_macro::make_wrapper; use risc0_zkvm::guest::env::{ read, commit }; +use std::collections::*; fn main() { zkp::entrypoint_expr!() diff --git a/zkvms/sp1/guest/src/main.rs b/zkvms/sp1/guest/src/main.rs index 7884667..0ca4618 100644 --- a/zkvms/sp1/guest/src/main.rs +++ b/zkvms/sp1/guest/src/main.rs @@ -3,6 +3,7 @@ use wrapper_macro::make_wrapper; use sp1_zkvm::io::read; use sp1_zkvm::lib::io::commit; +use std::collections::*; sp1_zkvm::entrypoint!(main); diff --git a/zkvms/zkm/guest/src/main.rs b/zkvms/zkm/guest/src/main.rs index 21fb641..1aa27b8 100644 --- a/zkvms/zkm/guest/src/main.rs +++ b/zkvms/zkm/guest/src/main.rs @@ -4,7 +4,7 @@ use wrapper_macro::make_wrapper; extern crate alloc; -use alloc::vec::Vec; +use alloc::{ vec::*, collections::* }; use zkm_runtime::io::{ read, commit }; zkm_runtime::entrypoint!(main); -- cgit v1.2.3