package tezos-tx-rollup-015-PtLimaPt

  1. Overview
  2. Docs

Module Tezos_tx_rollup_015_PtLimaPt.ContextSource

type index

A block-indexed (key x value) store directory.

type context

Type of persitant context.

include Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_sig.CONTEXT with type t = context and type 'a m = 'a Tezos_base.TzPervasives.tzresult Lwt.t
type t = context
module Syntax : sig ... end
val bls_verify : (Tezos_protocol_environment_015_PtLimaPt.Bls.Public_key.t * bytes) list -> Tezos_raw_protocol_015_PtLimaPt__Tx_rollup_l2_context_sig.signature -> bool m
module Address_metadata : sig ... end
module Address_index : sig ... end
module Ticket_index : sig ... end
module Ticket_ledger : sig ... end
val index : context -> index
val init : ?patch_context:(context -> context Tezos_base.TzPervasives.tzresult Lwt.t) -> ?readonly:bool -> ?indexing_strategy:[ `Always | `Minimal ] -> ?index_log_size:int -> string -> index Lwt.t

Open or initialize a versioned store at a given path.

Sourceval init_context : index -> t Lwt.t

Initialize an "empty" context from an index. It is not really empty in the sense that the underlying tree is not empty, it is then committed.

val close : index -> unit Lwt.t

Close the index. Does not fail when the context is already closed.

val sync : index -> unit Lwt.t

Sync the context with disk. Only useful for read-only instances. Does not fail when the context is not in read-only mode.

Accessing and Updating Versions

Sourceval exists : index -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_hash.t -> bool Lwt.t

Returns true if there is a commit with this context hash

Sourceval checkout_opt : index -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_hash.t -> context option Lwt.t

Checkout the context associated to a context hash. The context must have been committed (with commit). Resolves with None if there is no such commit.

Sourceval checkout_exn : index -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_hash.t -> context Lwt.t

Same as checkout_opt but resolves with an exception if there is no such commit.

Sourceval checkout : index -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_hash.t -> context Tezos_base.TzPervasives.tzresult Lwt.t

Same as checkout_opt but resolves with an error if there is no such commit.

Sourceval hash : ?message:string -> t -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_hash.t

Hash a context. The hash can be done with an additional message.

Sourceval commit : ?message:string -> context -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_hash.t Lwt.t

Create a commit and return the context hash. The hash can be done with an additional message.

Prover Context

The prover context is a subset of the context. It uses the internal context tree to produce proofs.

type tree
Sourcemodule Prover_context : Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_sig.CONTEXT with type t = tree and type 'a m = 'a Lwt.t
Sourcetype 'a produce_proof_result = {
  1. tree : tree;
    (*

    the tree modified by the callback function

    *)
  2. result : 'a;
    (*

    the callback result.

    *)
}

'a produce_proof_result is the result type needed for the produce_proof callback function.

Sourceval produce_proof : context -> (tree -> 'a produce_proof_result Lwt.t) -> (Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_proof.t * 'a produce_proof_result) Tezos_base.TzPervasives.tzresult Lwt.t

produce_proof ctxt f applies f in the tree inside ctxt.

It returns a proof that is produced by applying f, the proof is constructed using low-levels accesses to the three, that is, it needs the modified tree to be included in the f's result to calculate the proof.

Beside the proof production, this function can be used to perform semantical changes in the Prover_context. Thus, we give the possibility to return a result in 'aproduce_proof_result to observe f's results.

Sourceval add_tree : context -> tree -> (context * Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_hash.t) Lwt.t

add_tree ctxt tree adds tree in the ctxt. In order to perform actions on the tree (e.g. proof production), it needs to be persistent. Thus, the context is committed on disk after we added the tree, that is, after every modification on the tree such as a message interpretation.

FIXME: https://gitlab.com/tezos/tezos/-/issues/2780 We would like to avoid the commit in this function for performance matters.

Sub-context for tickets

Sourceval register_ticket : context -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_sig.ticket_index -> Ticket.t -> context Lwt.t

Adds a new association ticket index -> ticket in the context.

Sourceval get_ticket : context -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_sig.ticket_index -> Ticket.t option Lwt.t

get_ticket ctxt ticket_index retrieves the ticket associated to ticket_index in the context ctxt. Resolves with None if there is no ticket associated to ticket_hash.

Sub-context for address indexes

Sourceval register_address : context -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_sig.address_index -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_address.t -> context Lwt.t

Adds a new association address index -> address in the context.

Sourceval get_address : context -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_context_sig.address_index -> Tezos_protocol_015_PtLimaPt.Protocol.Tx_rollup_l2_address.t option Lwt.t

get_address ctxt address_index retrieves the address associated to address_index in the context ctxt. Resolves with None if there is no address associated to address_index.

OCaml

Innovation. Community. Security.