hash calc uses self.filler_account_suffix (#23887)
This commit is contained in:
parent
9022931689
commit
b22165ad69
|
@ -120,7 +120,6 @@ impl AccountsHashVerifier {
|
||||||
stats: HashStats::default(),
|
stats: HashStats::default(),
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
accounts_cache_and_ancestors: None,
|
accounts_cache_and_ancestors: None,
|
||||||
filler_account_suffix: None, // this will fail with filler accounts
|
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
|
@ -5521,11 +5521,6 @@ impl AccountsDb {
|
||||||
stats: timings,
|
stats: timings,
|
||||||
check_hash,
|
check_hash,
|
||||||
accounts_cache_and_ancestors,
|
accounts_cache_and_ancestors,
|
||||||
filler_account_suffix: if self.filler_account_count > 0 {
|
|
||||||
self.filler_account_suffix.as_ref()
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
self.calculate_accounts_hash(slot, ancestors, check_hash)
|
self.calculate_accounts_hash(slot, ancestors, check_hash)
|
||||||
|
@ -5738,6 +5733,14 @@ impl AccountsDb {
|
||||||
end: (pass + 1) * bins_per_pass,
|
end: (pass + 1) * bins_per_pass,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let hash = AccountsHash {
|
||||||
|
filler_account_suffix: if self.filler_account_count > 0 {
|
||||||
|
self.filler_account_suffix
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
let result = Self::scan_snapshot_stores_with_cache(
|
let result = Self::scan_snapshot_stores_with_cache(
|
||||||
&cache_hash_data,
|
&cache_hash_data,
|
||||||
config.storages,
|
config.storages,
|
||||||
|
@ -5746,12 +5749,9 @@ impl AccountsDb {
|
||||||
&bounds,
|
&bounds,
|
||||||
config.check_hash,
|
config.check_hash,
|
||||||
config.accounts_cache_and_ancestors,
|
config.accounts_cache_and_ancestors,
|
||||||
config.filler_account_suffix,
|
hash.filler_account_suffix.as_ref(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let hash = AccountsHash {
|
|
||||||
filler_account_suffix: config.filler_account_suffix.cloned(),
|
|
||||||
};
|
|
||||||
let (hash, lamports, for_next_pass) = hash.rest_of_hash_calculation(
|
let (hash, lamports, for_next_pass) = hash.rest_of_hash_calculation(
|
||||||
result,
|
result,
|
||||||
&mut config.stats,
|
&mut config.stats,
|
||||||
|
@ -7923,7 +7923,6 @@ pub mod tests {
|
||||||
stats: HashStats::default(),
|
stats: HashStats::default(),
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
accounts_cache_and_ancestors: None,
|
accounts_cache_and_ancestors: None,
|
||||||
filler_account_suffix: None,
|
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let expected_hash = Hash::from_str("GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn").unwrap();
|
let expected_hash = Hash::from_str("GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn").unwrap();
|
||||||
|
@ -7948,7 +7947,6 @@ pub mod tests {
|
||||||
stats: HashStats::default(),
|
stats: HashStats::default(),
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
accounts_cache_and_ancestors: None,
|
accounts_cache_and_ancestors: None,
|
||||||
filler_account_suffix: None,
|
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,6 @@ pub struct CalcAccountsHashConfig<'a> {
|
||||||
&'a Ancestors,
|
&'a Ancestors,
|
||||||
&'a AccountInfoAccountsIndex,
|
&'a AccountInfoAccountsIndex,
|
||||||
)>,
|
)>,
|
||||||
// these should be gone soon as we get an AccountsDb '&self'
|
|
||||||
pub filler_account_suffix: Option<&'a Pubkey>,
|
|
||||||
// to come soon
|
// to come soon
|
||||||
/*
|
/*
|
||||||
pub rent_collector: RentCollector,
|
pub rent_collector: RentCollector,
|
||||||
|
|
Loading…
Reference in New Issue