package tezos-protocol-013-PtJakart

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

This module type is the minimal API a storage backend has to implement to be compatible with the Tx_rollup layer-2 implementation.

In a nutshell, the Tx_rollup only needs a simple key-value store, where both keys and values are raw bytes buffers. We build a type-safe abstraction on top of this simple (but potentially unsafe) interface in Tx_rollup_l2_context.

type t

The state of the storage.

The API adopts a functional paradigm, where the set function returns a new state for the storage, and where it should be possible to reuse a previous state.

type 'a m

The monad of the storage backend.

module Syntax : sig ... end

The necessary monadic operators the monad of the storage backend is required to provide.

val get : t -> bytes -> bytes option m

get storage key returns the value stored in storage for key, if it exists. Returns None if it does not.

val set : t -> bytes -> bytes -> t m

set storage key computes a new state for the storage wherein the value associated to key is value.

storage is expected to remain usable and consistent even after the execution of set.

val remove : t -> bytes -> t m

remove storage key removes key from the storage.