package tezos-protocol-016-PtMumbai

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

A History.t is basically a lookup table of history_proofs. We need this if we want to produce inbox proofs because it allows us to dereference the 'pointer' hashes in any of the history_proofs. This deref function is passed to Skip_list.back_path or Skip_list.search to allow these functions to construct valid paths back through the skip list.

A subtlety of this history type is that it is customizable depending on how much of the inbox history you actually want to remember, using the capacity parameter. In the L1 we use this with capacity set to zero, which makes it immediately forget an old level as soon as we move to the next. By contrast, the rollup node uses a history that is sufficiently large to be able to take part in all potential refutation games occurring during the challenge period.

type t
type key = Hash.t
type value = history_proof
val empty : capacity:int64 -> t

empty ~capacity returns a new table whose maximum capacity is given.

Encoding for values of type t

Pretty-printer for values of type t

val find : key -> t -> value option

find key t returns Some value if there exists some value associated to key in the table, and None otherwise.

type Tezos_protocol_environment_016_PtMumbai.Error_monad.error +=
  1. | Key_bound_to_different_value of {
    1. key : key;
    2. existing_value : value;
    3. given_value : value;
    }

remember key value t inserts a new entry (key |-> value) in t.

If key already exists in t, its associated binding value' should be equal to value. In this case, t is returned unchanged. Otherwise, an error Key_bound_to_different_value is returned.

If key is not already present in t, the new binding (key |-> value) is inserted in t. If the number of elements would exceed t's capacity after the insertion of the new binding, the oldest binding is removed from t.

The structure t is returned unchanged if its capacity is negative or null.

module Internal_for_tests : sig ... end
OCaml

Innovation. Community. Security.