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

Improve AccoutsFile::appends_account() return value format #35041

Open
yhchiang-sol opened this issue Feb 1, 2024 · 0 comments
Open

Improve AccoutsFile::appends_account() return value format #35041

yhchiang-sol opened this issue Feb 1, 2024 · 0 comments
Assignees

Comments

@yhchiang-sol
Copy link
Contributor

Problem

AccoutsFile::append_accounts() currently returns Vec.
This requires all the AccountsFile implementations to report the storage size
of each account. This information will be later used for tracking the alive-bytes
and shrinking process. However, not all the AccountsFile implementations
know the "exact" storage size of each account as the file could have shared meta-
data and other storage usage as mentioned in #34929 (comment).

Proposed Solution

Instead, at the time of writing accounts, accounts-db only needs to know the total size.
And it is not until the later stage we need an estimation of how much storage each account
occupies. As a result, it is better to have append_accounts() return the total file size, and
have a separate API to provide an estimation about how much storage size each account occupies.

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

No branches or pull requests

1 participant