Skip to content

[Feat] Limit the total supply of Aleo to 5B - #3042

Merged
vicsn merged 10 commits into
stagingfrom
feat/supply-cap
Dec 5, 2025
Merged

[Feat] Limit the total supply of Aleo to 5B#3042
vicsn merged 10 commits into
stagingfrom
feat/supply-cap

Conversation

@raychu86

@raychu86 raychu86 commented Nov 26, 2025

Copy link
Copy Markdown
Collaborator

Motivation

This PR limits the total supply of Aleo that can be created to 5B credits. This is done by calculated the expected upper-bound block height based on the emission algorithms and bringing the block and coinbase rewards to 0 after that height.

Based on the current timelines, this limit height will be hit at block 263_527_685, which is ~25 years from network launch. Because the changes will not occur for quite some time, there is flexibility for adjusting this limit height to be more accurate if there are major changes to network assumptions in the future.

Link to ARC - ProvableHQ/ARCs#101

Do Not Merge until ARC is voted on and approved.

@vicsn vicsn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, let's await Kai's review too

Comment thread console/network/src/lib.rs Outdated
@vicsn
vicsn requested a review from kaimast November 27, 2025 11:28
@kaimast

kaimast commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

One of the ledger tests seems to fail. We probably should look into that before merging.

Co-authored-by: vicsn <victor.s.nicolaas@protonmail.com>
Signed-off-by: Raymond Chu <14917648+raychu86@users.noreply.github.com>
Comment thread console/network/src/lib.rs Outdated
/// This value represents the absolute upper bound on all ALEO created over the lifetime of the network.
const MAX_SUPPLY: u64 = 5_000_000_000_000_000; // 5B credits
/// The block height that upper bounds the total supply of Aleo credits to 5 billion.
#[cfg(not(any(test, feature = "test")))]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be using the test feature or the test_consensus_heights feature? I am still hoping we can phase out the former, as its name is not very descriptive.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We want this to be for tests only rather than test_consensus_heights, because test_consensus_heights can be used for devnets.

I've kept the feature flag consistent with the other network variables, so if we would like to cleanup, we should do in a subsequent PR.

@kaimast kaimast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@raychu86

raychu86 commented Dec 1, 2025

Copy link
Copy Markdown
Collaborator Author

Fixed tests and simplified logic with d3fd59b.

@raychu86
raychu86 requested review from kaimast and vicsn December 1, 2025 19:59
Comment thread ledger/src/tests.rs Outdated
Comment thread ledger/block/src/verify.rs Outdated
@kaimast

kaimast commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

@raychu86 it looks like the tests fail again

@kaimast
kaimast self-requested a review December 3, 2025 00:42

@vicsn vicsn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still LGTM, and this will give us a further early peace of mind: ProvableHQ/snarkOS#4029

@vicsn
vicsn merged commit c980e97 into staging Dec 5, 2025
7 checks passed
@vicsn
vicsn deleted the feat/supply-cap branch December 5, 2025 09:56
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.

3 participants