package octez-l2-libs
Representation of errors of the WASM PVM.
Stuck messages are purely informational, but can be arbitrary long since they come from error messages from the interpreter or caught exceptions. To ensure they fit in an L1 operation, we truncate them after messages_maximum_size
.
Representation of truncated strings of maximum length messages_maximum_size
. Can only be built through truncate_message
.
val truncate_message : string -> truncated_string
truncate_message m
builds a truncated message out of a given message m
.
type raw_exception := truncated_string
Raw exception as printed by `Printexc.to_string`, possibly truncated.
type explanation := truncated_string
Embedded message in the exception, possibly truncated.
Wrapped exceptions from the interpreter. Both labels are truncated after messages_maximum_size
.
type fallback_cause =
| Decode_cause of interpreter_error
(*Wraps exceptions raised during parsing.
*)| Link_cause of explanation
(*Errors or possible raw exceptions raised during linking.
*)| Init_cause of interpreter_error
(*Wraps exceptions raised during initialization.
*)
type t =
| Decode_error of interpreter_error
(*Wraps exceptions raised during parsing.
*)| Link_error of explanation
(*Errors or possible raw exceptions raised during linking.
*)| Init_error of interpreter_error
(*Wraps exceptions raised during initialization.
*)| Eval_error of interpreter_error
(*Wraps exceptions raised during evaluation.
*)| Invalid_state of explanation
(*Invalid state of the PVM (waiting for input during the parsing for example).
*)| Unknown_error of raw_exception
(*Wraps unexpected exceptions raised by the interpreter.
*)| Too_many_ticks
(*The maximum number of ticks was reached before the end of current top level call
*)| Too_many_reboots
(*The maximum number of reboots was reached before the next inputs
*)| No_fallback_kernel of fallback_cause
(*No fallback kernel was available - recovering from invalid kernel module not possible.
*)
val invalid_state : string -> t
val link_error :
[ `Item | `Module ] ->
module_name:string ->
item_name:string ->
t
val extract_interpreter_error :
exn ->
[ `Interpreter of interpreter_error | `Unknown of raw_exception ]
extract_interpreter_error exn
returns the source of the exception (either a known interpreter error or an unknown one) and its encodable representation. raw_exception
is truncated after messages_maximum_size
.
val encoding : t Tezos_base.TzPervasives.Data_encoding.t