Mavkit_smart_rollup_node.Simulation
type info_per_level = {
predecessor_timestamp : Mavryk_base.Time.Protocol.t;
predecessor : Mavryk_base.TzPervasives.Block_hash.t;
}
type t = {
node_ctxt : Node_context.ro;
ctxt : Mavryk_layer2_store.Context.ro;
inbox_level : int32;
state : Mavryk_layer2_store.Context.pvmstate;
reveal_map : string Utils.Reveal_hash_map.t option;
nb_messages_inbox : int;
level_position : level_position;
info_per_level : info_per_level;
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.