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

eip7251: Limit consolidating balance by validator.effective_balance #4040

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

mkalinin
Copy link
Contributor

@mkalinin mkalinin commented Dec 5, 2024

Proposes to use source.effective_balance as the limitation of the source’s balance moved upon consolidation.

Ensures that in the most of the cases the newly activated balance is not higher than the amount passed through the consolidation churn. Relying on source.max_effective_balance as it is today allows to activate more balance than it was churned, although up to a limited extent (<= 1.25 ETH).

After this fix there still the case when an excess balance can be activated. It can happen if source.effective_balance has been bumped due to accrued rewards after consolidation has been initiated. But that increase would happen regardless of consolidation and is allowed by the protocol.

The other quirk addressed by this fix is the dependency of the amount of activated balance on the withdrawal credential type. Suppose there is a validator with 32.05 ETH balance. If it had compounding credentials, entire 32.05 ETH would be moved to the target upon consolidation, while if it had eth1 credentials, only 32 ETH would be moved leaving 0.05 ETH for the sweep.

cc @fradamt

ToDo

  • write more exhaustive balance tests for consolidation

Copy link
Member

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

I think this makes sense, even if just to fix the quirk you described. With the quirk, there would be an advantage in converting to a compounding validator first (and then waiting for the excess balance to be deposited) before consolidating. Consider the following situations with the current spec:

Consolidating with eth1 source validator

  • The target is a compounding validator with 32.5 ETH.
  • The source is an eth1 validator with 32.5 ETH.
  • After consolidating, the target will have 64.5 ETH and 0.5 ETH will be swept.

Consolidating with compounding source validator

  • The target is a compounding validator with 32.5 ETH.
  • The source is a compounding validator with 32.5 ETH.
  • After consolidating, the target will have 65.0 ETH and 0.0 ETH will be swept.

In the second situation, the target will have a higher EB and will earn more rewards. And in the first situation, the operator will be unable to make a new deposit (to bump their EB) until they receive another 0.5 ETH somehow. All to say, you shouldn't be able to game the system like this.

@mkalinin
Copy link
Contributor Author

mkalinin commented Dec 6, 2024

In the second situation, the target will have a higher EB and will earn more rewards. And in the first situation, the operator will be unable to make a new deposit (to bump their EB) until they receive another 0.5 ETH somehow

This is a good point!

@rolfyone
Copy link
Contributor

rolfyone commented Dec 9, 2024

LGTM

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.

5 participants