Skip to content

Commit

Permalink
Remove old way of account hashing
Browse files Browse the repository at this point in the history
Account data hashing used to use different ways of hashing on different
clusters.  That is no longer the case, but the old code still existed.
This commit removes that old, now used code.

**NOTE** The golden hash values within the tests have been updated, but
they **have not been validated**!  The new values came from the "actual"
values as reported by `cargo test` when the tests failed.

Validated by running `cargo test` from within `runtime`.
  • Loading branch information
brooksprumo committed Apr 8, 2021
1 parent 0e262aa commit 72e4d18
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 170 deletions.
4 changes: 1 addition & 3 deletions runtime/src/accounts_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use dashmap::DashMap;
use solana_sdk::{
account::{AccountSharedData, ReadableAccount},
clock::Slot,
genesis_config::ClusterType,
hash::Hash,
pubkey::Pubkey,
};
Expand Down Expand Up @@ -114,7 +113,7 @@ pub struct CachedAccountInner {
}

impl CachedAccountInner {
pub fn hash(&self, cluster_type: ClusterType) -> Hash {
pub fn hash(&self) -> Hash {
let hash = self.hash.read().unwrap();
match *hash {
Some(hash) => hash,
Expand All @@ -124,7 +123,6 @@ impl CachedAccountInner {
self.slot,
&self.account,
&self.pubkey,
&cluster_type,
);
*self.hash.write().unwrap() = Some(hash);
hash
Expand Down
Loading

0 comments on commit 72e4d18

Please sign in to comment.