Struct winter_prover::TraceInfo
source · pub struct TraceInfo { /* private fields */ }
Expand description
Information about a specific execution trace.
Trace info consists of trace layout info, length, and optional custom metadata. Trace layout specifies the number of columns for all trace segments. Currently, a trace can consist of at most two segments. Metadata is just a vector of bytes and can store any values up to 64KB in size.
Implementations
sourceimpl 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 per auxiliary trace segment; currently set to 255.
sourcepub fn with_meta(width: usize, length: usize, meta: Vec<u8, Global>) -> TraceInfo
pub fn with_meta(width: usize, length: usize, meta: Vec<u8, Global>) -> 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
meta
is greater than 65535;
sourcepub fn new_multi_segment(
layout: TraceLayout,
length: usize,
meta: Vec<u8, Global>
) -> TraceInfo
pub fn new_multi_segment(
layout: TraceLayout,
length: usize,
meta: Vec<u8, Global>
) -> TraceInfo
sourcepub fn layout(&self) -> &TraceLayout
pub fn layout(&self) -> &TraceLayout
Returns a description of how execution trace columns are arranged into segments.
Currently, an execution trace can consist of at most two segments.
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 more than one segment.