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, at the leaf’s view
or, for an epoch’s last block committed by a re-vote, a later one. 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.