Store.Shards
A shard of some slot id consist of a shard index (a number between 0 and the number_of_shards protocol parameter) and a share. The shard store is a mapping associating 0 or 1 share to each (slot_id, shard index) pair.
val number_of_shards_available :
t ->
Tezos_dal_node_services.Types.slot_id ->
int list ->
int Tezos_base.TzPervasives.tzresult Lwt.t
number_of_shards_available store slot_id shard_indices
returns the number of shards stored among the ones given by indexes in shard_indices
for the given slot_id
.
val write_all :
t ->
Tezos_dal_node_services.Types.slot_id ->
Tezos_crypto_dal.Cryptobox.shard Tezos_base.TzPervasives.Seq.t ->
(unit, [> Errors.other ]) Stdlib.result Lwt.t
write_all store slot_id shards
adds to the shard store all the given shards of the given slot id.
val read :
t ->
Tezos_dal_node_services.Types.slot_id ->
int ->
(Tezos_crypto_dal.Cryptobox.shard, [> Errors.not_found | Errors.other ])
Stdlib.result
Lwt.t
read store slot_id shard_id
gets the shard associated to slot_id
at the range shard_id
.
val read_all :
t ->
Tezos_dal_node_services.Types.slot_id ->
number_of_shards:int ->
(Tezos_dal_node_services.Types.slot_id
* int
* Tezos_crypto_dal.Cryptobox.share Tezos_base.TzPervasives.tzresult)
Tezos_base.TzPervasives.Seq_s.t
Same as read_values
but for all possible shards of the given slot id.
val count_values :
t ->
Tezos_dal_node_services.Types.slot_id ->
int Tezos_base.TzPervasives.tzresult Lwt.t
count_values store slot_id
returns the number of shards which are stored for the given slot id.
val remove :
t ->
Tezos_dal_node_services.Types.slot_id ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
remove store slot_id
removes the shards associated to the given slot id from the store.