package octez-protocol-alpha-libs

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

Module Dal_helpers.MakeSource

Some global constants.

Parameters

module P : sig ... end

Signature

Sourceval genesis_history : Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.t
Sourceval genesis_history_cache : Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.History_cache.t
Sourceval level_one : Tezos_protocol_alpha.Protocol.Raw_level_repr.t
Sourceval level_ten : Tezos_protocol_alpha.Protocol.Raw_level_repr.t

Helper functions.

Sourceval get_history : Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.History_cache.t -> Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.hash -> Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.t option Lwt.t

Retrieves the history from a given cache.

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

Sourceval dal_mk_prove_page : Tezos_crypto_dal.Cryptobox.polynomial -> Tezos_protocol_alpha.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.

Sourceval mk_slot : ?level:Tezos_protocol_alpha.Protocol.Raw_level_repr.t -> ?index:Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t -> ?fill_function:(int -> char) -> unit -> (bytes * Tezos_crypto_dal.Cryptobox.polynomial * Tezos_protocol_alpha.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).

Sourceval mk_page_id : Tezos_protocol_alpha.Protocol.Raw_level_repr.t -> Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t -> int -> Tezos_protocol_alpha.Protocol.Dal_slot_repr.Page.t

Constructs a record value of type Page.id.

Sourceval no_data : (default_char:char -> int -> bytes option) option
Sourceval mk_page_info : ?default_char:char -> ?level:Tezos_protocol_alpha.Protocol.Raw_level_repr.t -> ?slot_index:Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t -> ?page_index:int -> ?custom_data:(default_char:char -> int -> bytes option) option -> Tezos_protocol_alpha.Protocol.Dal_slot_repr.Header.t -> Tezos_crypto_dal.Cryptobox.polynomial -> ((bytes * Tezos_crypto_dal.Cryptobox.page_proof) option * Tezos_protocol_alpha.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.

Sourceval next_char : char -> char

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

Sourceval succ_slot_index : Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t -> Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t

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

Sourceval produce_and_verify_proof : check_produce: ((Tezos_protocol_alpha.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_alpha.Protocol.Dal_slot_repr.History.hash -> Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.t option Lwt.t) -> Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.t -> page_info:(bytes * Tezos_crypto_dal.Cryptobox.page_proof) option -> page_id:Tezos_protocol_alpha.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.

Check if two page proofs are equal.

Sourceval successful_check_produce_result : __LOC__:string -> [ `Confirmed | `Unconfirmed ] -> (Tezos_protocol_alpha.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.

Sourceval 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.

Sourceval 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.

Sourceval 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.

Sourceval failing_check_produce_result : __LOC__:string -> expected_error:Tezos_protocol_alpha.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.

Sourceval bad_history_cache : __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 some cells are missing in the history cache.

OCaml

Innovation. Community. Security.