Allow fork choice to support multiple versions of a slot (#16266)

This commit is contained in:
carllin
2021-04-12 01:00:59 -07:00
committed by GitHub
parent ef30943c5c
commit dc7030ffaa
12 changed files with 2034 additions and 637 deletions

View File

@@ -257,6 +257,7 @@ pub(crate) struct ForkStats {
pub(crate) is_supermajority_confirmed: bool,
pub(crate) computed: bool,
pub(crate) lockout_intervals: LockoutIntervals,
pub(crate) bank_hash: Option<Hash>,
}
#[derive(Clone, Default)]
@@ -398,6 +399,12 @@ impl ProgressMap {
.map(|fork_progress| fork_progress.is_dead)
}
pub fn get_hash(&self, slot: Slot) -> Option<Hash> {
self.progress_map
.get(&slot)
.and_then(|fork_progress| fork_progress.fork_stats.bank_hash)
}
pub fn is_propagated(&self, slot: Slot) -> bool {
let leader_slot_to_check = self.get_latest_leader_slot(slot);