Struct sp1_core::runtime::ExecutionState
source · pub struct ExecutionState {Show 14 fields
pub global_clk: u64,
pub current_shard: u32,
pub clk: u32,
pub channel: u32,
pub pc: u32,
pub memory: HashMap<u32, MemoryRecord, BuildNoHashHasher<u32>>,
pub uninitialized_memory: HashMap<u32, u32, BuildNoHashHasher<u32>>,
pub input_stream: Vec<Vec<u8>>,
pub input_stream_ptr: usize,
pub proof_stream: Vec<(ShardProof<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§
§global_clk: u64The global clock keeps track of how many instrutions have been executed through all shards.
current_shard: u32The shard clock keeps track of how many shards have been executed.
clk: u32The clock increments by 4 (possibly more in syscalls) for each instruction that has been executed in this shard.
channel: u32The channel alternates between 0 and crate::bytes::NUM_BYTE_LOOKUP_CHANNELS, used to controll byte lookup multiplicity.
pc: u32The program counter.
memory: HashMap<u32, MemoryRecord, BuildNoHashHasher<u32>>The memory which instructions operate over. Values contain the memory value and last shard
- timestamp that each memory address was accessed.
uninitialized_memory: HashMap<u32, u32, BuildNoHashHasher<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: Vec<Vec<u8>>A stream of input values (global to the entire program).
input_stream_ptr: usizeA ptr to the current position in the input stream incremented by HINT_READ opcode.
proof_stream: Vec<(ShardProof<BabyBearPoseidon2>, StarkVerifyingKey<BabyBearPoseidon2>)>A stream of proofs inputted to the program.
proof_stream_ptr: usizeA 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: usizeA 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§
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)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