Effective balance is a concept in Ethereum 2 staking whose understanding is critical to running a good validator. This post investigates effective balance and its impact on validators.
A key requirement of any blockchain is its ability to secure its chain. A secure chain is one in which transactions are verifiable and immutable i.e. by referring to the blockchain someone can obtain the details of a transaction that took place, and be sure the details are not faked and the transaction cannot be altered retrospectively.
Ethereum 2 allows individuals to help secure the network by running validators. A validator is a computer process that can be thought of as a voter: every time a new block is built on the network a defined subset of the validators consider the block and decide if it contains valid transactions, links itself correctly to the previous block in the chain, etc. If the validator is happy the block is valid it can attest the same. When a block obtains enough attestations by the validators it is considered canonical1
To encourage validators' good behavior, and to avoid the situation where validators either don't bother to attest to blocks or actively lie about the validity of blocks, their actions have monetary consequences. Before a validator can start to attest it needs to submit a one-off deposit of 32Ξ (Ether) with the network; this forms the validator's initial balance. Every six and a half minutes or so the network measures the actions of each validator and issues rewards or penalties appropriately that accrue to the validator's balance. The amount of the reward or penalty depends on the current balance of the validator; attesting with a higher balance provides larger rewards and penalties than attesting with a lower balance.
It is important to understand the key concept of rewards and penalties: rewards are given for actions that help the network's process to reach consensus, and penalties for actions (or inactions) that hinder it. As such, validators that maximize their rewards also provide the greatest benefit to the network as a whole.
A detailed explanation about Ethereum 2's proof of stake model is beyond the scope of this article, but the important thing to understand is that each validator has its own balance that is updated periodically by the Ethereum network rules as the validator carries out its duties (or not).
This article explores the relationship between a validator's balance and the rewards and penalties it accrues; if a validator is attempting to provide the highest benefit to the network, and hence obtain the highest rewards, there are a number of subtleties that must be properly understood.
As mentioned above, when a validator carries out its duties it is rewarded and when a validator does not carry out its duties it is penalized. Rewards and penalties over time are reflected in the balance of the validator, as shown below for a fictional validator:
(Note that the size of rewards and penalties in this and subsequent graphs have been exaggerated to more clearly display their relative sizes.)
At each time 1, 2, 3, etc. the validator's participation is assessed and it is rewarded or penalized accordingly, resulting in a step change in its balance. This particular validator has periods of participating correctly and being rewarded, and periods of non-participation and being penalized:
The size of the rewards and penalties changes at different times throughout the graph in a non-obvious fashion. For example, the penalty given at time 5 is significantly larger than penalty given at time 13, even though the balances at those times are the same. There are four points of particular interest on this graph that deserve closer consideration.
The first point of interest is at time 3, which is highlighted below:
At this time the balance in the validator has dropped below 32Ξ, and the size of subsequent rewards and penalties decreases for no clear reason.
The second point of interest is at time 5, which is highlighted below:
At this time the balance in the validator has dropped below 31Ξ, but the subsequent penalty is the same as the previous time, which is inconsistent with the change at time 3.
The third point of interest is at time 9, which is highlighted below:
At this time the balance in the validator has increased back to 31Ξ, however the size of subsequent rewards and penalties remain the same as when the balance was below 31Ξ.
The fourth and final point of interest is at time 18, which is highlighted below:
At this time the size of rewards and penalties increases, although the balance has not appeared to pass any significant point.
All in all these paint a chaotic view of the rewards and penalties. To understand why these rewards and penalties are the size they are requires an understanding of effective balance.
Effective balance is a value for each validator that is derived from the validator's balance and prior effective balance. It is used to calculate the size of rewards and penalties given to that validator.
Following the above rules allows the addition of a line showing the validator's effective balance to the chart:
The yellow bands, known as the hysteresis zones, are areas in which effective balance will never change. It can be seen clearly that changes to effective balance only ever occur when the balance moves outside of these zones2.
Effective balance was born from a combination of design and technical requirements. On the design side, keeping individual validators to a maximum of 32Ξ stops any single validator from having an excessively large vote in the state of the chain. On the technical side, decreasing the frequency at which effective balance can change means that Ethereum 2 can run on lower-powered hardware, as a change in effective balance necessitates a relatively expensive computation to take place.
With an understanding of effective balance the change in the size of staking rewards and penalties becomes clear. Referring back to the earlier points of confusion:
Because small changes in a validator's balance can have large and long-term effects on its effective balance it is important to keep track of it.
If downtime is required on a validator it is also important to time it correctly, as not all penalties are equal. A 0.015Ξ penalty that drops a validator's balance from 30.010Ξ to 29.995Ξ (with no change in effective balance) has very little impact on the overall rewards generated by the validator, but a 0.015Ξ penalty that drops a validator's balance from 29.760Ξ to 29.745Ξ (with a change in effective balance from 30Ξ to 29Ξ) has a much larger impact.
Validator effectiveness is a metric that shows how much of your validator balance is being used for attesting, calculated as the effective balance as a fraction of the total balance. For example, if a validator has a balance of 31.9Ξ this would result in an effective balance of 31Ξ and its effectiveness would be , or 97%.
Effectiveness of an active validator will usually be somewhere between 95% and 100%, the higher the better as it maximizes both network security and validator rewards. A low effectiveness suggests a validator has been offline for an extended amount of time. Tracking effectiveness over time is a simple way to measure the overall performance of a validator.
This article shows a simplified view of validating in Ethereum 2 to explain the concept of effective balance. The actual Ethereum 2 rewards and penalties system uses effective balance as a base but rewards vary depending on various factors. Rewards can be higher, for example, if the validator proposes a block. They can also be lower if other validators are offline, or disagree about the state of the chain.
Running Ethereum 2 validators successfully requires an understanding of many technical factors, including effective balance. Active management of validators at critical times, for example at times where obtaining a reward or penalty could have a long-term impact on the effectiveness of the validator, can contribute to the overall security of the network and resultant validator rewards. Validator effectiveness over time will prove to be a key metric when understanding the level of active management of funds.
In fact the network does not just measure the number of attestations but their cumulative weight: the weight of any given attestation is equal to the effective balance with which the validator attests. ↩
The converse is not always true however; at time 13 the balance moves outside of the hysteresis zone but as effective balance is already 30Ξ it remains unchanged. ↩