--halt-at-slot-store-hash-raw-data works for root bank (#26865)
This commit is contained in:
parent
d159682a6d
commit
f6e4f76dac
|
@ -1533,25 +1533,34 @@ fn load_frozen_forks(
|
|||
)?;
|
||||
|
||||
if slot >= halt_at_slot {
|
||||
bank.force_flush_accounts_cache();
|
||||
let can_cached_slot_be_unflushed = true;
|
||||
// note that this slot may not be a root
|
||||
let _ = bank.verify_bank_hash(VerifyBankHash {
|
||||
test_hash_calculation: false,
|
||||
can_cached_slot_be_unflushed,
|
||||
ignore_mismatch: true,
|
||||
require_rooted_bank: false,
|
||||
run_in_background: false,
|
||||
store_hash_raw_data_for_debug: on_halt_store_hash_raw_data_for_debug,
|
||||
});
|
||||
run_final_hash_calc(&bank, on_halt_store_hash_raw_data_for_debug);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if on_halt_store_hash_raw_data_for_debug {
|
||||
run_final_hash_calc(
|
||||
&bank_forks.read().unwrap().root_bank(),
|
||||
on_halt_store_hash_raw_data_for_debug,
|
||||
);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_final_hash_calc(bank: &Bank, on_halt_store_hash_raw_data_for_debug: bool) {
|
||||
bank.force_flush_accounts_cache();
|
||||
let can_cached_slot_be_unflushed = true;
|
||||
// note that this slot may not be a root
|
||||
let _ = bank.verify_bank_hash(VerifyBankHash {
|
||||
test_hash_calculation: false,
|
||||
can_cached_slot_be_unflushed,
|
||||
ignore_mismatch: true,
|
||||
require_rooted_bank: false,
|
||||
run_in_background: false,
|
||||
store_hash_raw_data_for_debug: on_halt_store_hash_raw_data_for_debug,
|
||||
});
|
||||
}
|
||||
|
||||
// `roots` is sorted largest to smallest by root slot
|
||||
fn supermajority_root(roots: &[(Slot, u64)], total_epoch_stake: u64) -> Option<Slot> {
|
||||
if roots.is_empty() {
|
||||
|
|
Loading…
Reference in New Issue