pub fn new_from_frozen_banks(root: SlotHashKey, frozen_banks: &[Arc<Bank>]) -> Self {
        let mut heaviest_subtree_fork_choice = HeaviestSubtreeForkChoice::new(root);
        let mut prev_slot = root.0;
        for bank in frozen_banks.iter() {
            assert!(bank.is_frozen());
            if bank.slot() > root.0 {
                // Make sure the list is sorted
                assert!(bank.slot() > prev_slot);
                prev_slot = bank.slot();
                let bank_hash = bank.hash();
                assert_ne!(bank_hash, Hash::default());
                let parent_bank_hash = bank.parent_hash();
                assert_ne!(parent_bank_hash, Hash::default());
                heaviest_subtree_fork_choice.add_new_leaf_slot(
                    (bank.slot(), bank_hash),
                    Some((bank.parent_slot(), parent_bank_hash)),
                );
            }
        }

        heaviest_subtree_fork_choice
    }
// Given a root and a list of `frozen_banks` sorted smallest to greatest by slot,
// return a new HeaviestSubtreeForkChoice
Given a root and a list of `frozen_banks` sorted smallest to greatest by slot,
return a new HeaviestSubtreeForkChoice
Given a root and a list of ` frozen_banks ` sorted smallest to greatest by slot return a new HeaviestSubtreeForkChoice
pub fn new_from_frozen_banks(root: SlotHashKey, frozen_banks: &[Arc<Bank>]) -> Self {
        let mut heaviest_subtree_fork_choice = HeaviestSubtreeForkChoice::new(root);
        let mut prev_slot = root.0;
        for bank in frozen_banks.iter() {
            assert!(bank.is_frozen());
            if bank.slot() > root.0 {
                // Make sure the list is sorted
                assert!(bank.slot() > prev_slot);
                prev_slot = bank.slot();
                let bank_hash = bank.hash();
                assert_ne!(bank_hash, Hash::default());
                let parent_bank_hash = bank.parent_hash();
                assert_ne!(parent_bank_hash, Hash::default());
                heaviest_subtree_fork_choice.add_new_leaf_slot(
                    (bank.slot(), bank_hash),
                    Some((bank.parent_slot(), parent_bank_hash)),
                );
            }
        }
        heaviest_subtree_fork_choice
    }
pub fn new_from_frozen_banks ( root : SlotHashKey , frozen_banks : & [ Arc < Bank > ] ) -> Self { let mut heaviest_subtree_fork_choice = HeaviestSubtreeForkChoice :: new ( root ) ; let mut prev_slot = root . 0 ; for bank in frozen_banks . iter ( ) { assert ! ( bank is_frozen ( ) ) ; if bank . slot ( ) > root . 0 { // Make sure the list is sorted assert ! ( bank slot ( ) prev_slot ) ; prev_slot = bank . slot ( ) ; let bank_hash = bank . hash ( ) ; assert_ne ! ( bank_hash Hash default ( ) ) ; let parent_bank_hash = bank . parent_hash ( ) ; assert_ne ! ( parent_bank_hash Hash default ( ) ) ; heaviest_subtree_fork_choice . add_new_leaf_slot ( ( bank . slot ( ) , bank_hash ) , Some ( ( bank . parent_slot ( ) , parent_bank_hash ) ) , ) ; } } heaviest_subtree_fork_choice }
Given a root and a list of `frozen_banks` sorted smallest to greatest by slot,
return a new HeaviestSubtreeForkChoice
Given a root and a list of ` frozen_banks ` sorted smallest to greatest by slot return a new HeaviestSubtreeForkChoice
root
SlotHashKey
frozen_banks
&[Arc<Bank>]