pub struct ExecutionRecord {Show 25 fields
pub program: Arc<Program>,
pub cpu_events: Vec<CpuEvent>,
pub add_events: Vec<AluEvent>,
pub mul_events: Vec<AluEvent>,
pub sub_events: Vec<AluEvent>,
pub bitwise_events: Vec<AluEvent>,
pub shift_left_events: Vec<AluEvent>,
pub shift_right_events: Vec<AluEvent>,
pub divrem_events: Vec<AluEvent>,
pub lt_events: Vec<AluEvent>,
pub memory_instr_events: Vec<MemInstrEvent>,
pub auipc_events: Vec<AUIPCEvent>,
pub branch_events: Vec<BranchEvent>,
pub jump_events: Vec<JumpEvent>,
pub byte_lookups: HashMap<ByteLookupEvent, usize>,
pub precompile_events: PrecompileEvents,
pub global_memory_initialize_events: Vec<MemoryInitializeFinalizeEvent>,
pub global_memory_finalize_events: Vec<MemoryInitializeFinalizeEvent>,
pub cpu_local_memory_access: Vec<MemoryLocalEvent>,
pub syscall_events: Vec<SyscallEvent>,
pub global_interaction_events: Vec<GlobalInteractionEvent>,
pub public_values: PublicValues<u32, u32>,
pub next_nonce: u64,
pub shape: Option<Shape<RiscvAirId>>,
pub counts: Option<EnumMap<RiscvAirId, u64>>,
}
Expand description
A record of the execution of a program.
The trace of the execution is represented as a list of “events” that occur every cycle.
Fields§
§program: Arc<Program>
The program.
cpu_events: Vec<CpuEvent>
A trace of the CPU events which get emitted during execution.
add_events: Vec<AluEvent>
A trace of the ADD, and ADDI events.
mul_events: Vec<AluEvent>
A trace of the MUL events.
sub_events: Vec<AluEvent>
A trace of the SUB events.
bitwise_events: Vec<AluEvent>
A trace of the XOR, XORI, OR, ORI, AND, and ANDI events.
shift_left_events: Vec<AluEvent>
A trace of the SLL and SLLI events.
shift_right_events: Vec<AluEvent>
A trace of the SRL, SRLI, SRA, and SRAI events.
divrem_events: Vec<AluEvent>
A trace of the DIV, DIVU, REM, and REMU events.
lt_events: Vec<AluEvent>
A trace of the SLT, SLTI, SLTU, and SLTIU events.
memory_instr_events: Vec<MemInstrEvent>
A trace of the memory instructions.
auipc_events: Vec<AUIPCEvent>
A trace of the AUIPC events.
branch_events: Vec<BranchEvent>
A trace of the branch events.
jump_events: Vec<JumpEvent>
A trace of the jump events.
byte_lookups: HashMap<ByteLookupEvent, usize>
A trace of the byte lookups that are needed.
precompile_events: PrecompileEvents
A trace of the precompile events.
global_memory_initialize_events: Vec<MemoryInitializeFinalizeEvent>
A trace of the global memory initialize events.
global_memory_finalize_events: Vec<MemoryInitializeFinalizeEvent>
A trace of the global memory finalize events.
cpu_local_memory_access: Vec<MemoryLocalEvent>
A trace of all the shard’s local memory events.
syscall_events: Vec<SyscallEvent>
A trace of all the syscall events.
global_interaction_events: Vec<GlobalInteractionEvent>
A trace of all the global interaction events.
public_values: PublicValues<u32, u32>
The public values.
next_nonce: u64
The next nonce to use for a new lookup.
shape: Option<Shape<RiscvAirId>>
The shape of the proof.
counts: Option<EnumMap<RiscvAirId, u64>>
The predicted counts of the proof.
Implementations§
Source§impl ExecutionRecord
impl ExecutionRecord
Sourcepub fn new(program: Arc<Program>) -> Self
pub fn new(program: Arc<Program>) -> Self
Create a new ExecutionRecord
.
Sourcepub fn defer(&mut self) -> ExecutionRecord
pub fn defer(&mut self) -> ExecutionRecord
Take out events from the ExecutionRecord
that should be deferred to a separate shard.
Note: we usually defer events that would increase the recursion cost significantly if included in every shard.
Sourcepub fn split(
&mut self,
last: bool,
last_record: Option<&mut ExecutionRecord>,
opts: SplitOpts,
) -> Vec<ExecutionRecord>
pub fn split( &mut self, last: bool, last_record: Option<&mut ExecutionRecord>, opts: SplitOpts, ) -> Vec<ExecutionRecord>
Splits the deferred ExecutionRecord
into multiple ExecutionRecord
s, each which
contain a “reasonable” number of deferred events.
The optional last_record
will be provided if there are few enough deferred events that
they can all be packed into the already existing last record.
Sourcepub fn fixed_log2_rows<F: PrimeField, A: MachineAir<F>>(
&self,
air: &A,
) -> Option<usize>
pub fn fixed_log2_rows<F: PrimeField, A: MachineAir<F>>( &self, air: &A, ) -> Option<usize>
Return the number of rows needed for a chip, according to the proof shape specified in the struct.
Sourcepub fn contains_cpu(&self) -> bool
pub fn contains_cpu(&self) -> bool
Determines whether the execution record contains CPU events.
Sourcepub fn add_precompile_event(
&mut self,
syscall_code: SyscallCode,
syscall_event: SyscallEvent,
event: PrecompileEvent,
)
pub fn add_precompile_event( &mut self, syscall_code: SyscallCode, syscall_event: SyscallEvent, event: PrecompileEvent, )
Add a precompile event to the execution record.
Sourcepub fn get_precompile_events(
&self,
syscall_code: SyscallCode,
) -> &Vec<(SyscallEvent, PrecompileEvent)>
pub fn get_precompile_events( &self, syscall_code: SyscallCode, ) -> &Vec<(SyscallEvent, PrecompileEvent)>
Get all the precompile events for a syscall code.
Sourcepub fn get_local_mem_events(&self) -> impl Iterator<Item = &MemoryLocalEvent>
pub fn get_local_mem_events(&self) -> impl Iterator<Item = &MemoryLocalEvent>
Get all the local memory events.
Trait Implementations§
Source§impl ByteRecord for ExecutionRecord
impl ByteRecord for ExecutionRecord
Source§fn add_byte_lookup_event(&mut self, blu_event: ByteLookupEvent)
fn add_byte_lookup_event(&mut self, blu_event: ByteLookupEvent)
ByteLookupEvent
to the record.Source§fn add_byte_lookup_events_from_maps(
&mut self,
new_events: Vec<&HashMap<ByteLookupEvent, usize>>,
)
fn add_byte_lookup_events_from_maps( &mut self, new_events: Vec<&HashMap<ByteLookupEvent, usize>>, )
ByteLookupEvent
maps to the record.Source§fn add_byte_lookup_events(&mut self, blu_events: Vec<ByteLookupEvent>)
fn add_byte_lookup_events(&mut self, blu_events: Vec<ByteLookupEvent>)
ByteLookupEvent
s to the record.Source§fn add_u8_range_check(&mut self, a: u8, b: u8)
fn add_u8_range_check(&mut self, a: u8, b: u8)
ByteLookupEvent
to verify a
and b
are indeed bytes to the shard.Source§fn add_u16_range_check(&mut self, a: u16)
fn add_u16_range_check(&mut self, a: u16)
ByteLookupEvent
to verify a
is indeed u16.Source§fn add_u8_range_checks(&mut self, bytes: &[u8])
fn add_u8_range_checks(&mut self, bytes: &[u8])
ByteLookupEvent
s to verify that all the bytes in the input slice are indeed bytes.Source§fn add_u8_range_checks_field<F: PrimeField32>(&mut self, field_values: &[F])
fn add_u8_range_checks_field<F: PrimeField32>(&mut self, field_values: &[F])
ByteLookupEvent
s to verify that all the field elements in the input slice are indeed
bytes.Source§fn add_u16_range_checks(&mut self, ls: &[u16])
fn add_u16_range_checks(&mut self, ls: &[u16])
ByteLookupEvent
s to verify that all the bytes in the input slice are indeed bytes.Source§impl Clone for ExecutionRecord
impl Clone for ExecutionRecord
Source§fn clone(&self) -> ExecutionRecord
fn clone(&self) -> ExecutionRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ExecutionRecord
impl Debug for ExecutionRecord
Source§impl Default for ExecutionRecord
impl Default for ExecutionRecord
Source§fn default() -> ExecutionRecord
fn default() -> ExecutionRecord
Source§impl<'de> Deserialize<'de> for ExecutionRecord
impl<'de> Deserialize<'de> for ExecutionRecord
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>,
Source§impl MachineRecord for ExecutionRecord
impl MachineRecord for ExecutionRecord
Source§fn public_values<F: AbstractField>(&self) -> Vec<F>
fn public_values<F: AbstractField>(&self) -> Vec<F>
Retrieves the public values. This method is needed for the MachineRecord
trait, since
Source§type Config = SP1CoreOpts
type Config = SP1CoreOpts
Source§fn append(&mut self, other: &mut ExecutionRecord)
fn append(&mut self, other: &mut ExecutionRecord)
Source§fn register_nonces(&mut self, _opts: &Self::Config)
fn register_nonces(&mut self, _opts: &Self::Config)
Auto Trait Implementations§
impl Freeze for ExecutionRecord
impl RefUnwindSafe for ExecutionRecord
impl Send for ExecutionRecord
impl Sync for ExecutionRecord
impl Unpin for ExecutionRecord
impl UnwindSafe for ExecutionRecord
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