v2.3: Do not sanitize append vecs at startup (backport of #6552)#6579
Merged
brooksprumo merged 1 commit intov2.3from Jun 16, 2025
Merged
v2.3: Do not sanitize append vecs at startup (backport of #6552)#6579brooksprumo merged 1 commit intov2.3from
brooksprumo merged 1 commit intov2.3from
Conversation
Author
|
Cherry-pick of 3804f39 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
This backport PR is blocked until #6580 is merged. |
|
@Mergifyio rebase |
Author
☑️ Nothing to do, the required conditions are not metDetails
|
(cherry picked from commit 3804f39)
bd890ab to
c888147
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2.3 #6579 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 848 848
Lines 379542 379563 +21
=========================================
- Hits 314575 314544 -31
- Misses 64967 65019 +52 🚀 New features to boost your workflow:
|
roryharr
approved these changes
Jun 13, 2025
t-nelson
approved these changes
Jun 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
At startup from a snapshot, we must rebuild/reconstruct all the
AppendVecs. This is basically relinking all the storage files on disk to theAccountStorageEntrys that were serialized into the bank snapshot (aka snapshot manifest). We use the storage file paths from the snapshot manifest to reconstruct the AppendVecs.We also do some sanitization of the storage files when reconstructing the new AppendVecs. One step is to sanitize each account in the storage file. This involves scanning (i.e. reading) the whole file, and checking every single account to make sure the accounts are valid. Scanning every account in every storage file is rather time consuming. On mainnet-beta, we now have over 900 million accounts. Doing this sanitization step takes over 100 seconds.
An observation is that we also read all the accounts/storages two other times as part of startup. One is for index generation, and the other is for startup accounts verification. If the storages are wrong/invalid, then one (or both) of these other tasks will catch it. Thus, we can avoid the sanitization step during startup reconstruction.
Speeding up reconstructing the storages, speeds up startup. And if startup is faster, that means validators begin replaying faster. If validators begin replaying faster, they catch up faster, AND that also means there are fewer blocks they have to repair (vs getting through turbine).
Summary of Changes
Skip AppendVec accounts sanitization during startup when reconstructing storages.
Testing against mnb, I saw times drop from ~100-120 seconds to ~2 seconds for reconstructing storages at startup.
Justification to Backport
@alessandrod asked me to.
This is an automatic backport of pull request #6552 done by [Mergify](https://mergify.com).