Expand description
As part of Polkadot’s availability system, certain pieces of data for each block are required to be kept available.
The way we accomplish this is by erasure coding the data into n pieces and constructing a merkle root of the data.
Each of n validators stores their piece of data. We assume n = 3f + k
, 0 < k ≤ 3
.
f is the maximum number of faulty validators in the system.
The data is coded so any f+1 chunks can be used to reconstruct the full data.
Structs§
- Branches
- An iterator that yields merkle branches and chunk data for all chunks to be sent to other validators.
Enums§
- Error
- Errors in erasure coding.
Functions§
- branch_
hash - Verify a merkle branch, yielding the chunk hash meant to be present at that index.
- branches
- Construct a trie from chunks of an erasure-coded value. This returns the root hash and an iterator of merkle proofs, one for each validator.
- obtain_
chunks - Obtain erasure-coded chunks, one for each validator.
- obtain_
chunks_ v1 - Obtain erasure-coded chunks for v1
AvailableData
, one for each validator. - reconstruct
- Reconstruct decodable data from a set of chunks.
- reconstruct_
from_ systematic - Reconstruct the available data from the set of systematic chunks.
- reconstruct_
from_ systematic_ v1 - Reconstruct the v1 available data from the set of systematic chunks.
- reconstruct_
v1 - Reconstruct the v1 available data from a set of chunks.
- recovery_
threshold - Obtain a threshold of chunks that should be enough to recover the data.
- systematic_
recovery_ threshold - Obtain the threshold of systematic chunks that should be enough to recover the data.