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

hot storage tests don't use Option #821

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

jeffwashington
Copy link

Problem

moving to not mmapping append vec files. Soon, lifetimes of borrowed account data will be limited to a callback.

Summary of Changes

Rework StorableAccountsWithHashes. account() and get() to always return an account. If lamports=0, a default account will be returned. The easiest first step to take here is to fix the test fns for hot storage. That avoids unnecessary mess in that change.
The next change will be to push the removal of the Option further up the call chain.

Fixes #

@jeffwashington jeffwashington marked this pull request as ready for review April 15, 2024 20:50
accounts-db/src/tiered_storage.rs Show resolved Hide resolved
accounts-db/src/tiered_storage/hot.rs Show resolved Hide resolved
accounts-db/src/tiered_storage/hot.rs Show resolved Hide resolved
accounts-db/src/tiered_storage/hot.rs Show resolved Hide resolved
@@ -47,12 +46,11 @@ pub(super) fn create_test_account(seed: u64) -> (StoredMeta, AccountSharedData)

pub(super) fn verify_test_account(
stored_meta: &StoredAccountMeta<'_>,
account: Option<&impl ReadableAccount>,
acc: &impl ReadableAccount,

Choose a reason for hiding this comment

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

Was this parameter renamed to keep line 53 on a single line?

Copy link
Author

Choose a reason for hiding this comment

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

was just trying to use the name that it already was in the usage below (acc)

Copy link

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

:shipit:

@jeffwashington jeffwashington merged commit 7f16e84 into anza-xyz:master Apr 16, 2024
38 checks passed
michaelschem pushed a commit to michaelschem/agave that referenced this pull request Apr 20, 2024
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