Skip to content

Commit

Permalink
Add serde derives to MemoryImage (risc0#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
spaugh authored Apr 13, 2023
1 parent b9cedda commit b83c08d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions risc0/zkvm/src/binfmt/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use risc0_zkvm_platform::{
syscall::DIGEST_BYTES,
WORD_SIZE,
};
use serde::{Deserialize, Serialize};

use crate::{binfmt::elf::Program, sha};

Expand All @@ -34,7 +35,7 @@ const fn round_up(a: u32, b: u32) -> u32 {
div_ceil(a, b) * b
}

#[derive(Clone)]
#[derive(Clone, Serialize, Deserialize)]
pub struct PageTableInfo {
pub page_size: u32,
page_table_addr: u32,
Expand Down Expand Up @@ -103,7 +104,7 @@ impl PageTableInfo {
/// This is an image of the full memory state of the zkVM, including the data,
/// text, inputs, page table, and system memory. In addition to the memory image
/// proper, this includes some metadata about the page table.
#[derive(Clone)]
#[derive(Clone, Serialize, Deserialize)]
pub struct MemoryImage {
/// The memory image as a vector of bytes
pub image: Vec<u8>,
Expand Down

0 comments on commit b83c08d

Please sign in to comment.