package tezos-protocol-020-PsParisC
type inclusion_proof = history_proof list
Given a inbox A
at some level L
and another inbox B
at some level L' >= L
, an inclusion_proof
guarantees that A
is an older version of B
.
To be more precise, an inclusion_proof
guarantees that the previous levels witness
s of A
are included in the previous levels witness
s of B
. The current witness
of A
and B
are not considered.
The size of this proof is O(log2 (L' - L)).
val pp_inclusion_proof :
Tezos_protocol_environment_020_PsParisC.Format.formatter ->
inclusion_proof ->
unit
val produce_inclusion_proof :
(Hash.t ->
history_proof option Tezos_protocol_environment_020_PsParisC.Lwt.t) ->
history_proof ->
Raw_level_repr.t ->
(inclusion_proof * history_proof)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
produce_inclusion_proof get_history a b
exploits get_history
to produce a self-contained proof that a
is an older version of b
.
val verify_inclusion_proof :
inclusion_proof ->
history_proof ->
history_proof Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
verify_inclusion_proof proof snapshot
returns A
iff proof
is a minimal and valid proof that A
is included in snapshot
, fails otherwise. A
is part of the proof.
type payloads_proof = {
proof : Sc_rollup_inbox_merkelized_payload_hashes_repr.proof;
payload : Sc_rollup_inbox_message_repr.serialized option;
}
val pp_payloads_proof :
Tezos_protocol_environment_020_PsParisC.Format.formatter ->
payloads_proof ->
unit
val produce_payloads_proof :
(Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.t ->
Sc_rollup_inbox_merkelized_payload_hashes_repr.History.t
Tezos_protocol_environment_020_PsParisC.Lwt.t) ->
Sc_rollup_inbox_merkelized_payload_hashes_repr.Hash.t ->
index:Tezos_protocol_environment_020_PsParisC.Z.t ->
payloads_proof Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
val serialized_proof_of_string : string -> serialized_proof
Allows to create a dumb serialized_proof
from a string, instead of serializing a proof with to_serialized_proof
.
val get_level_of_history_proof : history_proof -> Raw_level_repr.t
val level_proof_of_history_proof : history_proof -> level_proof
val expose_proof : proof -> inclusion_proof * payloads_proof
val make_proof : inclusion_proof -> payloads_proof -> proof