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

Ethereum 2.0: Rationalization and Determinism

星球君的朋友们
Odaily资深作者
This article is about 3974 words, reading the full article takes about 6 minutes
I hope this article helps you clarify the definitions of justification and finalization.
AI Summary
I hope this article helps you clarify the definitions of justification and finalization.

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

Ethereum enthusiasts (ID: Ethfans)

, Author: Bruno Škvorc, Translator & Proofreader: IAN LIU & A Jian, reproduced by Odaily with authorization.

Translator’s Note: Explaining the following information in advance may help readers better understand the content of this article and our choice of translation words: In Ethereum 2.0, one of the responsibilities of validators is to submit attestation, which can be understood as voting ; But in an attestation, the content of the verifier's vote has three items instead of one: one is a vote on the beacon chain block, which is used in the LMD Ghost algorithm to select the main chain; one is on the epoch (period) The vote of the Casper FFG algorithm is used to finalize the checkpoint; the block before the checkpoint will be irreversible, and the checkpoint will also become the starting point of a new round of LMD Ghost algorithm (can be imagined as a constantly refreshed genesis state); One is a vote on the state of the shard chain (crosslink), which is used to determine the latest state of the shard chain. Although they are all votes, different types of votes point to different specific content and contribute different attributes to the entire system. The content of this article is the voting related to Casper FFG. The key concepts are justification and finalization. Although LMD Ghost is also mentioned later in the article, LMD Ghost and Casper FFG should be regarded as two independent but complementary things.

In view of this, although some translators translated attestation as "proof", we decided to translate all the above-mentioned concepts closer to their literal meaning, and did not translate any concept into "proof" or "voting", so as not to cause more confusion.

If you’re confused about terms like justification and finalization in Ethereum 2.0, you’re definitely not the only one; let’s explain in layman’s terms what these terms actually mean.

Let's talk first, what exactly does finality mean? You must have noticed that whether you are using a cryptocurrency platform or a dApp, transactions cannot be confirmed until several blocks are generated. This is a relatively reliable method (but not a 100% guarantee), allowing you to determine the status of the transaction and the transaction will not be reversed, which is the so-called certainty.

Ethereum 2.0 provides a deterministic guarantee - turning the on-chain transaction into an objective fact recorded on the blockchain, not just "the transaction may remain on the longest chain". This is very important, if the block can be confirmed in time, then the interaction on the chain can be carried out faster and more complete.

Let's get a little clearer and start with some definitions.

  • Note: The following content involves more low-level technologies, but it will still be as simple and easy to understand as other articles in the 2.0 series. Please let me know if you find anything that needs to be added.

  • Before talking about the details, let's clear up a few definitions:

  • LMD GHOST: The latest message-driven GHOST algorithm (Last Message Driven Greediest Heaviest Observed SubTree), the fork selection rule of Ethereum 2.0.

  • Casper FFG: Casper FFG protocol (Casper, the Friendly Finality Gadget), a protocol used by Ethereum 2.0 to provide deterministic guarantees.

  • Fork selection rule: A mechanism that, given the entire blockchain, can output the blockchain path from the genesis block to block S, and make the chain where S is located can be considered as the authoritative chain (also called "master chain", "root chain").

  • Epoch: In Ethereum 2.0, it refers to a time unit that lasts 6.4 minutes, and each epoch (period) contains 64 slots (time slots, each time slot is 6 seconds).

The so-called committee is a set of verifiers randomly selected; each committee will be assigned to a specific time slot, the first verifier in the committee is responsible for proposing a block, and the other verifiers come to Witness (attest) the block.

Casper FFG

With these concepts in place, let's move on to justification and finalization.

secondary title

Casper is a method for justifying and finalizing time periods (both for blocks in general blockchain networks and for epochs in Ethereum 2.0). It is a general-purpose "gadget" that can be added to any blockchain; however, Casper is most useful on PoS blockchains.

Finality is a concept that two conflicting checkpoints cannot be determined (irreversible); it can also be called economic certainty, because once two conflicting checkpoints are finalized, Then at least 1/3 of the verifiers in the system will be fined forfeiting their deposits.

