#[repr(C)]pub struct ExecutionState {
pub pc: u32,
pub current_shard: u32,
pub memory: Memory<MemoryRecord>,
pub global_clk: u64,
pub clk: u32,
pub uninitialized_memory: Memory<u32>,
pub input_stream: VecDeque<Vec<u8>>,
pub proof_stream: Vec<(SP1ReduceProof<BabyBearPoseidon2>, StarkVerifyingKey<BabyBearPoseidon2>)>,
pub proof_stream_ptr: usize,
pub public_values_stream: Vec<u8>,
pub public_values_stream_ptr: usize,
pub syscall_counts: HashMap<SyscallCode, u64>,
}
Expand description
Holds data describing the current state of a program’s execution.
Fields§
§pc: u32
The program counter.
current_shard: u32
The shard clock keeps track of how many shards have been executed.
memory: Memory<MemoryRecord>
The memory which instructions operate over. Values contain the memory value and last shard
- timestamp that each memory address was accessed.
global_clk: u64
The global clock keeps track of how many instructions have been executed through all shards.
clk: u32
The clock increments by 4 (possibly more in syscalls) for each instruction that has been executed in this shard.
uninitialized_memory: Memory<u32>
Uninitialized memory addresses that have a specific value they should be initialized with.
SyscallHintRead
uses this to write hint data into uninitialized memory.
input_stream: VecDeque<Vec<u8>>
A stream of input values (global to the entire program).
proof_stream: Vec<(SP1ReduceProof<BabyBearPoseidon2>, StarkVerifyingKey<BabyBearPoseidon2>)>
A stream of proofs (reduce vk, proof, verifying key) inputted to the program.
proof_stream_ptr: usize
A ptr to the current position in the proof stream, incremented after verifying a proof.
public_values_stream: Vec<u8>
A stream of public values from the program (global to entire program).
public_values_stream_ptr: usize
A ptr to the current position in the public values stream, incremented when reading from
public_values_stream
.
syscall_counts: HashMap<SyscallCode, u64>
Keeps track of how many times a certain syscall has been called.
Implementations§
Source§impl ExecutionState
impl ExecutionState
Sourcepub fn new(pc_start: u32) -> Self
pub fn new(pc_start: u32) -> Self
Create a new ExecutionState
.
Trait Implementations§
Source§impl Clone for ExecutionState
impl Clone for ExecutionState
Source§fn clone(&self) -> ExecutionState
fn clone(&self) -> ExecutionState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ExecutionState
impl Debug for ExecutionState
Source§impl Default for ExecutionState
impl Default for ExecutionState
Source§fn default() -> ExecutionState
fn default() -> ExecutionState
Source§impl<'de> Deserialize<'de> for ExecutionState
impl<'de> Deserialize<'de> for ExecutionState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ExecutionState
impl RefUnwindSafe for ExecutionState
impl Send for ExecutionState
impl Sync for ExecutionState
impl Unpin for ExecutionState
impl UnwindSafe for ExecutionState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more