Mavryk_raw_protocol_alpha.Sc_rollup_inbox_merkelized_payload_hashes_reprA type representing the head of a merkelized list of Sc_rollup_inbox_message_repr.serialized message. It contains the hash of the payload and the index on the list.
val encoding : t Mavryk_protocol_environment_alpha.Data_encoding.tmodule History : sig ... endA History.t is a lookup table of merkelized_and_payloads. Payloads are indexed by their hash Hash.t. This history is needed in order to produce proof.
hash merkelized is the hash of merkelized. It is used as key to remember a merkelized payload hash in an History.t.
val remember :
History.t ->
t ->
Sc_rollup_inbox_message_repr.serialized ->
History.t Mavryk_protocol_environment_alpha.Error_monad.tzresultremember history merkelized payload remembers the {merkelized; payload} in history with key hash merkelized.
val genesis_no_history : Sc_rollup_inbox_message_repr.serialized -> tgenesis_no_history payload is the initial merkelized payload hashes with index 0.
val genesis :
History.t ->
Sc_rollup_inbox_message_repr.serialized ->
(History.t * t) Mavryk_protocol_environment_alpha.Error_monad.tzresultgenesis history payload is the initial merkelized payload hashes with index 0. It is remembered in history using remember.
val add_payload_no_history : t -> Sc_rollup_inbox_message_repr.serialized -> tadd_payload_no_history merkelized payload creates a new t with payload and merkelized as ancestor (i.e. index = succ (get_index
merkelized)).
val add_payload :
History.t ->
t ->
Sc_rollup_inbox_message_repr.serialized ->
(History.t * t) Mavryk_protocol_environment_alpha.Error_monad.tzresultadd_payload is identical to add_payload_no_history but the resulting merkelized is remembered in history with remember.
val pp : Mavryk_protocol_environment_alpha.Format.formatter -> t -> unitval get_payload_hash : t -> Sc_rollup_inbox_message_repr.Hash.tget_payload_hash merkelized returns the Sc_rollup_inbox_message_repr.serialized payload's hash of merkelized.
val get_index : t -> Mavryk_protocol_environment_alpha.Z.tget_index merkelized returns the index of merkelized.
type proof = private t listGiven two t (a, b) and a Sc_rollup_inbox_message_repr.serialized payload, a proof guarantees that payload hash is equal to a and that a is an ancestor of b; i.e. get_index a < get_index b.
val pp_proof :
Mavryk_protocol_environment_alpha.Format.formatter ->
proof ->
unitval proof_encoding : proof Mavryk_protocol_environment_alpha.Data_encoding.tval produce_proof :
History.t ->
index:Mavryk_protocol_environment_alpha.Z.t ->
t ->
(merkelized_and_payload * proof) optionproduce_proof history ~index into_ returns a merkelized_and_payload with index index and a proof that it is an ancestor of into_. Returns None if no merkelized payload with index is found (either in the history or index is not inferior to get_index into_).
val verify_proof :
proof ->
(t * t) Mavryk_protocol_environment_alpha.Error_monad.tzresultverify_proof proof returns (a, b) where proof validates that a is an ancestor of b. Fails when proof is not a valid inclusion proof.
module Internal_for_tests : sig ... end