Tezos_raw_protocol_alpha.Dal_attestations_reprMultiple attestations representation for the data-availability layer.
This module extends Dal_attestation_repr to handle multiple DAL attestations at different lags. A lag represents the difference between the attested level of a slot and its published level.
The structure stores a fixed number of attestations, determined by number_of_lags. Each attestation is indexed by lag_index (0-based) and is a bitset encoding which slots are attested at a particular level. The slots' (published) level is implicit (it is obtained as "attested level" minus the lag corresponding to the given lag index), and is not relevant for this module.
The encoding uses a compact bitset representation that minimizes space when small slot indices are attested:
The bitset is stored as an integer, with bit positions starting at 0 (LSB). The structure is:
number_of_lags bits at positions 0 to number_of_lags-1): Indicates which attestations are non-empty. Bit i corresponds to lag index i. If bit i = 1, the attestation at lag index i is non-empty. We call this a "prefix" because it logically comes first in the structure, even though it occupies the lowest bit positions.number_of_lags): For each non-empty attestation (in order from lag index 0 to number_of_lags-1), a sequence of 8-bit chunks is stored:For number_of_lags = 4 and number_of_slots = 160:
The prefix has bits 1 and 3 set. The data section contains:
00100001 00000010 01000101 1010 <- lag 3 data --> <-lag 1> <--> (16 bits) (8 bits) prefix slots 0, 11 slots 1, 5 lags 1, 3
The order of the bits is:
[slot13]...[slot7][is_last] [slot6]...[slot0][is_last] [slot6]...[slot0][is_last] [lag3]...[lag0] <-------------- lag 3 data (2 chunks) ---------------> <---- lag 1 (1 chunk) ---> <-- prefix --->
type t = private Tezos_protocol_environment_alpha.Bitset.tval encoding : t Tezos_protocol_environment_alpha.Data_encoding.tThe size of the encoding is not bounded. However, the size of a DAL attestations bitset is checked during validation of an attestation; and there is a bound on the size of a generic operation.
val rpc_arg : t Tezos_protocol_environment_alpha.RPC_arg.tRPC path argument for parsing a DAL attestation bitset from a decimal integer string in URL paths.
val empty : tempty returns an empty attestation structure where all slots at all lags are marked as unavailable.
val is_empty : t -> boolis_empty t returns true if all attestations at all lags are empty.
val is_empty_at_lag_index : t -> lag_index:int -> boolis_empty_at_lag_index t returns true if the attestation at lag_index is empty.
val is_attested :
t ->
number_of_slots:int ->
number_of_lags:int ->
lag_index:int ->
Dal_slot_index_repr.t ->
boolis_attested t ~number_of_slots ~number_of_lags ~lag_index slot_index returns true if the attestation at lag_index commits that the slot at slot_index is available. lag_index must satisfy 0 <= lag_index < number_of_lags, and slot_index must satisfy 0 <= slot_index < number_of_slots.
The decoded representation of the slots attested for a given lag_index.
val unfolded_lag_attestation_encoding :
unfolded_lag_attestation Tezos_protocol_environment_alpha.Data_encoding.tval decode :
t ->
number_of_slots:int ->
number_of_lags:int ->
unfolded_lag_attestation list
Tezos_protocol_environment_alpha.Error_monad.tzresultdecode t ~number_of_slots ~number_of_lags decodes the attestation bitset t into an explicit representation. Returns a list of unfolded_lag_attestation, one entry per non-empty lag, in increasing lag order. slot_indices contains the attested slot indices for that lag, in increasing order. Empty lags are omitted from the result. Fails with Dal_invalid_attestation_bitset if t is malformed.
val commit :
t ->
number_of_slots:int ->
number_of_lags:int ->
lag_index:int ->
Dal_slot_index_repr.t ->
tcommit t ~number_of_slots ~number_of_lags ~lag_index slot_index commits into the attestation at lag_index that the slot slot_index is available. lag_index must satisfy 0 <= lag_index < number_of_lags, and slot_index must satisfy 0 <= slot_index < number_of_slots.
val occupied_size_in_bits : t -> intoccupied_size_in_bits v returns the size in bits of v.
expected_max_size_in_bits ~number_of_slots ~number_of_lags returns the maximum size (in bits) of a t value.
val weight : t -> inttype attestation = tType alias for use in submodules.
module Slot_availability : sig ... endSlot availability represents the protocol's attestation result for a block.
module Accountability : sig ... endThis module is used to record the shard attestations.
module Dal_dependent_signing : sig ... endt-dependent combination of public keys or signatures.
module Internal_for_tests : sig ... end