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

feat: handle exited/exiting validators during top up #6880

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Jun 13, 2024

Handle deposit for exiting and exited validators:

  • If the validator is exiting, move the deposit to the end of state.pendingBalanceDeposits via depositsToPostpone
  • If the validator is already exited, directly increase its balance without consuming churn (state.depositBalanceToConsume)

Spec PR: ethereum/consensus-specs#3776

@ensi321 ensi321 requested a review from a team as a code owner June 13, 2024 08:53
if (processedAmount + amount > availableForProcessing) {
break;
const {amount, index: depositIndex} = deposit;
const validator = state.validators.get(depositIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const validator = state.validators.get(depositIndex);
const validator = state.validators.getReadOnly(depositIndex);

Copy link
Contributor Author

@ensi321 ensi321 Jun 19, 2024

Choose a reason for hiding this comment

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

@twoeths Caught this during spec testing. Fixed in #6892 👍

@ensi321 ensi321 merged commit 8cc86f9 into electra-fork Jun 21, 2024
6 checks passed
@ensi321 ensi321 deleted the nc/exit-validator branch June 21, 2024 16:32
g11tech pushed a commit that referenced this pull request Jun 25, 2024
* Handle exiting validataor

* lint

* Add todo
g11tech pushed a commit that referenced this pull request Jun 25, 2024
* Handle exiting validataor

* lint

* Add todo
g11tech pushed a commit that referenced this pull request Jul 1, 2024
* Handle exiting validataor

* lint

* Add todo
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.

None yet

3 participants