BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

Popular science: the life process of an Eth2 validator

以太坊爱好者
特邀专栏作者
This article is about 3086 words, reading the full article takes about 5 minutes
This article takes a deep dive into the lifecycle of a validator, showing the essence of the stages and transition process, how transitions are triggered, and how long each transition lasts.
AI Summary
Expand
This article takes a deep dive into the lifecycle of a validator, showing the essence of the stages and transition process, how transitions are triggered, and how long each transition lasts.

Editor's Note: This article comes fromEthereum enthusiasts (ID: ethfans)Editor's Note: This article comes from

Ethereum enthusiasts (ID: ethfans)

Ethereum enthusiasts (ID: ethfans)

, Author: Jim McDonald, translation: A Jian, reproduced by Odaily with authorization.

Ethereum 2.0 uses the proof-of-stake mechanism to protect the network, that is, many computer threads called "verifiers" vote to determine which block can be uploaded to the chain (the so-called "attesting", as a witness), and of course they will propose their own Alternate blocks. However, validators don't just have two states of "on" and "off": their states go through multiple transitions throughout their lifetime from being a validator to being a validator. This article takes a deep dive into the lifecycle of a validator, showing the essence of the stages and transition process, how transitions are triggered, and how long each transition lasts.

The time in Ethereum 2.0 is usually measured by the unit of "epoch (period)". One period is 384 seconds, which is six and a half minutes. For ease of understanding, I have converted the time based on this measurement into minutes, hours, and days, and provide detailed information in the footnotes of the appendix.

Validator Lifecycle Overview

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

  • image description

  • - Figure 1: Overview of validator life cycle -

  • The stages indicated by each tab are as follows:

  • Deposited: The deposit offer has been packaged in the Ethereum 1.0 blockchain

  • Pending: The margin offer is accepted by the Ethereum 2.0 network

  • Active: The verifier must witness the block and propose the block

Slashing: Caught for cheating, the validator stops witnessing and proposing blocks

Exited: The verifier completely exits and no longer participates in any process

A basic state can also be defined from this: "attesting", activation, voluntary exit, and complete exit are all in this state, and validators in this state are expected to witness and propose blocks. This state is the most important. In this state, verifiers need to connect to the Ethereum 2.0 network and synchronize data to fulfill their responsibilities and avoid being punished.

image description

- Figure 2: "Witnessing" state -

Margin Deposit Stage

Acceptance of a margin offer is the start of a validator's career; this acceptance process occurs on the Ethereum 1.0 chain, as validator funds are originally placed on the Ethereum 1.0 chain. But when the 1.0 chain is accepted, the 2.0 chain cannot yet perceive the deposit.

The validator's bond deposit phase takes about 7.5 hours2 to ensure that the probability of chain reorganization affecting the order of Eth1 transactions and invalidating the bond offer is small enough. After this phase is completed, the validator enters the waiting activation phase 3.

image description

waiting for activation phase

After the deposit has been deposited on the Eth1 chain long enough, it will be accepted by the Eth2 chain. This marks the official start of validators accepting Eth2 as an organization. Assuming a validator has deposited at least 32 ETH 4, then TA can start witnessing.

Validators waiting to be activated will form a queue: at a certain point in time, the number of validators that can be activated and exited on the Eth2 chain is a relatively small number (so they need to be queued) 5 to ensure the stability of the validator set. If the queue is empty, validators waiting to activate will activate after about 25 minutes6; if the queue is long, it may take days or even weeks to activate. However, after queuing up, the verifier can directly activate and participate in witnessing.

image description

  • - Figure 4: From waiting to activate to active phase -

  • active stage

  • Generally, a validator spends most of its time in this phase. Active validators issue an attestation approximately every 6 minutes and occasionally propose block 7 themselves. Validators will remain active unless one of the following three situations occurs:

The verifier voluntarily asks to withdraw by sending a corresponding transaction (such a transaction cannot be issued within 9 days of activation)

The verifier is proven to be evil

image description

- Figure 5: From active state to about to leave -

In the third case, the verification will be added to the perpetrator queue and receive punishment.

image description

- Figure 6: From activated state to slashed state -

upcoming exit phase

Just like when a verifier wants to activate, there is a waiting activation state and a queue, and the verifier who wants to exit also has a queue, and only a small number of verifiers are allowed to exit for a period of time. Likewise, the time it takes for the voluntary exit phase depends on how many validators are queued at the front.

image description

first level title

confiscated state

image description

- Figure 8: From being slashed to being completely withdrawn -

Verifiers who are about to leave or even have completely withdrawn may be slashed (there is a period of time before the verifier completely withdraws and can withdraw funds, during which time it can be slashed). This prevents malicious validators from using the normal exit mechanism to escape before the maliciousness is discovered. The result is a more complex state model:

image description

- Figure 9: After Supplementary Forfeiture Conditions -

When transitioning to the full exit state, the validator has officially ended its work, no longer needs to witness and propose blocks, and no longer needs to keep up with the real-time dynamics of the Eth2 blockchain.

After transitioning to the completed exit state, there is a delay of about one day8 before the validator balance can be withdrawn. However, if a validator is fully withdrawn from the slashed state, there are two additional penalties.

The first, the time between fully withdrawing and being able to withdraw money is much longer at 36 days9. The second item, during this 36-day period, the system will impose further penalties on the verifier according to the number of verifiers confiscated within 18 days before and after the time when the verifier was caught doing evil. Then the verifier's effective balance loss ratio of 10 will be as shown in the following figure:

image description

- Figure 10: The relationship between the slashed effective balance and the proportion of slashed verifiers in the same period -

As can be seen from this life-flow diagram, there is no additional mechanism for a fully exited validator to reactivate. Therefore, once a validator withdraws, its funds will remain dormant, waiting for the validator to come and withdraw. However, during Eth2 Phase 0, funds cannot be transferred - so the funds of all validators who have completely withdrawn remain in the pledge system until the transfer function is enabled. There is no transfer function because the user account model has not yet been introduced.

Supplemented validator life process

Adding all the details above to the flow chart gives a complete picture:

image description

- Figure 11: Supplemented validator life flow chart -

Please take a closer look at the supplementary conditions, the duration of each stage, and the conversion process. These details are critical to the successful operation of the Eth2 verification facility. From initializing the deposit to withdrawing the deposit, this life flow diagram points out what might happen at each stage, and also provides a clear explanation for the validator's performance at all times.

Note 1: It should be noted that the specification of Ethereum 2.0 does not have an explicit state machine, so the names of each stage are given by the author for the convenience of description.

Note 2: The time of 1024 Ethereum 1.0 blocks plus 32 periods of Ethereum 2.0.

Note 3: Here it is assumed that the verifier has deposited enough 32 ETH. If not enough, the validator will stay in the margin deposit stage until the validator initiates another margin offer so that its balance exceeds 32 ETH.

Note 4: If it is less than 32 ETH, you can also deposit another amount to increase the balance of the verifier.

Note 5: There are (number of active validators + number of voluntary exit validators + number of confiscated validators)/63356 places in each period, and the lower limit is 4.

Note 6: That is the length of 4 periods.

Note 7: Each verifier needs to issue a witness message in a certain time slot (slot) in a period, and in each time slot, a verifier will be randomly selected as the block proposer.

ETH
Welcome to Join Odaily Official Community