pub struct RecAdviceProvider { /* private fields */ }
Expand description

An in-memory [AdviceProvider] implementation with support for data access recording.

The recorder can be converted into a proof which can be used to provide the non-deterministic inputs for program execution.

Implementations§

source§

impl RecAdviceProvider

source

pub fn into_proof(self) -> AdviceInputs

Consumes the advice provider and returns a AdviceInputs instance which can be used to re-execute the program.

The returned AdviceInputs instance will contain only the non-deterministic inputs which were requested during program execution.

Trait Implementations§

source§

impl AdviceProvider for RecAdviceProvider

Pass-through implementations of AdviceProvider methods.

TODO: potentially do this via a macro.

source§

fn pop_stack(&mut self) -> Result<Felt, ExecutionError>

Pops an element from the advice stack and returns it. Read more
source§

fn pop_stack_word(&mut self) -> Result<Word, ExecutionError>

Pops a word (4 elements) from the advice stack and returns it. Read more
source§

fn pop_stack_dword(&mut self) -> Result<[Word; 2], ExecutionError>

Pops a double word (8 elements) from the advice stack and returns them. Read more
source§

fn push_stack(&mut self, source: AdviceSource) -> Result<(), ExecutionError>

Pushes the value(s) specified by the source onto the advice stack. Read more
source§

fn insert_into_map( &mut self, key: Word, values: Vec<Felt> ) -> Result<(), ExecutionError>

Inserts the provided value into the advice map under the specified key. Read more
source§

fn get_tree_node( &self, root: Word, depth: &Felt, index: &Felt ) -> Result<Word, ExecutionError>

Returns a node at the specified depth and index in a Merkle tree with the given root. Read more
source§

fn get_merkle_path( &self, root: Word, depth: &Felt, index: &Felt ) -> Result<MerklePath, ExecutionError>

Returns a path to a node at the specified depth and index in a Merkle tree with the specified root. Read more
source§

fn get_leaf_depth( &self, root: Word, tree_depth: &Felt, index: &Felt ) -> Result<u8, ExecutionError>

Reconstructs a path from the root until a leaf or empty node and returns its depth. Read more
source§

fn update_merkle_node( &mut self, root: Word, depth: &Felt, index: &Felt, value: Word ) -> Result<MerklePath, ExecutionError>

Updates a node at the specified depth and index in a Merkle tree with the specified root; returns the Merkle path from the updated node to the new root. Read more
source§

fn merge_roots(&mut self, lhs: Word, rhs: Word) -> Result<Word, ExecutionError>

Creates a new Merkle tree in the advice provider by combining Merkle trees with the specified roots. The root of the new tree is defined as hash(left_root, right_root). Read more
source§

fn advance_clock(&mut self)

Increments the clock cycle. Read more
source§

fn by_ref(&mut self) -> &mut Self

Creates a “by reference” advice provider for this instance. Read more
source§

impl Clone for RecAdviceProvider

source§

fn clone(&self) -> RecAdviceProvider

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RecAdviceProvider

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RecAdviceProvider

source§

fn default() -> RecAdviceProvider

Returns the “default value” for a type. Read more
source§

impl From<AdviceInputs> for RecAdviceProvider

source§

fn from(inputs: AdviceInputs) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.