Struct sp1_core_executor::ExecutionRecord

source ·
pub struct ExecutionRecord {
Show 35 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 byte_lookups: HashMap<u32, HashMap<ByteLookupEvent, usize>>, pub sha_extend_events: Vec<ShaExtendEvent>, pub sha_compress_events: Vec<ShaCompressEvent>, pub keccak_permute_events: Vec<KeccakPermuteEvent>, pub ed_add_events: Vec<EllipticCurveAddEvent>, pub ed_decompress_events: Vec<EdDecompressEvent>, pub secp256k1_add_events: Vec<EllipticCurveAddEvent>, pub secp256k1_double_events: Vec<EllipticCurveDoubleEvent>, pub bn254_add_events: Vec<EllipticCurveAddEvent>, pub bn254_double_events: Vec<EllipticCurveDoubleEvent>, pub k256_decompress_events: Vec<EllipticCurveDecompressEvent>, pub bls12381_add_events: Vec<EllipticCurveAddEvent>, pub bls12381_double_events: Vec<EllipticCurveDoubleEvent>, pub uint256_mul_events: Vec<Uint256MulEvent>, pub memory_initialize_events: Vec<MemoryInitializeFinalizeEvent>, pub memory_finalize_events: Vec<MemoryInitializeFinalizeEvent>, pub bls12381_decompress_events: Vec<EllipticCurveDecompressEvent>, pub bls12381_fp_events: Vec<FpOpEvent>, pub bls12381_fp2_addsub_events: Vec<Fp2AddSubEvent>, pub bls12381_fp2_mul_events: Vec<Fp2MulEvent>, pub bn254_fp_events: Vec<FpOpEvent>, pub bn254_fp2_addsub_events: Vec<Fp2AddSubEvent>, pub bn254_fp2_mul_events: Vec<Fp2MulEvent>, pub public_values: PublicValues<u32, u32>, pub nonce_lookup: HashMap<LookupId, u32>,
}
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.

§byte_lookups: HashMap<u32, HashMap<ByteLookupEvent, usize>>

A trace of the byte lookups that are needed.

§sha_extend_events: Vec<ShaExtendEvent>

A trace of the sha256 extend events.

§sha_compress_events: Vec<ShaCompressEvent>

A trace of the sha256 compress events.

§keccak_permute_events: Vec<KeccakPermuteEvent>

A trace of the keccak256 permute events.

§ed_add_events: Vec<EllipticCurveAddEvent>

A trace of the edwards add events.

§ed_decompress_events: Vec<EdDecompressEvent>

A trace of the edwards decompress events.

§secp256k1_add_events: Vec<EllipticCurveAddEvent>

A trace of the secp256k1 add events.

§secp256k1_double_events: Vec<EllipticCurveDoubleEvent>

A trace of the secp256k1 double events.

§bn254_add_events: Vec<EllipticCurveAddEvent>

A trace of the bn254 add events.

§bn254_double_events: Vec<EllipticCurveDoubleEvent>

A trace of the bn254 double events.

§k256_decompress_events: Vec<EllipticCurveDecompressEvent>

A trace of the k256 decompress events.

§bls12381_add_events: Vec<EllipticCurveAddEvent>

A trace of the bls12381 add events.

§bls12381_double_events: Vec<EllipticCurveDoubleEvent>

A trace of the bls12381 double events.

§uint256_mul_events: Vec<Uint256MulEvent>

A trace of the uint256 mul events.

§memory_initialize_events: Vec<MemoryInitializeFinalizeEvent>

A trace of the memory initialize events.

§memory_finalize_events: Vec<MemoryInitializeFinalizeEvent>

A trace of the memory finalize events.

§bls12381_decompress_events: Vec<EllipticCurveDecompressEvent>

A trace of the bls12381 decompress events.

§bls12381_fp_events: Vec<FpOpEvent>

A trace of the bls12381 fp events.

§bls12381_fp2_addsub_events: Vec<Fp2AddSubEvent>

A trace of the bls12381 fp2 add/sub events.

§bls12381_fp2_mul_events: Vec<Fp2MulEvent>

A trace of the bls12381 fp2 mul events.

§bn254_fp_events: Vec<FpOpEvent>

A trace of the bn254 fp events.

§bn254_fp2_addsub_events: Vec<Fp2AddSubEvent>

A trace of the bn254 fp2 add/sub events.

§bn254_fp2_mul_events: Vec<Fp2MulEvent>

A trace of the bn254 fp2 mul events.

§public_values: PublicValues<u32, u32>

The public values.

§nonce_lookup: HashMap<LookupId, u32>

The nonce lookup.

Implementations§

source§

impl ExecutionRecord

source

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

Create a new ExecutionRecord.

source

pub fn add_mul_event(&mut self, mul_event: AluEvent)

Add a mul event to the execution record.

source

pub fn add_lt_event(&mut self, lt_event: AluEvent)

Add a lt event to the execution record.

source

pub fn add_alu_events(&mut self, alu_events: HashMap<Opcode, Vec<AluEvent>>)

Add a batch of alu events to the execution record.

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, opts: SplitOpts) -> Vec<ExecutionRecord>

Splits the deferred ExecutionRecord into multiple ExecutionRecords, each which contain a “reasonable” number of deferred 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_sharded_byte_lookup_events( &mut self, new_events: Vec<&HashMap<u32, HashMap<ByteLookupEvent, usize>>>, )

Adds a list of sharded ByteLookupEvents 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, shard: u32, channel: u8, 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, shard: u32, channel: u8, a: u16)

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

fn add_u8_range_checks(&mut self, shard: u32, channel: u8, 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, shard: u32, channel: u8, 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, shard: u32, channel: u8, ls: &[u16])

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

fn lookup_or(&mut self, shard: u32, channel: u8, 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 copy 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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 + Sync + Send>

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