openvm_circuit/system/memory/merkle/
columns.rs

1use openvm_circuit_primitives_derive::AlignedBorrow;
2
3#[derive(Debug, AlignedBorrow)]
4#[repr(C)]
5pub struct MemoryMerkleCols<T, const CHUNK: usize> {
6    // `expand_direction` =  1 corresponds to initial memory state
7    // `expand_direction` = -1 corresponds to final memory state
8    // `expand_direction` =  0 corresponds to irrelevant row (all interactions multiplicity 0)
9    pub expand_direction: T,
10
11    // height_section = 1 indicates that as_label is being expanded
12    // height_section = 0 indicates that address_label is being expanded
13    pub height_section: T,
14    pub parent_height: T,
15    pub is_root: T,
16
17    pub parent_as_label: T,
18    pub parent_address_label: T,
19
20    pub parent_hash: [T; CHUNK],
21    pub left_child_hash: [T; CHUNK],
22    pub right_child_hash: [T; CHUNK],
23
24    // indicate whether `expand_direction` is different from origin
25    // when `expand_direction` != -1, must be 0
26    pub left_direction_different: T,
27    pub right_direction_different: T,
28}
29
30#[derive(Debug, Clone, Copy, AlignedBorrow)]
31#[repr(C)]
32pub struct MemoryMerklePvs<T, const CHUNK: usize> {
33    /// The memory state root before the execution of this segment.
34    pub initial_root: [T; CHUNK],
35    /// The memory state root after the execution of this segment.
36    pub final_root: [T; CHUNK],
37}