sp1_core_executor/
errors.rs1use serde::{Deserialize, Serialize};
4use thiserror::Error;
5
6use crate::Opcode;
7
8#[derive(Error, Debug, Serialize, Deserialize, PartialEq, Eq)]
10pub enum ExecutionError {
11 #[error("invalid memory access for opcode {0} and address {1}")]
13 InvalidMemoryAccess(Opcode, u64),
14
15 #[error("invalid memory access for untrusted program at address {0}, not aligned to 4 bytes")]
17 InvalidMemoryAccessUntrustedProgram(u64),
18
19 #[error("unimplemented syscall {0}")]
21 UnsupportedSyscall(u32),
22
23 #[error("breakpoint encountered")]
25 Breakpoint(),
26
27 #[error("exceeded cycle limit of {0}")]
29 ExceededCycleLimit(u64),
30
31 #[error("syscall called in unconstrained mode")]
33 InvalidSyscallUsage(u64),
34
35 #[error("got unimplemented as opcode")]
37 Unimplemented(),
38
39 #[error("program ended in unconstrained mode")]
41 EndInUnconstrained(),
42
43 #[error("unconstrained cycle limit exceeded")]
45 UnconstrainedCycleLimitExceeded(u64),
46
47 #[error("Unexpected exit code: {0}")]
49 UnexpectedExitCode(u32),
50
51 #[error("Instruction not found, page protect/ untrusted program set to off")]
53 InstructionNotFound(),
54
55 #[error("Running executor in non-sharding state, but got a shard boundary or trace end")]
57 InvalidShardingState(),
58
59 #[error("{0}")]
61 Other(String),
62}