Expand description
An implementation of an exucutor for the SP1 RISC-V zkVM.
Modules§
- estimator
- Data that may be collected during execution and used to estimate trace area.
- events
- Type definitions for the events emitted by the
crate::Executor
during execution. - subproof
- Types and methods for subproof verification inside the
crate::Executor
. - syscalls
- Syscall definitions & implementations for the
crate::Executor
.
Structs§
- Core
AirId Convert Error - An error type used for converting from
RiscvAirId
toCoreAirId
. - Core
AirId Iter - An iterator over the variants of CoreAirId
- Execution
Record - A record of the execution of a program.
- Execution
Report - An execution report.
- Execution
State - Holds data describing the current state of a program’s execution.
- Executor
- An executor for the SP1 RISC-V zkVM.
- Fork
State - Holds data to track changes made to the runtime since a fork point.
- HookEnv
- Environment that a hook may read from.
- Hook
Registry - A registry of hooks to call, indexed by the file descriptors through which they are accessed.
- Instruction
- RISC-V 32IM Instruction.
- IoOptions
- The IO options for the [
SP1Executor
]. - Local
Counts - Information about event counts which are relevant for shape fixing.
- Maximal
Shapes - Defines a set of maximal shapes for generating core proofs.
- Memory
Access Record - A memory access record.
- Program
- A program that can be executed by the SP1 zkVM.
- Riscv
AirId Iter - An iterator over the variants of RiscvAirId
- SP1Context
- Context to run a program inside SP1.
- SP1Context
Builder - A builder for
SP1Context
. - SP1Reduce
Proof - An intermediate proof which proves the execution.
Enums§
- Byte
Opcode - Byte Opcode.
- Core
AirId - RV32IM AIR Identifiers.
- Deferred
Proof Verification - Whether to verify deferred proofs during execution.
- Execution
Error - Errors that the
Executor
can throw. - Executor
Mode - The different modes the executor can run in.
- Opcode
- An opcode (short for “operation code”) specifies the operation to be performed by the processor.
- Register
- A register stores a 32-bit value used by operations.
- Riscv
AirId - RV32IM AIR Identifiers.
Constants§
- DEFAULT_
PC_ INC - The default increment for the program counter. Is used for all instructions except for branches and jumps.
- FD_
BLS12_ 381_ INVERSE - The file descriptor through which to access
hook_bls12_381_inverse
. - FD_
BLS12_ 381_ SQRT - The file descriptor through which to access
hook_bls12_381_sqrt
. - FD_
ECRECOVER_ HOOK - The file descriptor through which to access
hook_ecrecover
. - FD_
EDDECOMPRESS - The file descriptor through which to access
hook_ed_decompress
. - FD_
FP_ INV - The file descriptor through which to access
hook_fp_inverse
. - FD_
FP_ SQRT - The file descriptor through which to access
hook_fp_sqrt
. - FD_HINT
- The file descriptor for hints.
- FD_
PUBLIC_ VALUES - The file descriptor for public values.
- FD_
RSA_ MUL_ MOD - The file descriptor through which to access
hook_rsa_mul_mod
. - LOWEST_
ALLOWED_ FD - The minimum file descriptor.
- MAX_
PROGRAM_ SIZE - The maximum number of instructions in a program.
- UNUSED_
PC - This is used in the
InstrEvent
to indicate that the instruction is not from the CPU. A valid pc should be divisible by 4, so we use 1 to indicate that the pc is not used.
Traits§
- Hook
- A runtime hook. May be called during execution by writing to a specified file descriptor, accepting and returning arbitrary data.
- IoWriter
- A trait for
Write
types to be used in the executor.
Functions§
- align
- Aligns an address to the nearest word below or equal to it.
- deserialize_
hashmap_ as_ vec - Deserialize a
Vec<(u32, V)>
as aHashMap<u32, V>
. - estimate_
riscv_ lde_ size - Estimates the LDE area.
- get_msb
- Calculate the most significant bit of the given 32-bit integer
a
, and returns it as a u8. - get_
quotient_ and_ remainder - Calculate the correct
quotient
andremainder
for the givenb
andc
per RISC-V spec. - hook_
ecrecover - The hook for the
ecrecover
patches. - hook_
ed_ decompress - Checks if a compressed Edwards point can be decompressed.
- hook_
rsa_ mul_ mod - Given the product of some 256-byte numbers and a modulus, this function does a modular reduction and hints back the values to the vm in order to constrain it.
- hookify
- Wrap a function in a smart pointer so it may be placed in a
HookRegistry
. - is_
signed_ operation - Returns
true
if the givenopcode
is a signed operation. - pad_
rv32im_ event_ counts - Pads the event counts to account for the worst case jump in events across N cycles.
- rv32im_
costs - Load the cost of each air from the predefined JSON.
- serialize_
hashmap_ as_ vec - Serialize a
HashMap<u32, V>
as aVec<(u32, V)>
.
Type Aliases§
- Boxed
Hook - A runtime hook, wrapped in a smart pointer.