Skip to main content

reconstruct

Function reconstruct 

Source
fn reconstruct<T: NodeType>(
    view: ViewNumber,
    epoch: EpochNumber,
    payload_commitment: VidCommitment2,
    common: AvidmGf2Common,
    shares: Vec<(T::SignatureKey, AvidmGf2Share)>,
    metadata: <<T as NodeType>::BlockPayload as BlockPayload<T>>::Metadata,
) -> Result<VidReconstructOutput<T>, VidReconstructError<<T as NodeType>::SignatureKey>>
Expand description

Decode the shares and accept the result only if it re-commits to payload_commitment. On failure, report the shares that fail verification against the commitment (each share is self-authenticating via its merkle proofs) so they can be weeded out. If every share verifies, the payload is unrecoverable: the shares cover the recovery threshold with disjoint ranges, so the disperser committed to a non-codeword and no share subset can ever succeed.