Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Errors

Four error types matter to a caller. ExecutionError comes from the engine during execution and reaches a caller wrapped in LeeError::InvalidProgramBehavior (except EmptyValidityWindowIntersection, which becomes LeeError::OutOfValidityWindow). InvalidTransaction comes from the checks before execution and reaches a caller as LeeError::InvalidInput carrying its message. ClassifyError comes from fee classification, before execution; a client sees its message, not its name. LeeError is everything else: proving, validation, serialization, settlement.

Sources: lee/state_machine/core/src/execution_state.rs, lee/state_machine/src/transaction_message.rs, lez/chain_state/src/classify.rs and lee/state_machine/src/error.rs.

Common errors

ErrorWhat happened
ProgramExecutionFailed("Guest panicked: <msg>")your handler’s assertion failed, and <msg> is yours. Write assertions that name the check
UndeclaredActora SyncMessage to an actor the transaction did not declare and so cannot run
UnheldGranta SyncMessage attaches a grant its sender does not hold
UnsignedAuthority (InvalidTransaction, as is the next, from lee/state_machine/src/transaction_message.rs)an actor marked Signer whose account did not sign
DuplicateActorthe same actor declared twice
UnmarkedPrivateSignera declared private signer that no authorized witness marks
TransitionInputMismatcha handler’s proof was made for a different input
BoundaryMismatch, CrossMessageMismatchthe public side did not do what the proof assumed
LoaderOutsidePublicExecutiona message to the program loader inside a private transaction
UnboundAsyncDestinationan AsyncMessage from a public actor to an address with no recovery binding on chain and none introduced by the same transaction, so it cannot be stored; this includes any undeclared public account. Raised at settlement, so it is a LeeError, not an ExecutionError
UnadmittedPublicActora public actor the transaction touched without admitting it: a message to a public account that does not exist and came with no evidence
MissingFeeDeclaration (ClassifyError, as are the next four)a user public transaction whose lee::public_transaction::Message was built with the fee-exempt Message::try_new instead of Message::try_new_with_fees
MissingPrivateFeea privacy-preserving transaction with no fee reserve crossing to the fee inbox
TooManyPrivateActionsmore than eight private actions in one transaction
InvalidFeeFallbackthe fallback a proof names does not pay exactly the reserve priced for it
InvalidRefundTargeta refund aimed at a restricted account: the clock, the fee state, escrow or inbox account, or the bridge
OutOfGasthe transaction exceeded its declared gas_limit
OutOfValidityWindowthe block or timestamp fell outside the window the handler set, or two handlers’ windows do not overlap (EmptyValidityWindowIntersection, which a caller sees as this)
UnknownPrograma message in public execution to a program the sequencer cannot load, such as a shadow program’s public effect. Named at the transaction root it is refused uncharged; reached later it is chargeable, so it reverts and pays wherever the transaction can revert (Where an error surfaces)
MaxAccountNonceReachedan account’s nonce is exhausted
InvalidPrivacyPreservingProofa disclosed program image no longer matches the program deployed at that account id (it was upgraded after proving), or the proof did not verify against the journal the sequencer rebuilt: a proof for other inputs, a journal altered after proving, a receipt that is not succinct, or a dev-mode receipt at a sequencer not running in dev mode

Engine errors in full

