pub struct Context { /* private fields */ }Expand description
Basic metadata about a specific execution of a computation.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new<B: StarkField>(
trace_info: TraceInfo,
options: ProofOptions,
num_constraints: usize,
) -> Self
pub fn new<B: StarkField>( trace_info: TraceInfo, options: ProofOptions, num_constraints: usize, ) -> Self
Creates a new context for a computation described by the specified field, trace info, proof options, and total number of constraints.
§Panics
Sourcepub fn trace_info(&self) -> &TraceInfo
pub fn trace_info(&self) -> &TraceInfo
Returns execution trace info for the computation described by this context.
Sourcepub fn lde_domain_size(&self) -> usize
pub fn lde_domain_size(&self) -> usize
Returns the size of the LDE domain for the computation described by this context.
Sourcepub fn field_modulus_bytes(&self) -> &[u8] ⓘ
pub fn field_modulus_bytes(&self) -> &[u8] ⓘ
Returns modulus of the field for the computation described by this context.
Sourcepub fn num_modulus_bits(&self) -> u32
pub fn num_modulus_bits(&self) -> u32
Returns number of bits in the base field modulus for the computation described by this context.
The modulus is assumed to be encoded in little-endian byte order.
Sourcepub fn options(&self) -> &ProofOptions
pub fn options(&self) -> &ProofOptions
Returns proof options which were used to a proof in this context.
Sourcepub fn num_constraints(&self) -> usize
pub fn num_constraints(&self) -> usize
Returns the total number of constraints.
Trait Implementations§
Source§impl Deserializable for Context
impl Deserializable for Context
Source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
Reads proof context from the specified source and returns the result.
§Errors
Returns an error of a valid Context struct could not be read from the specified source.
Source§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl Serializable for Context
impl Serializable for Context
Source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes self and writes the resulting bytes into the target.
Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Source§impl<E: StarkField> ToElements<E> for Context
impl<E: StarkField> ToElements<E> for Context
Source§fn to_elements(&self) -> Vec<E>
fn to_elements(&self) -> Vec<E>
Converts this Context into a vector of field elements.
The elements are laid out as follows:
- trace info:
- trace segment widths and the number of aux random values [1 element].
- trace length [1 element].
- trace metadata [0 or more elements].
- field modulus bytes [2 field elements].
- number of constraints (1 element).
- proof options:
- field extension, FRI parameters, and grinding factor [1 element].
- blowup factor [1 element].
- number of queries [1 element].