v4.0: Uses u128 for startup capitalization verification (backport of #12004)#12008
Open
mergify[bot] wants to merge 1 commit intov4.0from
Open
v4.0: Uses u128 for startup capitalization verification (backport of #12004)#12008mergify[bot] wants to merge 1 commit intov4.0from
mergify[bot] wants to merge 1 commit intov4.0from
Conversation
(cherry picked from commit 8c16cb4)
|
Darn, cargo audit strikes again. |
|
@roryharr - I removed you as a reviewer for now. I'll re-add once CI is unblocked and completes. |
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
Startup capitalization verification (added in #10849) sometimes overflows.
This is more likely to happen on testnet where the capitalization is much higher. Also requires loading from both a full and an incremental snapshot archive, where there can be duplicate accounts across the two (full and incremental).
Also in theory a private cluster could have a very high supply and/or inflation that could trigger this as well.
Summary of Changes
Use
u128s for calculating the capitalization.Performance
I tested this out on mnb, which has over 1 billion accounts. I figured that would show any potential performance reduction from doing 128-bit math.
I started with this PR and had it auto restart every 10 minutes. Midway through I switched to master. There were five restarts on each side. To me I cannot tell a difference.
Justification to Backport
Folks (including the firedancer team) have reported hitting these startup overflows on testnet with v4.0. Since the original capitalization PR went into v4.0 too (#10919), I think we should backport the fix.
This is an automatic backport of pull request #12004 done by [Mergify](https://mergify.com).