ErrorMeaning
PublicActorStateUnavailablethe engine was asked to run a public actor’s handler where no public state is supplied, as inside the proof (below)
DuplicateWitnesstwo private witnesses derive the same account
FamilyBindingConflicttwo different accounts resolve under the same program and PDA seed in one transaction
PublicFamilyMemberDeclaredthe transaction uses a private PDA and declares the public PDA of the same program and seed
AliasCollisiona blinded address is also a declared account, or names two different accounts
MissingSenderPresentationno presentation (plain or blinded) was supplied for a private sender
LoaderOutsidePublicExecutionthe program loader reached in a private or mixed transaction
UndeclaredActora delivery to an actor that is neither declared public nor private
UnadmittedPublicActora delivery to a declared public account that was not admitted
UnreachedPromotiona promotion selects an async message the execution never sent
TransitionInputMismatcha handler echoed an input it was not given
EmptyValidityWindowIntersectionthe handlers’ validity windows do not overlap
PublicAndPrivatean account is declared public and also has a private witness
MissingPredictedCrossMessages, UnusedPredictedCrossMessagesthe prover’s predicted messages from the public side are missing for a public segment, or supplied for one the execution never entered
UndeclaredCrossMessageSendera predicted message comes from an actor that is not declared public
UnmarkedPrivateSignera declared private signer that no authorized witness marks
UnheldGranta sync message attaches a grant its sender does not hold
UnwitnessedFeePayer, FeePayerWithoutAuthorizationthe fee payer is not a witnessed private account, or its witness lacks the authorization key
BoundaryMismatch, CrossMessageMismatch, IncompleteBoundarya boundary step, or the message at it, does not match the execution, or the execution did not consume the boundary exactly

The predicted message and boundary errors (MissingPredictedCrossMessages, UnusedPredictedCrossMessages, UndeclaredCrossMessageSender, BoundaryMismatch, CrossMessageMismatch, IncompleteBoundary) mean the prover and the sequencer disagree about what crossed, usually because a client built the transaction by hand rather than through the wallet.

PublicActorStateUnavailable means an execution holding no public state, such as the prover’s, reached a public actor’s handler. A correctly built private transaction never does: the proof holds no public actor state and runs no public handler. A message to a public actor crosses the boundary, and what the public side sends back is predicted at proving time and checked by the sequencer at settlement against live state (A reply from public to private is fixed at proving time, The boundary).

LeeError in full

InvalidInput, OutOfGas, InvalidProgramBehavior, MessageSerializationError, InvalidPrivateKey, Io, BoundaryTooLong, InvalidPublicKey, InvalidHexPublicKey, ProgramWriteInputFailed, ProgramExecutionFailed, ProgramExitedWithCode, ProgramProveFailed, TransactionDeserializationError, Core, CircuitOutputDeserializationError, InvalidPrivacyPreservingProof, CircuitProvingError, InvalidProgramBytecode, ProgramAlreadyExists, MaxAccountNonceReached, OutOfValidityWindow, UnknownProgram, UnboundAsyncDestination.

Tooling errors

Program bytecode splits into N segment(s) but M were supplied (SegmentChainError::CountMismatch, in lee/program_loader) from a deploy whose --segments count does not match the chunk count. The wallet checks it before sending anything and reports the number expected. Deploying has the rest of the deploy rules.

Where an error surfaces

It depends on where the handler ran. For a public transaction it runs on the sequencer, so a panic appears in the sequencer’s output as the guest printed it:

thread 'main' (1) panicked at …/hello_world_with_authorization.rs:15:5:
Missing required authorization

The transaction is still included and pays its fee. So does one whose effects would change a guarded system account (the clock, a fee account, bridge state or the system registry, outside the system transactions that own them): it reverts rather than being refused.

For a private transaction the handler runs on your machine, so a panic comes back as a local prover error before anything is submitted. This example does not show it privately: run with run_hello_world_private on a private account the wallet owns, hello_world_with_authorization succeeds, because the owner’s witness authorizes the account. That is the faster loop, and why developing against a private account with RISC0_DEV_MODE=1 is often quicker than against a public one.

A private transaction refused before or at proof verification is not included: nothing changed, nothing was charged, and it can be resubmitted. One whose proof verifies but whose public part then fails in a chargeable way is included as a revert and pays, through its proven fee fallback or its declared fee; with neither it is refused. Two failures after verification are still refused: a public root naming a program the sequencer cannot load, and effects that would change a guarded system account in a transaction that pays inside its proof.