Module Tezos_dal_node_lib.Committee_cache

Cache for the DAL committee.

type t
type shard_indexes = int list

Represents shard indexes of an attester.

Represents the committee for a given level, as a mapping from an attester to its assigned shard indexes.

val create : max_size:int -> t

create ~max_size returns an empty cache. If the cache size exceeds max_size, committees of old levels are removed in FIFO order.

val find : t -> level:int32 -> committee option

find t ~level returns the committee at level. When the committee for block level level is not stored in the cache it returns None.

val add : t -> level:int32 -> committee:committee -> unit

add t ~level ~committee adds the committee committee for level level. If the committee for level already exists in the cache, it is removed and replaced by the given committee.