---
# System prepended metadata

title: error states circuit

---

# error states circuit
### common constraint
 - current call is failed(IsSuccess, IsPersistent = false)
 - restore call context if not root call(buss mapping handle restore call operations)
 - handle reversions in the lookup or step state transition
### error states list 

| type                 | constraint            |  comment |
| --------             | --------              | -------- |
| ErrorOutOfGasConstant  | 1. construct & lookup const gas table, 2. gas_left < cost gas required            |  done    |
| ErrorStackOverflow  | cur stack_point < push count          |      |
| ErrorStackUnderflow  | 1024 - stack_point < pop count           |      |
| ErrorDepth   |      call depth > 1024       |      |
| ErrorWriteProtection  | is_static = true & state write op         | revevant op: Selfdestruct, Log*, Call,Create2,Create, Sstore     |
| ErrorContractAddressCollision  |  Look up existing address        |      |
| ErrorInvalidJump  |  Look up bytecode table & constrain destination not code or JUMPDEST        |      |
| ErrorMaxCodeSizeExceeded  |  Look up bytecode length & length > MAXCodeSize        |      |
| ErrorInsufficientBalance  |  Look up balance & balance < value transfer        |      |
| ErrorInvalidCreationCode  |          |      |
| ErrorReturnDataOutOfBound  |  Look up balance & balance < value transfer        |      |
| ErrorOutOfGasCALL  |  accout access(warm/cold/new account) + memory_expansion + GasCost::CALL_WITH_VALUE        |      |
| ErrorOutOfGasStaticMemoryExpansion  |          |      |
| ErrorOutOfGasDynamicMemoryExpansion  |          |      |
| ErrorOutOfGasMemoryCopy  |         |      |
| ErrorOutOfGasCodeStore  |        | |
| ErrorOutOfGasLOG  |          |      |
| ErrorOutOfGasEXP  |         |      |
| ErrorOutOfGasSHA3  |        |      |
| ErrorOutOfGasEXTCODECOPY  |          |      |
| ErrorOutOfGasSLOAD  |         |      |
| ErrorOutOfGasSSTORE  |        |      |
| ErrorOutOfGasCALLCODE  |         |      |
| ErrorOutOfGasDELEGATECALL  |       |      |
| ErrorOutOfGasCREATE2  |          |      |
| ErrorOutOfGasSTATICCALL  |         |      |
| ErrorOutOfGasSELFDESTRUCT  |         |      |
