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
impl ExecutionRecord
sourcepub fn new(program: Arc<Program>) -> Self
pub fn new(program: Arc<Program>) -> Self
Create a new ExecutionRecord
.
sourcepub fn add_mul_event(&mut self, mul_event: AluEvent)
pub fn add_mul_event(&mut self, mul_event: AluEvent)
Add a mul event to the execution record.
sourcepub fn add_lt_event(&mut self, lt_event: AluEvent)
pub fn add_lt_event(&mut self, lt_event: AluEvent)
Add a lt event to the execution record.
sourcepub fn add_alu_events(&mut self, alu_events: HashMap<Opcode, Vec<AluEvent>>)
pub fn add_alu_events(&mut self, alu_events: HashMap<Opcode, Vec<AluEvent>>)
Add a batch of alu events to the execution record.
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, opts: SplitOpts) -> Vec<ExecutionRecord>
pub fn split(&mut self, last: bool, opts: SplitOpts) -> Vec<ExecutionRecord>
Splits the deferred ExecutionRecord
into multiple ExecutionRecord
s, each which
contain a “reasonable” number of deferred 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_sharded_byte_lookup_events(
&mut self,
new_events: Vec<&HashMap<u32, HashMap<ByteLookupEvent, usize>>>,
)
fn add_sharded_byte_lookup_events( &mut self, new_events: Vec<&HashMap<u32, HashMap<ByteLookupEvent, usize>>>, )
ByteLookupEvent
s 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, shard: u32, channel: u8, a: u8, b: u8)
fn add_u8_range_check(&mut self, shard: u32, channel: u8, a: u8, b: u8)
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)
fn add_u16_range_check(&mut self, shard: u32, channel: u8, a: u16)
ByteLookupEvent
to verify a
is indeed u16.source§fn add_u8_range_checks(&mut self, shard: u32, channel: u8, bytes: &[u8])
fn add_u8_range_checks(&mut self, shard: u32, channel: u8, 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,
shard: u32,
channel: u8,
field_values: &[F],
)
fn add_u8_range_checks_field<F: PrimeField32>( &mut self, shard: u32, channel: u8, field_values: &[F], )
ByteLookupEvent
s to verify that all the field elements 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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