package tezos-protocol-015-PtLimaPt

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

This module is used to record the various data-availability endorsements.

For each endorser, a list of shards is associated. For each slots declared available (see t) we record that those shards were available.

This information will be used at the end of block finalisation to have the protocol declaring whether the slot is available.

type t

The data-structure used to record the shards-slots availability.

DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3145

Consider using the Bounded module. In particular, change the semantics of is_slot_available accordingly.

type shard = int

A shard aims to be a positive number.

val init : length:int -> t

init ~length initialises a new accountability data-structures with at most length slots and where for every slot, no shard is available.

val record_shards_availability : t -> available_slots -> shard list -> t

record_shards_availability t slots shards records that for all slots declared available in slots, shard indices in shards are available. It is the responsibility of the caller to ensure the shard indices are positive numbers. A negative shard index is ignored.

val is_slot_available : t -> threshold:int -> number_of_shards:int -> Dal_slot_repr.Index.t -> bool

is_slot_available t ~threshold ~number_of_shards slot returns true if the number of shards recorded in t for the slot is above the threshold with respect to the total number of shards specified by number_of_shards. Returns false otherwise or if the index is out of the interval 0;length where length is the value provided to the init function.

OCaml

Innovation. Community. Security.