Skip to main content

next_epoch_justify_qc_matches_parent

Function next_epoch_justify_qc_matches_parent 

Source
pub(crate) fn next_epoch_justify_qc_matches_parent<T: NodeType>(
    proposal: &Proposal<T>,
    epoch_height: u64,
    justify_qc_epoch: EpochNumber,
) -> Result<Option<&Certificate2<T>>, MalformedProposal>
Expand description

The first proposal of an epoch must carry the boundary block’s Cert2, which certifies the same block as its justify QC.

Returns the certificate to verify the signatures on, or None when the proposal does not follow a boundary block and carries none.

justify_qc_epoch is the justify QC’s own, as returned by justify_qc_matches_parent. The certificate names the same epoch and block as that QC because both certify the same leaf, and the leaf commitment covers neither, so agreement otherwise rests on an honest signer being in the quorum that formed it. Its view is the QC’s or later: the justify QC is the block’s own Certificate1, at the block’s view, and a re-vote commits the block at a view of its own.