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

Apply consensus committee changes at epoch boundaries #1679

Merged
merged 8 commits into from
Oct 31, 2024

Conversation

JamesHinshelwood
Copy link
Contributor

@JamesHinshelwood JamesHinshelwood commented Oct 22, 2024

The most important changes in this commit are in deposit.sol. Everything else is pretty much just supporting the new interfaces in the deposit contract. The key feature is that we now keep track of the current 'epoch' and only apply changes to the consensus committee two epochs after they are made.

There are a few other changes to the deposit contract in this commit too:

  • The initial stakers are now passed to the contract constructor, rather than relying on the setStake hack.
  • leader() was removed since it isn't used anywhere and it doesn't make sense to have both leader and leaderAtView.
  • Delayed withdrawals are now supported - We keep a circular buffer of pending withdrawals for each validator. 2 weeks after unstaking, the validator can make another call to withdraw the funds from the deposit contract.

Reworked version of #1298.

Further work out of scope of this PR:

@JamesHinshelwood JamesHinshelwood force-pushed the jh-validator-epochs branch 3 times, most recently from a4385a9 to a51c0f4 Compare October 22, 2024 12:39
The most important changes in this commit are in `deposit.sol`.
Everything else is pretty much just supporting the new
interfaces in the deposit contract. The key feature is that
we now keep track of the current 'epoch' and only apply changes
to the consensus committee two epochs after they are made.

There are a few other changes to the deposit contract in this
commit too:
* The initial stakers are now passed to the contract constructor,
rather than relying on the `setStake` hack.
* `leader()` was removed since it isn't used anywhere and it
doesn't make sense to have both `leader` and `leaderAtView`.
* Delayed withdrawals are now supported - We keep a circular
buffer of pending withdrawals for each validator. 2 weeks after
unstaking, the validator can make another call to withdraw the
funds from the deposit contract.
Copy link
Contributor

@86667 86667 left a comment

Choose a reason for hiding this comment

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

Nice! Couple minor comments/questions

@JamesHinshelwood JamesHinshelwood marked this pull request as ready for review October 30, 2024 09:45
86667
86667 previously approved these changes Oct 30, 2024
@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit 3f78f99 Oct 31, 2024
5 checks passed
@JamesHinshelwood JamesHinshelwood deleted the jh-validator-epochs branch October 31, 2024 17:45
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