package octez-protocol-017-PtNairob-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Some global constants.

Parameters

module P : sig ... end

Signature

Helper functions.

val dal_mk_polynomial_from_slot : bytes -> Tezos_crypto_dal.Cryptobox.polynomial Tezos_base.TzPervasives.tzresult

Returns the slot's polynomial from the given slot's data.

val dal_commit : Tezos_crypto_dal.Cryptobox.t -> Tezos_crypto_dal.Cryptobox.polynomial -> (Tezos_crypto_dal.Cryptobox.commitment, Tezos_base.TzPervasives.error Tezos_base.TzPervasives.trace) result
val dal_mk_prove_page : Tezos_crypto_dal.Cryptobox.polynomial -> Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.Page.t -> Tezos_crypto_dal.Cryptobox.page_proof Tezos_base.TzPervasives.tzresult

Using the given slot's polynomial, this function computes the page proof of the page whose ID is provided.

val mk_slot : ?level:Tezos_protocol_017_PtNairob.Protocol.Raw_level_repr.t -> ?index:Tezos_protocol_017_PtNairob.Protocol.Dal_slot_index_repr.t -> ?fill_function:(int -> char) -> unit -> (bytes * Tezos_crypto_dal.Cryptobox.polynomial * Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.Header.t) Tezos_base.TzPervasives.tzresult

Constructs a slot whose ID is defined from the given level and given index, and whose data are built using the given fill function. The function returns the slot's data, polynomial, and header (in the sense: ID + kate commitment).

val no_data : (default_char:char -> int -> bytes option) option
val mk_page_info : ?default_char:char -> ?level:Tezos_protocol_017_PtNairob.Protocol.Raw_level_repr.t -> ?page_index:int -> ?custom_data:(default_char:char -> int -> bytes option) option -> Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.Header.t -> Tezos_crypto_dal.Cryptobox.polynomial -> ((bytes * Tezos_crypto_dal.Cryptobox.page_proof) option * Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.Page.t, Tezos_base.TzPervasives.error Tezos_base.TzPervasives.trace) result

Constructs a page whose level and slot indexes are those of the given slot (except if level is redefined via ?level), and whose page index and data are given by arguments page_index and mk_data. If mk_data is set to No, the function returns the pair (None, page_id). Otherwise, the page's data and proof is computed, and the function returns Some (data, proof), page_id.

val next_char : char -> char

Returns the char after c. Restarts from the char whose code is 0 if c's code is 255.

Increment the given slot index. Returns zero in case of overflow.

val produce_and_verify_proof : check_produce: ((Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.History.proof * bytes option) Tezos_base.TzPervasives.tzresult -> (bytes * Tezos_crypto_dal.Cryptobox.page_proof) option -> (unit, Tezos_base.TzPervasives.tztrace) result Lwt.t) -> ?check_verify: (bytes option Tezos_base.TzPervasives.tzresult -> (bytes * Tezos_crypto_dal.Cryptobox.page_proof) option -> (unit, Tezos_base.TzPervasives.tztrace) result Lwt.t) -> get_history: (Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.History.hash -> Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.History.t option Lwt.t) -> Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.History.t -> page_info:(bytes * Tezos_crypto_dal.Cryptobox.page_proof) option -> page_id:Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.Page.t -> (unit, Tezos_base.TzPervasives.tztrace) result Lwt.t

Auxiliary test function used by both unit and PBT tests: This function produces a proof from the given information and verifies the produced result, if any. The result of each step is checked with check_produce_result and check_verify_result, respectively.

val eq_page_proof : Tezos_crypto_dal.Cryptobox.page_proof -> Tezos_crypto_dal.Cryptobox.page_proof -> bool

Check if two page proofs are equal.

val successful_check_produce_result : __LOC__:string -> [ `Confirmed | `Unconfirmed ] -> (Tezos_protocol_017_PtNairob.Protocol.Dal_slot_repr.History.proof * bytes option) Tezos_base.TzPervasives.tzresult -> (bytes * 'a) option -> (unit, Tezos_base.TzPervasives.tztrace) result Lwt.t

Helper for the case where produce_proof is expected to succeed.

val successful_check_verify_result : __LOC__:string -> [> `Confirmed ] -> bytes option Tezos_base.TzPervasives.tzresult -> (bytes * 'a) option -> (unit, Tezos_base.TzPervasives.tztrace) result Lwt.t

Helper for the case where verify_proof is expected to succeed.

val slot_confirmed_but_page_data_not_provided : __LOC__:string -> 'a Tezos_base.TzPervasives.tzresult -> 'b -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Helper for the case where produce_proof is expected to fail because the slot is confirmed but no page information are provided.

val slot_not_confirmed_but_page_data_provided : __LOC__:string -> 'a Tezos_base.TzPervasives.tzresult -> 'b -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Helper for the case where produce_proof is expected to fail because the slot is not confirmed but page_info are provided.

val failing_check_produce_result : __LOC__:string -> expected_error:Tezos_protocol_017_PtNairob.Environment.Error_monad.error -> 'a Tezos_base.TzPervasives.tzresult -> 'b -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Helper for the case where produce_proof is expected to fail.

OCaml

Innovation. Community. Security.