pub async fn verify_leaf_chain_with_cert2<T: NodeType>(
leaf_chain: Vec<Leaf2<T>>,
stake_table: &[PeerConfig<T>],
success_threshold: U256,
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.