-
Notifications
You must be signed in to change notification settings - Fork 878
Adds scan_accounts_without_data() to avoid loading account data #5849
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
Adds scan_accounts_without_data() to avoid loading account data #5849
Conversation
| ScanAccountStorageData::NoData => { | ||
| storage.scan_accounts(|account| { | ||
| let account_without_data = StoredAccountInfoWithoutData::new_from(&account); | ||
| storage.scan_accounts_without_data(|account_without_data| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the main change. We now do not load account data if scan_account_storage_data is NoData 🎉
| mut callback: impl for<'local> FnMut(StoredAccountInfoWithoutData<'local>), | ||
| ) -> TieredStorageResult<()> { | ||
| // Note, this should be reimplemented to not read account data | ||
| self.scan_accounts(|stored_account| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can fix this Tiered Storage implementation later when we need to. I didn't think it was necessary for this PR though.
cpubot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
HaoranYi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5849 +/- ##
=========================================
- Coverage 83.0% 83.0% -0.1%
=========================================
Files 828 828
Lines 375847 375890 +43
=========================================
+ Hits 312018 312023 +5
- Misses 63829 63867 +38 🚀 New features to boost your workflow:
|
Problem
AccountsDb::scan_account_storage()still loads account data in its back-end impl, even when we specifyScanAccountStorageData::NoData.Summary of Changes
Following on from #5840, we can now add a back-end method to not load the account data when scanning a storage. This PR adds
AccountsFile::scan_accounts_without_data().