Skip to content

[TieredStorage] Add TieredStorage::write_accounts_to_hot_storage() API#382

Closed
yhchiang-sol wants to merge 2 commits intoanza-xyz:masterfrom
yhchiang-sol:ts-write-hot-accounts
Closed

[TieredStorage] Add TieredStorage::write_accounts_to_hot_storage() API#382
yhchiang-sol wants to merge 2 commits intoanza-xyz:masterfrom
yhchiang-sol:ts-write-hot-accounts

Conversation

@yhchiang-sol
Copy link
Copy Markdown

Problem

The current TieredStorage::write_accounts() API requires a format parameter
to determine which format to use, but this design requires leaking TieredStorage
information to AccountsFile.

Summary of Changes

Instead of requiring AccountsFile to provide a format parameter, this PR adds
TieredStorage::write_accounts_to_hot_storage() API so that AccountsFile
doesn't need to know the detail format information to write accounts to a
hot storage.

Dependency

#72

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 8.69565% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 81.8%. Comparing base (cbd0369) to head (9776171).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #382   +/-   ##
=======================================
  Coverage    81.8%    81.8%           
=======================================
  Files         838      838           
  Lines      227531   227588   +57     
=======================================
+ Hits       186323   186376   +53     
- Misses      41208    41212    +4     

@yhchiang-sol yhchiang-sol force-pushed the ts-write-hot-accounts branch from 66c8caa to 9776171 Compare March 22, 2024 04:07
@yhchiang-sol yhchiang-sol marked this pull request as draft March 22, 2024 04:07
@yhchiang-sol yhchiang-sol force-pushed the ts-write-hot-accounts branch from 9776171 to 7aa98bb Compare March 22, 2024 09:09
@yhchiang-sol yhchiang-sol marked this pull request as ready for review March 22, 2024 09:10
Copy link
Copy Markdown

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

I don't think this PR solves the leaky api issue.

) -> Option<Vec<StoredAccountInfo>> {
match self {
Self::AppendVec(av) => av.append_accounts(accounts, skip),
Self::TieredStorage(ts) => ts.write_accounts_to_hot_storage(accounts, skip).ok(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IMO this is effectively the same as using the HOT_FORMAT constant. So API details are still leaking out.

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.

3 participants