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

Moves create_all_accounts_run_and_snapshot_dirs() into accounts-db utils #34877

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

brooksprumo
Copy link
Contributor

Problem

We're trying to remove the fs-err crate. For more information, please refer to #34838.

Basically the last hold-outs are in snapshot_utils. And while looking at the code, I saw that snapshot_utils::create_all_accounts_run_and_snapshot_dirs() et al just wrap functions inside accounts_db.rs, and then change the returned error type. Also strange, the test for this function is in snapshot_bank_utils.rs.

These functions are kind of for snapshots, but more for accounts-db. And there's no need for the wrapper functions. So lets have all the code and tests in a single location.

Summary of Changes

  • Move the create_all_accounts_run_and_snapshot_dirs() et al functions into a new utils module within the accounts-db crate.
  • Move the tests too
  • Remove the wrapper functions in snapshot_utils.rs
  • Update all the callers

Note that basically zero code was changed in the move. I did add constants for the "run" and "snapshot" string literals though.

This PR is a prereq to further cleanup snapshot_utils.rs.

@brooksprumo brooksprumo marked this pull request as ready for review January 22, 2024 20:17
@brooksprumo brooksprumo requested a review from steviez January 22, 2024 20:17
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Comparison is base (f9bfb60) 81.7% compared to head (b47229a) 81.6%.
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34877     +/-   ##
=========================================
- Coverage    81.7%    81.6%   -0.2%     
=========================================
  Files         826      827      +1     
  Lines      223371   223788    +417     
=========================================
+ Hits       182578   182656     +78     
- Misses      40793    41132    +339     

Copy link
Contributor

@steviez steviez 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 2f744f1 into solana-labs:master Jan 22, 2024
35 checks passed
@brooksprumo brooksprumo deleted the accounts-db-utils branch January 22, 2024 23:18
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.

2 participants