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

enable stake table epochs #2510

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

alysiahuggins
Copy link
Contributor

Closes #2505

This PR:

  • re-adds epoch functionality so that validator registrations and exits can be handled on a epoch basis
  • ensures that the currentEpoch is a based on the latest hotshot block height and the hotShotBlocksPerEpoch
  • the hotShotBlocksPerEpoch is set at constructor time
  • consolidates nextRegistraionEpoch() and nextExitEpoch() into one function, nextAvailableEpoch(...) since the logic was the same
  • adds tests for the currentEpoch() and nextAvailableEpoch(...) functions

This PR does not:

  • provide a way to update hotshot blocks per epoch as it's assumed that this will not change in the near future, when it does change the function can be updated
  • handle integer overflows (e.g. currentEpoch()+1) - this is a discussion to have
  • modify epoch logic for functions such as withdrawFunds() which depends on the epoch functionality, this will be handled in other github issues.

Key places to review:

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.

set current epoch based on hotshot block height
1 participant