You may wonder why 1/3 of the verifiers are fined forfeiting their deposits?

Once there are two conflicting checkpoints, it means that the two checkpoints each receive more than 2/3 of the validator votes; because only one checkpoint can be established in the end, at least 1/3 of the people will vote repeatedly. The 1/3 of validators who voted repeatedly will be considered as malicious participants and their deposit will be fined. In order to avoid such invalid operations, the best way for validators is to confirm the state of the beacon chain before each round of voting, and then vote for the appropriate checkpoint.

So how to understand the "determined" in "the checkpoint is determined to be established"? We need to talk about justification (called “justification” above) first.

Justification refers to the operation in which validators vote on checkpoints and decide which checkpoint should be placed at the forefront of the current beacon chain. As long as more than 2/3 of the validators (that is, the absolute majority) reach a consensus on a pair of epochs (such as source epoch S -> Target epoch T, that is, the source period and the target period), we will say that the two epochs are rationalized (justified ); Regardless of whether there are skipped epochs in the two epochs, as long as the two epochs in the same column are rationalized, we call the previous epoch finalized (finalized).

Note: For ease of understanding, the above is a greatly simplified definition; there are other influencing factors, but they are beyond the scope of this article.

As a reminder, when we say validators are attesting/finalizing, we don't mean validators voting on the epoch itself - it sounds like someone is using voting to determine what time it is (we all know which time it is currently) time, there is no need to vote at all). Validators are actually voting on the contents of these epochs - the root state of their respective final slots (boundary slots). So validators choose the latest valid state of the blockchain by attesting/confirming epoch votes.

LMD GHOST

In the final battle of Avengers 4, Doctor Strange saw 14 million possibilities in the parallel world. In these parallel worlds, time progresses linearly, with each day, each hour happening simultaneously in all worlds; but in all of these worlds, there is only one desirable outcome—other outcomes are forks.

secondary title

Then we have to talk about fork selection rules.

In the latest message-driven (LMD) GHOST method, the algorithm runs based on "messages", that is, attestation ("witness information"). In general, the forked chain with the most votes is considered the "authoritative chain".

Gasper

The figure above shows the details of the latest news-driven GHOST method; the smiley face symbol represents the witness information, and there is a number in each block, which represents the sum of the number of witnesses, which is the weight of the block. In the picture above, although the top chain is the longest chain, the green one is the "authoritative chain".

secondary title

In Ethereum 2.0, Casper and GHOST are collectively called Gasper, which is the core consensus protocol of Ethereum 2.0.

Let's take a look at Justin Drake's briefing on Ethereum 2.0 at EthCC.

The two boxes in the above figure represent two illegal conditions when forking the selection. The box on the left indicates that it is not allowed to vote for two different root states at the same time (ie, you cannot vote for two epochs with different content at the same time). The right box indicates that if a slot comes directly from some already finalized slots, bypassing those slots to vote for a new slot is not allowed. In other words, it is not allowed to skip the current candidate epoch and directly vote for the future epoch.

The lower part of the figure shows two "determined" forked chains. The epochs represented by the first and second red circles have been determined because they are followed by the determined third and fourth epochs. However, the third and fourth epochs exist in two parallel forks. Which fork is the "authoritative chain"?

According to the first rule: duplicate voting is not allowed. The upper fork in the briefing seems to be legitimate because it already has a finalized epoch, but the lower fork also has a finalized epoch, just a little later!

This concludes that the lower fork is invalid, because if a chain is formed according to the later determined epoch, it means that the previously determined but skipped epoch due to the fork is "surrounded" In other words, a newly cast epoch follows an epoch from another fork. This situation is illegal - because the identified checkpoints must be performed in chronological order. If this happened, many validators could be severely penalized for voting for an epoch on an "illegal chain". According to the "double vote" and "surrounded vote" rules, it can be identified which verifiers are doing evil, and the cost of doing evil will be very high.

ETH
Welcome to Join Odaily Official Community