Struct ExecutionRecord

Source
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

Source

pub fn new(program: Arc<Program>) -> Self

Create a new ExecutionRecord.

Source

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.

Source

pub fn split( &mut self, last: bool, last_record: Option<&mut ExecutionRecord>, opts: SplitOpts, ) -> Vec<ExecutionRecord>

Splits the deferred ExecutionRecord into multiple ExecutionRecords, 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.

Source

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.

Source

pub fn contains_cpu(&self) -> bool

Determines whether the execution record contains CPU events.

Source

pub fn add_precompile_event( &mut self, syscall_code: SyscallCode, syscall_event: SyscallEvent, event: PrecompileEvent, )

Add a precompile event to the execution record.

Source

pub fn get_precompile_events( &self, syscall_code: SyscallCode, ) -> &Vec<(SyscallEvent, PrecompileEvent)>

Get all the precompile events for a syscall code.

Source

pub fn get_local_mem_events(&self) -> impl Iterator<Item = &MemoryLocalEvent>

Get all the local memory events.

Trait Implementations§

Source§

impl ByteRecord for ExecutionRecord

Source§

fn add_byte_lookup_event(&mut self, blu_event: ByteLookupEvent)

Adds a new ByteLookupEvent to the record.
Source§

fn add_byte_lookup_events_from_maps( &mut self, new_events: Vec<&HashMap<ByteLookupEvent, usize>>, )

Adds a list of ByteLookupEvent maps to the record.
Source§

fn add_byte_lookup_events(&mut self, blu_events: Vec<ByteLookupEvent>)

Adds a list of ByteLookupEvents to the record.
Source§

fn add_u8_range_check(&mut self, a: u8, b: u8)

Adds a ByteLookupEvent to verify a and b are indeed bytes to the shard.
Source§

fn add_u16_range_check(&mut self, a: u16)

Adds a ByteLookupEvent to verify a is indeed u16.
Source§

fn add_u8_range_checks(&mut self, bytes: &[u8])

Adds ByteLookupEvents 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])

Adds ByteLookupEvents to verify that all the field elements in the input slice are indeed bytes.
Source§

fn add_u16_range_checks(&mut self, ls: &[u16])

Adds ByteLookupEvents to verify that all the bytes in the input slice are indeed bytes.
Source§

fn lookup_or(&mut self, b: u8, c: u8)

Adds a ByteLookupEvent to compute the bitwise OR of the two input values.
Source§

impl Clone for ExecutionRecord

Source§

fn clone(&self) -> ExecutionRecord

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 Debug for ExecutionRecord

Source§

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

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

impl Default for ExecutionRecord

Source§

fn default() -> ExecutionRecord

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

impl<'de> Deserialize<'de> for ExecutionRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl MachineRecord for ExecutionRecord

Source§

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

The configuration of the machine.
Source§

fn stats(&self) -> HashMap<String, usize>

The statistics of the record.
Source§

fn append(&mut self, other: &mut ExecutionRecord)

Appends two records together.
Source§

fn register_nonces(&mut self, _opts: &Self::Config)

Registers the nonces of the record.
Source§

impl Serialize for ExecutionRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> JsonSchemaMaybe for T