pub struct TraceInfo { /* private fields */ }Expand description
Information about a specific execution trace.
Trace info consists of the number of columns for all trace segments, trace length, the number of random elements needed to generate the auxiliary segment and optional custom metadata.
Currently, a trace can consist of at most two segments: the main segment and one auxiliary segment. Metadata is just a vector of bytes and can store any values up to 64KB in size.
Implementations§
Source§impl TraceInfo
impl TraceInfo
Sourcepub const MIN_TRACE_LENGTH: usize = 8usize
pub const MIN_TRACE_LENGTH: usize = 8usize
Smallest allowed execution trace length; currently set at 8.
Sourcepub const MAX_TRACE_WIDTH: usize = 255usize
pub const MAX_TRACE_WIDTH: usize = 255usize
Maximum number of columns in an execution trace (across all segments); currently set at 255.
Sourcepub const MAX_META_LENGTH: usize = 65_535usize
pub const MAX_META_LENGTH: usize = 65_535usize
Maximum number of bytes in trace metadata; currently set at 65535.
Sourcepub const MAX_RAND_SEGMENT_ELEMENTS: usize = 255usize
pub const MAX_RAND_SEGMENT_ELEMENTS: usize = 255usize
Maximum number of random elements in the auxiliary trace segment; currently set to 255.
Sourcepub fn with_meta(width: usize, length: usize, meta: Vec<u8>) -> TraceInfo
pub fn with_meta(width: usize, length: usize, meta: Vec<u8>) -> TraceInfo
Creates a new TraceInfo from the specified trace width, length, and metadata.
An execution trace described by this trace info is limited to a single segment.
§Panics
Panics if:
- Trace width is zero or greater than 255.
- Trace length is smaller than 8 or is not a power of two.
- Length of
metais greater than 65535;
Sourcepub fn new_multi_segment(
main_segment_width: usize,
aux_segment_width: usize,
num_aux_segment_rands: usize,
trace_length: usize,
trace_meta: Vec<u8>,
) -> TraceInfo
pub fn new_multi_segment( main_segment_width: usize, aux_segment_width: usize, num_aux_segment_rands: usize, trace_length: usize, trace_meta: Vec<u8>, ) -> TraceInfo
Creates a new TraceInfo with main and auxiliary segments.
§Panics
Panics if:
- The width of the first trace segment is zero.
- Total width of all trace segments is greater than 255.
- Trace length is smaller than 8 or is not a power of two.
- A zero entry in auxiliary segment width array is followed by a non-zero entry.
- Number of random elements for the auxiliary trace segment of non-zero width is set to zero.
- Number of random elements for the auxiliary trace segment of zero width is set to non-zero.
- Number of random elements for any auxiliary trace segment is greater than 255.
Sourcepub fn width(&self) -> usize
pub fn width(&self) -> usize
Returns the total number of columns in an execution trace.
This is guaranteed to be between 1 and 255.
Sourcepub fn length(&self) -> usize
pub fn length(&self) -> usize
Returns execution trace length.
The length is guaranteed to be a power of two.
Sourcepub fn is_multi_segment(&self) -> bool
pub fn is_multi_segment(&self) -> bool
Returns true if an execution trace contains the auxiliary trace segment.
Sourcepub fn main_trace_width(&self) -> usize
pub fn main_trace_width(&self) -> usize
Returns the number of columns in the main segment of an execution trace.
This is guaranteed to be between 1 and 255.
Sourcepub fn aux_segment_width(&self) -> usize
pub fn aux_segment_width(&self) -> usize
Returns the number of columns in the auxiliary segment of an execution trace.
Sourcepub fn num_segments(&self) -> usize
pub fn num_segments(&self) -> usize
Returns the total number of segments in an execution trace.
Sourcepub fn num_aux_segments(&self) -> usize
pub fn num_aux_segments(&self) -> usize
Returns the number of auxiliary trace segments in an execution trace.
Sourcepub fn get_aux_segment_width(&self) -> usize
pub fn get_aux_segment_width(&self) -> usize
Returns the number of columns in the auxiliary trace segment.
Sourcepub fn get_num_aux_segment_rand_elements(&self) -> usize
pub fn get_num_aux_segment_rand_elements(&self) -> usize
Returns the number of random elements needed to build all auxiliary columns.
Trait Implementations§
Source§impl Deserializable for TraceInfo
impl Deserializable for TraceInfo
Source§fn read_from<R>(source: &mut R) -> Result<TraceInfo, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<TraceInfo, DeserializationError>where
R: ByteReader,
Source§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl Serializable for TraceInfo
impl Serializable for TraceInfo
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Serializes self and writes the resulting bytes into the target.