Module Mavkit_smart_rollup_node.Simulation

type level_position =
  1. | Start
  2. | Middle
  3. | End
type info_per_level = {
  1. predecessor_timestamp : Mavryk_base.Time.Protocol.t;
  2. predecessor : Mavryk_base.TzPervasives.Block_hash.t;
}
type t = {
  1. node_ctxt : Node_context.ro;
  2. ctxt : Mavryk_layer2_store.Context.ro;
  3. inbox_level : int32;
  4. state : Mavryk_layer2_store.Context.pvmstate;
  5. reveal_map : string Utils.Reveal_hash_map.t option;
  6. nb_messages_inbox : int;
  7. level_position : level_position;
  8. info_per_level : info_per_level;
  9. plugin : (module Protocol_plugin_sig.S);
}

Type of the state for a simulation.

val start_simulation : Node_context.ro -> reveal_map:string Utils.Reveal_hash_map.t option -> ?log_kernel_debug_file:string -> Layer1.head -> t Mavryk_base.TzPervasives.tzresult Lwt.t

start_simulation node_ctxt ~reveal_map ?log_kernel_debug_file block starts a new simulation on top of block, i.e. for an hypothetical new inbox (level). If log_kernel_debug_file is provided, kernel logs will be written to node_ctxt.data_dir/simulation_kernel_logs/log_kernel_debug_file.

val simulate_messages : t -> string list -> (t * Z.t) Mavryk_base.TzPervasives.tzresult Lwt.t

simulate_messages sim messages runs a simulation of new messages in the given simulation (state) sim and returns a new simulation state, the remaining fuel (when ?fuel is provided) and the number of ticks that happened.

val end_simulation : t -> (t * Z.t) Mavryk_base.TzPervasives.tzresult Lwt.t

end_simulation sim adds and End_of_level message and marks the simulation as ended.