Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove cluster_type from hash_stored_account #16375

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 12 additions & 25 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2878,33 +2878,20 @@ impl AccountsDb {
pub fn hash_stored_account(
slot: Slot,
account: &StoredAccountMeta,
cluster_type: &ClusterType,
_cluster_type: &ClusterType,
Copy link
Member

@ryoqun ryoqun Apr 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just making sure: you can stop passing this altogether from the upmost caller (assuming we don't have any immediate plan to change the hashing.).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, phase 2. ;-) roughing out this is what you meant.

) -> Hash {
let include_owner = Self::include_owner(cluster_type, slot);
let include_owner = true;

if slot > Self::get_blake3_slot(cluster_type) {
Self::blake3_hash_account_data(
slot,
account.account_meta.lamports,
&account.account_meta.owner,
account.account_meta.executable,
account.account_meta.rent_epoch,
account.data,
&account.meta.pubkey,
include_owner,
)
} else {
Self::hash_account_data(
slot,
account.account_meta.lamports,
&account.account_meta.owner,
account.account_meta.executable,
account.account_meta.rent_epoch,
account.data,
&account.meta.pubkey,
include_owner,
)
}
Self::blake3_hash_account_data(
slot,
account.account_meta.lamports,
&account.account_meta.owner,
account.account_meta.executable,
account.account_meta.rent_epoch,
account.data,
&account.meta.pubkey,
include_owner,
Copy link
Member

@ryoqun ryoqun Apr 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, you can remove this flag. blake3 and include_owner thing even predate the feature activation @mvines brought about. blame @carllin and @ryoqun for NOT cleaning them, respectively. xD

)
}

pub fn hash_account(
Expand Down