-
Notifications
You must be signed in to change notification settings - Fork 1k
Removes unused params from Bank::verify_snapshot_bank() #6986
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5014,11 +5014,9 @@ impl Bank { | |
| /// calculation and could shield other real accounts. | ||
| pub fn verify_snapshot_bank( | ||
| &self, | ||
| _test_hash_calculation: bool, | ||
| skip_shrink: bool, | ||
| force_clean: bool, | ||
| latest_full_snapshot_slot: Slot, | ||
| _base: Option<(Slot, /*capitalization*/ u64)>, // will be removed next | ||
| duplicates_lt_hash: Option<Box<DuplicatesLtHash>>, | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's the initial/main change: removing the unused params. |
||
| ) -> bool { | ||
| // If we verify the accounts using the lattice-based hash *and* with storages (as opposed | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,7 +168,6 @@ pub fn bank_from_snapshot_archives( | |
| debug_keys: Option<Arc<HashSet<Pubkey>>>, | ||
| additional_builtins: Option<&[BuiltinPrototype]>, | ||
| limit_load_slot_count_from_snapshot: Option<usize>, | ||
| test_hash_calculation: bool, | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then here in |
||
| accounts_db_skip_shrink: bool, | ||
| accounts_db_force_initial_clean: bool, | ||
| verify_index: bool, | ||
|
|
@@ -278,29 +277,11 @@ pub fn bank_from_snapshot_archives( | |
| snapshot_archive_info.hash, | ||
| )?; | ||
|
|
||
| let base = if bank.is_snapshots_lt_hash_enabled() { | ||
| None | ||
| } else { | ||
| incremental_snapshot_archive_info.is_some().then(|| { | ||
| let base_slot = full_snapshot_archive_info.slot(); | ||
| let base_capitalization = bank | ||
| .rc | ||
| .accounts | ||
| .accounts_db | ||
| .get_accounts_hash(base_slot) | ||
| .expect("accounts hash must exist at full snapshot's slot") | ||
| .1; | ||
| (base_slot, base_capitalization) | ||
| }) | ||
| }; | ||
|
|
||
| let mut measure_verify = Measure::start("verify"); | ||
| if !bank.verify_snapshot_bank( | ||
| test_hash_calculation, | ||
| accounts_db_skip_shrink || !full_snapshot_archive_info.is_remote(), | ||
| accounts_db_force_initial_clean, | ||
| full_snapshot_archive_info.slot(), | ||
| base, | ||
| info.duplicates_lt_hash, | ||
| ) && limit_load_slot_count_from_snapshot.is_none() | ||
| { | ||
|
|
@@ -350,7 +331,6 @@ pub fn bank_from_latest_snapshot_archives( | |
| debug_keys: Option<Arc<HashSet<Pubkey>>>, | ||
| additional_builtins: Option<&[BuiltinPrototype]>, | ||
| limit_load_slot_count_from_snapshot: Option<usize>, | ||
| test_hash_calculation: bool, | ||
| accounts_db_skip_shrink: bool, | ||
| accounts_db_force_initial_clean: bool, | ||
| verify_index: bool, | ||
|
|
@@ -382,7 +362,6 @@ pub fn bank_from_latest_snapshot_archives( | |
| debug_keys, | ||
| additional_builtins, | ||
| limit_load_slot_count_from_snapshot, | ||
| test_hash_calculation, | ||
| accounts_db_skip_shrink, | ||
| accounts_db_force_initial_clean, | ||
| verify_index, | ||
|
|
@@ -1123,7 +1102,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -1224,7 +1202,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -1326,7 +1303,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -1446,7 +1422,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -1556,7 +1531,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -1686,7 +1660,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -1746,7 +1719,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -2123,7 +2095,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
@@ -2298,7 +2269,6 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| Some(ACCOUNTS_DB_CONFIG_FOR_TESTING), | ||
| None, | ||
| Arc::default(), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh... looks like this was wrong before! Luckily these should all be
false, but this is clearly an example of what happens when a function has a ton of parameters and they are all the same type...