Skip to main content

verify_new_protocol_leaf_chain

Function verify_new_protocol_leaf_chain 

Source
pub async fn verify_new_protocol_leaf_chain<T: NodeType>(
    leaf_chain: Vec<Leaf2<T>>,
    coordinator: &EpochMembershipCoordinator<T>,
    expected_height: u64,
    upgrade_lock: &UpgradeLock<T>,
    cert2: Certificate2<T>,
) -> Result<Leaf2<T>>
Expand description

Verify that a leaf is finalized by a new-protocol Certificate2.

cert2 directly commits the newest leaf in leaf_chain. By the indirect commit rule, every ancestor of that leaf is finalized as well. This verifier validates cert2, then walks backward through the certified leaf’s parent links until it finds expected_height.

View numbers are allowed to skip after timeouts, so the input may contain leaves that are not on the certified ancestry path. Those leaves are ignored; every accepted step must match the current leaf’s justify QC, parent commitment, and block height.