Mavryk_raw_protocol_alpha.Sc_rollup_PVM_sigThis module introduces the semantics of Proof-generating Virtual Machines.
A PVM defines an operational semantics for some computational model. The specificity of PVMs, in comparison with standard virtual machines, is their ability to generate and to validate a *compact* proof that a given atomic execution step turned a given state into another one.
In the smart-contract rollups, PVMs are used for two purposes:
An input to a PVM is the message_counter element of an inbox at a given inbox_level and contains a given payload.
According the rollup management protocol, the payload must be obtained through Sc_rollup_inbox_message_repr.serialize which follows a documented format.
type inbox_message = {inbox_level : Raw_level_repr.t;message_counter : Mavryk_protocol_environment_alpha.Z.t;payload : Sc_rollup_inbox_message_repr.serialized;}type reveal_data = | Raw_data of string| Metadata of Sc_rollup_metadata_repr.t| Dal_page of Dal_slot_repr.Page.content option| Dal_parameters of Sc_rollup_dal_parameters_repr.tval pp_inbox_message :
Mavryk_protocol_environment_alpha.Format.formatter ->
inbox_message ->
unitval pp_reveal_data :
Mavryk_protocol_environment_alpha.Format.formatter ->
reveal_data ->
unitval pp_input :
Mavryk_protocol_environment_alpha.Format.formatter ->
input ->
unitval inbox_message_encoding :
inbox_message Mavryk_protocol_environment_alpha.Data_encoding.encodinginbox_message_encoding encoding value for inbox_message.
val reveal_data_encoding :
reveal_data Mavryk_protocol_environment_alpha.Data_encoding.encodingval input_encoding :
input Mavryk_protocol_environment_alpha.Data_encoding.encodingval inbox_message_equal : inbox_message -> inbox_message -> boolinput_equal i1 i2 return whether i1 and i2 are equal.
val reveal_data_equal : reveal_data -> reveal_data -> booltype reveal = | Reveal_raw_data of Sc_rollup_reveal_hash.t| Reveal_metadata| Request_dal_page of Dal_slot_repr.Page.t| Reveal_dal_parametersRequest DAL parameters that were used for the slots published at the current inbox level.
*)val reveal_encoding :
reveal Mavryk_protocol_environment_alpha.Data_encoding.encodingtype is_reveal_enabled = current_block_level:Raw_level_repr.t -> reveal -> boolis_reveal_enabled is the type of a predicate that tells if a kind of reveal is activated at a certain block level.
val is_reveal_enabled_predicate :
Constants_parametric_repr.sc_rollup_reveal_activation_level ->
is_reveal_enabledtype input_request = | No_input_required| Initial| First_after of Raw_level_repr.t * Mavryk_protocol_environment_alpha.Z.t| Needs_reveal of revealThe PVM's current input expectations:
No_input_required if the machine is busy and has no need for new input.Initial if the machine has never received an input so expects the very first item in the inbox.First_after (level, counter) expects whatever comes next after that position in the inbox.Needs_metadata if the machine needs the metadata to continue its execution.val input_request_encoding :
input_request Mavryk_protocol_environment_alpha.Data_encoding.encodinginput_request_encoding encoding value for input_request.
val pp_reveal :
Mavryk_protocol_environment_alpha.Format.formatter ->
reveal ->
unitval pp_input_request :
Mavryk_protocol_environment_alpha.Format.formatter ->
input_request ->
unitpp_input_request fmt i pretty prints the given input i to the formatter fmt.
val input_request_equal : input_request -> input_request -> boolinput_request_equal i1 i2 return whether i1 and i2 are equal.
type output = {outbox_level : Raw_level_repr.t;The outbox level containing the message. The level corresponds to the inbox level for which the message was produced.
*)message_index : Mavryk_protocol_environment_alpha.Z.t;The message index.
*)message : Sc_rollup_outbox_message_repr.t;The message itself.
*)}Type that describes output values.
val output_encoding :
output Mavryk_protocol_environment_alpha.Data_encoding.encodingoutput_encoding encoding value for output.
val pp_output :
Mavryk_protocol_environment_alpha.Format.formatter ->
output ->
unitpp_output fmt o pretty prints the given output o to the formatter fmt.
module type S = sig ... endmodule type Generic_pvm_context_sig = sig ... end