Octez_smart_rollup_node.Interpretertype process_head_result = {num_messages : int;Number of messages consumed during evaluation.
*)num_ticks : int64;Number of ticks taken by the PVM for the evaluation.
*)initial_tick : Z.t;Tick counter of the PVM before evaluation started.
*)state_hash : Octez_smart_rollup.State_hash.t;Root hash of the PVM state after evaluation.
*)}Result of evaluating a head's messages through the PVM.
val process_head :
(module Protocol_plugin_sig.PARTIAL) ->
_ Node_context.t ->
< index : _
; state : Tezos_layer2_store.Access_mode.rw >
Tezos_layer2_store.Context.t ->
predecessor:Layer1.head ->
Layer1.head ->
(Octez_smart_rollup.Inbox.t * string list) ->
process_head_result Tezos_base.TzPervasives.tzresult Lwt.tprocess_head plugin node_ctxt ctxt ~predecessor head (inbox, messages) interprets the messages associated with a head (where predecessor is the predecessor of head in the L1 chain). This requires the inbox to be updated beforehand. NOTE: ctxt is modified in place by process_head. It is the responsibility of the caller to make a copy and revert if needed in case of error.
The genesis state can be retrieved in different variants depending on whether unsafe patches should be applied. The permission parameter tracks the access mode of the underlying PVM state.
Tag for a genesis state with patches applied.
Tag for a genesis state without patches (the original boot sector).
type ('a, 'b) both =
constraint 'a = [< `Read | `Write Read ]
constraint 'b = [< `Read | `Write Read ]Tag for requesting both the patched and unpatched genesis states.
type _ genesis_state = | Patched : 'perm Tezos_layer2_store.Context.pvmstate -> 'perm patched
genesis_stateThe PVM state after applying unsafe patches.
*)| Unpatched : 'perm Tezos_layer2_store.Context.pvmstate -> 'perm unpatched
genesis_stateThe original PVM state from the boot sector.
*)| Both : {patched : 'perm_patched Tezos_layer2_store.Context.pvmstate;original : 'perm_orig Tezos_layer2_store.Context.pvmstate;} -> ('perm_orig, 'perm_patched) both genesis_stateBoth variants at once, each with independently tracked permissions.
*)A genesis PVM state, parameterized by the requested variant.
type _ genesis_state_mode = | Patched : 'a Tezos_layer2_store.Access_mode.t -> 'a patched genesis_state_modeRequest only the patched state.
*)| Unpatched : 'a Tezos_layer2_store.Access_mode.t -> 'a unpatched
genesis_state_modeRequest only the unpatched state.
*)| Both : 'a Tezos_layer2_store.Access_mode.t
* 'b Tezos_layer2_store.Access_mode.t -> ('a, 'b) both genesis_state_modeRequest both states with potentially different access permissions.
*)Selects which genesis state variant to compute and with what access permissions.
val genesis_state :
'm genesis_state_mode ->
(module Protocol_plugin_sig.PARTIAL) ->
?genesis_block:Tezos_base.TzPervasives.Block_hash.t ->
?empty:Tezos_layer2_store.Access_mode.rw Tezos_layer2_store.Context.pvmstate ->
_ Node_context.t ->
'm genesis_state Tezos_base.TzPervasives.tzresult Lwt.tgenesis_state mode plugin ?genesis_block ?empty node_ctxt the PVM state at the genesis block with and/or without patches applied depending on mode.
val to_cached_eval_state :
Tezos_layer2_store.Context_sigs.cache_preference ->
[ `Read | `Write ] Tezos_layer2_store.Context.index ->
('fuel,
Tezos_layer2_store.Access_mode.rw Tezos_layer2_store.Context.pvmstate)
Pvm_plugin_sig.eval_state ->
'fuel Pvm_plugin_sig.cached_eval_state Lwt.tto_cached_eval_state preference ctx_index eval_st creates a cached snapshot from a mutable evaluation state. For In_memory, it makes an immutable copy. For On_disk, it commits the state to disk and stores only the hash.
val from_cached_eval_state :
_ Tezos_layer2_store.Context.index ->
'fuel Pvm_plugin_sig.cached_eval_state ->
('fuel,
Tezos_layer2_store.Access_mode.rw Tezos_layer2_store.Context.pvmstate)
Pvm_plugin_sig.eval_state
Tezos_base.TzPervasives.tzresult
Lwt.tfrom_cached_eval_state ctx_index cached restores a mutable evaluation state from a cached snapshot. For In_memory, it creates a mutable copy. For On_disk, it checkouts the state from disk.
val state_of_tick :
(module Protocol_plugin_sig.PARTIAL) ->
_ Node_context.rw_context ->
Pvm_plugin_sig.state_cache ->
?start_state:
(Fuel.Accounted.t,
Tezos_layer2_store.Access_mode.rw Tezos_layer2_store.Context.pvmstate)
Pvm_plugin_sig.eval_state ->
tick:Z.t ->
int32 ->
(Fuel.Accounted.t,
Tezos_layer2_store.Access_mode.rw Tezos_layer2_store.Context.pvmstate)
Pvm_plugin_sig.eval_state
option
Tezos_base.TzPervasives.tzresult
Lwt.tstate_of_tick plugin node_ctxt cache ?start_state ~tick level returns Some state for a given tick if this tick happened before level and where state is the PVM evaluation state before tick happened. Otherwise, returns None. If provided, the evaluation is resumed from start_state.
val state_of_head :
(module Protocol_plugin_sig.PARTIAL) ->
< context : 'a ; store : _ > Node_context.t ->
< index : 'a ; state : 'b > Tezos_layer2_store.Context.t ->
Layer1.head ->
'b Tezos_layer2_store.Context.pvmstate Tezos_base.TzPervasives.tzresult Lwt.tstate_of_head plugin node_ctxt ctxt head returns the state corresponding to the block head, or the state at rollup genesis if the block is before the rollup origination.