Module Store.Traps

type t

A cache for trap data that stores up to Constants.traps_cache_size levels in memory.

add ~slot_id ~shard_index ~delegate ~share ~shard_proof adds trap data to the cache. The cache maintains a maximum of Constants.traps_cache_size levels. Data is expected to be added in ascending order within a window of proto_parameters.attestation_lag. When the cache reaches its capacity, the oldest trap data (relative to the highest stored level) is removed when adding new entries.

find t ~level retrieves all trap data associated with the given level. Returns an empty list if no traps exist for that level.