Skip to content

Removes write version from StorableAccountsWithHashesAndWriteVersions#561

Merged
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:write-version/storable-accounts-with-hashes
Apr 3, 2024
Merged

Removes write version from StorableAccountsWithHashesAndWriteVersions#561
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:write-version/storable-accounts-with-hashes

Conversation

@brooksprumo
Copy link
Copy Markdown

Problem

Now that we no longer use the write version when storing accounts (see #476), and StorableAccounts no longer contains anything about write version either (see #542), StorableAccountsWithHashesAndWriteVersions does not need to care either.

Summary of Changes

Remove write version from StorableAccountsWithHashesAndWriteVersions.

@brooksprumo brooksprumo self-assigned this Apr 3, 2024
@brooksprumo brooksprumo marked this pull request as ready for review April 3, 2024 15:24
Copy link
Copy Markdown
Author

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

There's a lot of noise in the diff due to renaming the type and removing a parameter. I've tried to call out the important parts.

.map(|account| account.data().len())
.unwrap_or_default() as u64,
write_version_obsolete,
write_version_obsolete: 0,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

And finally, we explicitly always store a zero for write version!

Comment on lines +906 to +907
fn test_storable_accounts_with_hashes_new2() {
test_mismatch(false);
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The test_mismatch() stuff can be refactored. I purposely didn't do that here in this PR to keep the diff small. I'll do the cleanup in a follow up PR.

&StorableAccountsWithHashes::<'_, '_, _, _, &AccountHash>::new(accounts),
)
} else {
let write_versions = vec![0; accounts.len()];
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

And now we don't need to create this vector of zeroes either!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 3, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.8%. Comparing base (0168e0a) to head (ac1858f).
⚠️ Report is 6966 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #561     +/-   ##
=========================================
- Coverage    81.8%    81.8%   -0.1%     
=========================================
  Files         847      847             
  Lines      229180   229144     -36     
=========================================
- Hits       187600   187502     -98     
- Misses      41580    41642     +62     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

:shipit:

@brooksprumo brooksprumo merged commit afa65c6 into anza-xyz:master Apr 3, 2024
@brooksprumo brooksprumo deleted the write-version/storable-accounts-with-hashes branch April 3, 2024 16:41
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.

4 participants