Skip to content

Removes unused params from Bank::verify_snapshot_bank()#6986

Merged
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:lthash/215/verify_snapshot_bank
Jul 16, 2025
Merged

Removes unused params from Bank::verify_snapshot_bank()#6986
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:lthash/215/verify_snapshot_bank

Conversation

@brooksprumo
Copy link
Copy Markdown

Problem

Bank::verify_snapshot_bank() has unused parameters that should be removed.

Summary of Changes

Remove 'em, and then fix up all callers.

@brooksprumo brooksprumo self-assigned this Jul 16, 2025
Comment thread runtime/src/bank.rs
force_clean: bool,
latest_full_snapshot_slot: Slot,
_base: Option<(Slot, /*capitalization*/ u64)>, // will be removed next
duplicates_lt_hash: Option<Box<DuplicatesLtHash>>,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Here's the initial/main change: removing the unused params.

debug_keys: Option<Arc<HashSet<Pubkey>>>,
additional_builtins: Option<&[BuiltinPrototype]>,
limit_load_slot_count_from_snapshot: Option<usize>,
test_hash_calculation: bool,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Then here in bank_from_snapshot_archives() we can also remove test_hash_calculation now, and update its callers (the majority of this PR's changes).

process_options.accounts_db_skip_shrink,
process_options.accounts_db_force_initial_clean,
process_options.verify_index,
false, // verify_index. This will be removed separately.
Copy link
Copy Markdown
Author

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...

@brooksprumo brooksprumo marked this pull request as ready for review July 16, 2025 02:41
@brooksprumo brooksprumo requested review from HaoranYi and roryharr July 16, 2025 02:41
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.2%. Comparing base (78d5954) to head (2cc1394).

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #6986     +/-   ##
=========================================
- Coverage    83.2%    83.2%   -0.1%     
=========================================
  Files         853      853             
  Lines      375531   375497     -34     
=========================================
- Hits       312586   312550     -36     
- Misses      62945    62947      +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm.

@brooksprumo brooksprumo merged commit aaa81eb into anza-xyz:master Jul 16, 2025
41 checks passed
@brooksprumo brooksprumo deleted the lthash/215/verify_snapshot_bank branch July 16, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants