Skip to main content

state_cert_matches_parent

Function state_cert_matches_parent 

Source
pub(crate) fn state_cert_matches_parent<T: NodeType>(
    proposal: &Proposal<T>,
    epoch_height: u64,
) -> Result<Option<&LightClientStateUpdateCertificateV2<T>>, MalformedProposal>
Expand description

A proposal must carry state_cert exactly when its justify QC certifies an epoch-root block.

Returns the certificate to verify next, or None when the proposal’s parent is not an epoch root and it carries none.

Unlike the rest of what a proposal claims about its parent, this field is not covered by the leaf commitment the proposer signs (Leaf2::from_quorum_proposal drops it). Its correspondence to the justify QC is checked separately (see Validator::state_cert); this function is what enforces its presence, which nothing else does.