A detailed explanation of the life cycle of Ethereum validators
ECN以太坊中国
2023-02-20 02:20
本文约3037字,阅读全文需要约12分钟
How to ensure the normal operation of the Ethereum network?

Original title: "Understanding The Validator Lifecycle

Original title: "

Author: Jim McDonald

Compilation of the original text: John

Understand the validator (Validator) life cycle

Ethereum 2.0 uses proof of stake to ensure its network security. Computer processes called "verifiers" will vote on the next block to be packaged (hereinafter referred to as "witness"), and they will also propose to let themselves blocks are packed into it. However, validators are not just "on" and "off": they go through a series of transactions during their lifetime. This article will deeply dissect the validator life cycle, showing what happens at each state and state transition, what triggers the state transition, and the time required for each state transition (Note 1).

a symbol of time

In Ethereum 2.0, the time is usually in units of epoch, and an epoch includes 384 seconds, which is about 6 and a half minutes. For ease of understanding, times measured in this manner are roughly translated into minutes, hours and days, with the exact information available in the corresponding footnotes.

Lifecycle overview

Before diving into the details, let's take a look at an overview of a validator's lifecycle and the terminology used to describe its different states.

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Figure 1: Overview of validator lifecycle


  • Here are the status labels:

  • Deposited - The deposit protocol has been accepted by the Ethereum 1.0 network

  • Pending - The deposit protocol has been accepted by the Ethereum 2.0 network

  • Active - validators are witnessing and proposing blocks

  • Exiting - the validator is in the process of aborting witnessing and proposing blocks

  • Slashing - The validator was found to be cheating and is in the process of aborting witnesses and proposing blocks


Exited - the validator is no longer participating in witnessing

A meta-state is also defined: Witness, which is the state of all validators participating in witnessing and proposing blocks (active, exiting, slashing). This state is important because validators in these states need access to the Ethereum 2.0 network to stay in sync with their duties and avoid being penalized.

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Diagram 2: Meta state of witness

After these states are defined it is time to analyze each state and the transactions between them in detail.

Deposited status

The accepting deposit agreement is the beginning of the life cycle of the validator. Acceptance happens on the Ethereum 1.0 chain, because that's where the validator funds come from. At this point the Ethereum 2.0 chain is not aware of this deposit.

Validators will remain in this deposit state for about 7.5 hours (Note 2) to ensure that there will not be a chain reorganization that affects Ethereum 1.0 transactions and may invalidate the deposit agreement. After this the validator will go to the pending state (note 3).

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Diagram 3: Transition from deposited state to ready state

pending status

Once the deposit has been on the Ethereum 1.0 chain long enough, it will be added to the Ethereum 2.0 chain. This marks that this validator has been officially recognized by Ethereum 2.0. Provided at least 32 ETH have been deposited (Note 4), the validator will now be ready to start witnessing.

The validators who are preparing will be placed in a queue: Ethereum 2.0 only allows a small number of validators to start or stop validation at a time (Note 5) to ensure a stable set of validators. If the queue is empty the ready validators will become active after about 25 minutes (Note 6): if this is a very busy period it may take days or even weeks before the validators are activated . But once the validator comes out of the waiting queue, it becomes active.

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Diagram 4: Transition from ready state to active state

active state


  • Validators are supposed to spend their primary lifecycle in the active state. Active validators will participate in the current witness at a frequency of 6 minutes, and occasionally propose blockchain work (Note 7). Validators remain active until one of the following happens:

  • Validators were penalized for failing to perform their duties when they were required to participate in witnessing, causing funds to drop below 16 ETH.

  • The user requests to stop validating by sending an appropriate transaction (this transaction cannot be initiated during the first 9 days that the validator becomes active).


The verifier is proven to be cheating.

In the first two cases, the validator is added to the queue of validators who wish to stop validating (validators who are about to leave the active state are the same as those who are about to enter the active state, and the number is limited, about a few minutes. indivual)

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Figure 5: Transition from active state to exiting state

In the third case, validators are penalized by being added to a queue of validators found to be cheating.

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Diagram 6: Transition from active state to slashed state

