Skip to content

v4.0: Uses u128 for startup capitalization verification (backport of #12004)#12008

Open
mergify[bot] wants to merge 1 commit intov4.0from
mergify/bp/v4.0/pr-12004
Open

v4.0: Uses u128 for startup capitalization verification (backport of #12004)#12008
mergify[bot] wants to merge 1 commit intov4.0from
mergify/bp/v4.0/pr-12004

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Apr 16, 2026

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.

Screenshot 2026-04-16 at 2 33 49 PM

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

@mergify mergify bot requested a review from a team as a code owner April 16, 2026 21:11
@brooksprumo brooksprumo requested a review from roryharr April 16, 2026 21:13
@brooksprumo
Copy link
Copy Markdown

brooksprumo commented Apr 16, 2026

Darn, cargo audit strikes again.

@brooksprumo brooksprumo removed the request for review from roryharr April 16, 2026 21:58
@brooksprumo
Copy link
Copy Markdown

@roryharr - I removed you as a reviewer for now. I'll re-add once CI is unblocked and completes.

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.

1 participant