Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update is_open flag to check for new stakers #2406

Merged
merged 6 commits into from
Mar 23, 2024

Conversation

raychu86
Copy link
Contributor

Motivation

This PR updates credits.aleo in two ways:

  1. Change is_open check to prevent bonds from new stakers only. Existing stakers can still bond to the validator if this flag is set to false.

  2. Remove 10 validator maximum in credits.aleo

    • This check is now moved to VM::speculate. Where bond_public calls that would cause the committee size to exceed MAX_COMMITTEE_SIZE will be rejected.
    • This unifies the interface for where the max committee size is set to just the MAX_COMMITTEE_SIZE variable.

Test Plan

Tests have been added to ensure the following:

  1. New delegators can't bond to validators if the is_open flag is set to false.
  2. Existing delegators can bond to validators if the is_open flag is set to false.
  3. A validator can bond more stake to itself no matter what the is_open flag is set to.
  4. bond_public transactions will be rejected if the would have caused the committee size to exceed the maximum.

@howardwu howardwu merged commit 0029b6a into mainnet-staging Mar 23, 2024
76 of 80 checks passed
@howardwu howardwu deleted the is-open-to-new-stakers branch March 23, 2024 00:07
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.

2 participants