Note that it is possible to deposit additional ETH to an active validator by sending an additional deposit agreement including the same validator information (always remember that the effective balance cannot exceed 32 ETH). This helps avoid situations where a validator's funds drop below 16 ETH and are added to the exit queue.

exiting status

When an existing verifier of the network expresses his intention to stop verification, no matter whether he is voluntary or involuntary, he will not do so immediately but will enter the state of exiting, which is the same as the previous active state Continue to participate in witnessing and proposing as much. This ensures the stability of the network and avoids the situation where a validator decides to leave and immediately stops performing its duties.

Similar to when a validator wants to change from ready to active, leaving validators enter a queue that allows only a few at a time. Also similar to joining, the time spent in the exiting state depends on the number of validators queued in the queue.

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Figure 7: Transition from exiting to exited state

Slashing status

A validator who is found to be cheating will be immediately punished with 1 ETH, which will be deducted from the balance. Then he will enter a slashing queue, which is similar to an exiting queue, but it will be marked as requiring additional penalties, we will discuss this issue in the next "Exited" state .

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Diagram 8: Transition from Slashed to Exited

A validator can be slashed while exiting and even after exiting (but before he can get his funds back). This avoids the situation where a validator cheats and escapes punishment by quitting before its cheating is discovered through the normal exit mechanism. This leads to a slightly more complex state model.

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Figure 9: Extended slashing conditions

exited status

When a validator reaches the exited state, he has officially completed his mission. He no longer needs to participate in witnessing or proposing blocks, and no longer needs to have state information about the Ethereum 2.0 chain.

After exiting, there is a final delay of about 1 day (Note 8) before funds can be transferred away from validators. However, if the validator is marked as slashed, then he incurs two additional penalties.

First, it will take longer, 36 days, before funds can be transferred in the exited state (note 9). Second, halfway through this 36-day cycle, he is subject to a further chargeback based on the number of validators slashed 18 days before this validator was found to be cheating and 18 days after this validator was found to be cheating The number of validators slashed. The figure below shows the total percentage of a validator's effective balance loss (note 10)

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Chart 10: Effective balance slashed as a percentage of validators slashed by the network over roughly the same time period

Once the 36 days have expired, the remaining funds of the slashed validators can be transferred.

As can be seen in the lifecycle diagram, an exited validator cannot re-enter active state through any mechanism. That is, once a validator exits, his funds remain dormant until transferred. Note that you cannot transfer funds during phase 0 of Ethereum 2.0 - all exited validator funds will remain with the validator until funds transfer operations are introduced. The reason for the lack of transfer operations is the lack of user accounts that can transfer ETH.

Extended Validator Lifecycle

Taking all of the above information together will lead to a more comprehensive picture of the validator lifecycle

Explain the life cycle of Ethereum validators in detail: how to ensure the normal operation of the Ethereum network?

Understanding what transitions between states require and how long they take is critical to ensuring the successful operation of Ethereum 2.0 staking infrastructure. From the initial deposit to the withdrawal of funds, the life cycle shows what can happen in each state and provides an explicit explanation of the validator's behavior at any time.

footnote

footnote

Footnote 1: It is worth noting that Ethereum 2.0 does not set a clear state mechanism; that is to say, the name of the state is proposed by the author for easy understanding.

Footnote 2: 1,024 Ethereum 1.0 blocks plus 32 Ethereum 2.0 epochs.

Footnote 3: This assumes the deposit protocol requires the full 32 ETH. If the deposit agreement is less than this threshold, the validator will stay in the deposited state until more deposit agreements increase the validator's balance to at least 32 ETH.

Footnote 4: If not, another deposit can be added to increase the validator's balance to this amount.

Footnote 5: Each epoch is (active + withdrawn + slashed validators)/65536, and the minimum value is 4.

Footnote 6: 4 epochs.

Footnote 7: A verifier in each epoch can only witness once, and only one designated verifier in each slot performs the duties of the proposer.

Footnote 8: 256 epochs

Footnote 9: 8192 epochs


ECN以太坊中国
作者文库