ZkDebugger

Struct ZkDebugger 

Source
pub struct ZkDebugger<S> { /* private fields */ }
Expand description

ZKP Debugger with CDF backend

Implementations§

Source§

impl<S> ZkDebugger<S>

Source

pub const fn config(&self) -> &Config

Configuration of the CDF file

Source

pub const fn preamble(&self) -> &Preamble

Preamble for the CDF file

Source

pub fn add_breakpoint(&mut self, source: String, line: Option<u64>) -> usize

Add a breakpoint to the provided source/line

If line is None, the breakpoint will be triggered in any incidence of source

Source

pub fn remove_breakpoint(&mut self, id: usize) -> Option<Breakpoint>

Remove a breakpoint with the provided id.

If the id is not in the set, will return None.

Source

pub fn fetch_breakpoint(&mut self, id: usize) -> Option<&Breakpoint>

Fetch a breakpoint from an id returned from add_breakpoint.

Source§

impl<S> ZkDebugger<S>
where S: Read + Seek,

Source

pub fn from_reader(source: S) -> Result<Self>

Create a CDF with the provided source and use it as backend for the debugger

Source

pub fn fetch_current_constraint(&mut self) -> Result<Constraint<'_>>

Attempt to fetch the current constraint from the source

Source

pub fn fetch_constraint(&mut self, idx: usize) -> Result<Constraint<'_>>

Attempt to read an indexed constraint from the source

Source

pub fn fetch_witness(&mut self, idx: usize) -> Result<Witness<'_>>

Attempt to read an indexed witness from the source

Source

pub fn afore(&mut self) -> Result<State>

Move to previous source/line.

May jump more than one constraint in case we have multiple constraints defined in a single source/file tuple.

Source

pub fn cont(&mut self) -> Result<State>

Continue the execution until EOF, breakpoint, or invalid constraint.

Source

pub fn goto(&mut self, idx: usize) -> Result<State>

Attempt to jump to a given constraint

Source

pub fn step(&mut self) -> Result<State>

Move to next source/line.

May jump more than one constraint in case we have multiple constraints defined in a single source/file tuple.

Source

pub fn turn(&mut self) -> Result<State>

Reverse the execution until BOF, breakpoint, or invalid constraint.

Methods from Deref<Target = CircuitDescription<S>>§

Source

pub fn preamble(&self) -> &Preamble

Decoded preamble

Source

pub fn source_name_contains(&self, name: &str) -> bool

Check if the provided name is contained within the available source names

Source

pub fn fetch_constraint(&mut self, idx: usize) -> Result<Constraint<'_>>

Attempt to read an indexed constraint from the source

Source

pub fn fetch_witness(&mut self, idx: usize) -> Result<Witness<'_>>

Attempt to read an indexed witness from the source

Trait Implementations§

Source§

impl<S: Clone> Clone for ZkDebugger<S>

Source§

fn clone(&self) -> ZkDebugger<S>

Returns a duplicate 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<S: Debug> Debug for ZkDebugger<S>

Source§

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

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

impl<S> Deref for ZkDebugger<S>

Source§

type Target = CircuitDescription<S>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<S> DerefMut for ZkDebugger<S>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<S> From<CircuitDescription<S>> for ZkDebugger<S>

Source§

fn from(cdf: CircuitDescription<S>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<S> Freeze for ZkDebugger<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for ZkDebugger<S>
where S: RefUnwindSafe,

§

impl<S> Send for ZkDebugger<S>
where S: Send,

§

impl<S> Sync for ZkDebugger<S>
where S: Sync,

§

impl<S> Unpin for ZkDebugger<S>
where S: Unpin,

§

impl<S> UnwindSafe for ZkDebugger<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.