package tezos-protocol-015-PtLimaPt

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

The type of the inbox for a smart-contract rollup as stored by the protocol in the context. Values that inhabit this type only act as fingerprint for inboxes.

Inbox contents is represented using Raw_context.TREE.trees. (See below.)

val equal : t -> t -> bool
val inbox_level : t -> Raw_level_repr.t

inbox_level inbox returns the maximum level of message insertion in inbox or its initial level.

type history_proof

A history_proof is a Skip_list.cell that stores multiple hashes. Skip_list.content history_proof gives the hash of the level tree for this cell, while Skip_list.back_pointers history_proof is an array of hashes of earlier history_proofs in the inbox.

On the one hand, we think of this type as representing the whole Merkle structure of an inbox at a given level---it is the part of t above that can actually be used to prove things (it cannot be forged by a malicious node because it much match the hash stored by the L1).

On the other hand, we think of this type as representing a single proof-step back through the history of the inbox; given a hash that appears at some point later in the inbox this type proves that that hash points to this particular combination of a level tree and further back-pointers.

In terms of size, this type is a small set of hashes; one for the current level tree and `O(log2(ix))` in the back-pointers, where ix is the index of the cell in the skip list. That is, ix is the number of non-empty levels between now and the origination level of the rollup.

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.

val equal_history_proof : history_proof -> history_proof -> bool
val old_levels_messages : t -> history_proof

old_levels_messages inbox returns the skip list of the inbox history. How much data there actually is depends on the context---in the L1 most of the history is forgotten and just a root hash of the skip list is kept.

val number_of_messages_during_commitment_period : t -> int64

number_of_messages_during_commitment_period inbox returns the number of messages added in the inbox since the beginning of the current commitment period.

val refresh_commitment_period : commitment_period:int32 -> level:Raw_level_repr.t -> t -> t

refresh_commitment_period ~commitment_period ~level inbox updates inbox to take into account the commitment_period: this resets a counter for the number of messages in a given commitment period (which is limited).

OCaml

Innovation. Community. Security.