Author: Lin Guanhong/The Ghost at my Fingertips
The Denver nuggets: juejin. Cn/user / 178526…
Blog: www.cnblogs.com/linguanh/
Making: github.com/af913337456…
Tencent cloud column: cloud.tencent.com/developer/u…
Worm hole block chain column: www.chongdongshequ.com/article/153…
directory
- Before the order
- Ethereum 2.0 participants
- The life cycle of a block
- Optimized consensus algorithm
- 2.0 Consensus process
Before the order
Ethereum is an application in the blockchain space, a public chain application, a true subset of the latter.
This article will explain how Ethereum 2.0 differs from 1.x in terms of the life cycle of a block. The main point is the change of consensus algorithm.
BTW: My technical book “Blockchain Ethereum DApp Development Combat” has been published and can be purchased online, suitable for elementary and intermediate blockchain technology related research and development personnel to read.
Ethereum 2.0 participants
Note that version 2.0 has not been officially launched, and some functions are still under development. Its overall architecture is shown in the following figure:
Including, but not limited to, the introduction of the following new technical points or terms:
Beacon chain
It will manage the verifiers participating in the consensus. Contains but is not limited to:- Manage verifiers.
- Common addresses pledge ETH to participate in becoming verifiers
- For a variety of reasons
His exit
The verifier - Kick the verifier out as punishment
- Provide randomness.
Randomly assign verifiers
Go to some shard chainPick your turn at random
The verifier- .
- Track and update the verifier’s mortgage.
- Voted for the successful block
reward
- Not going to vote, missing work and being
punishment
We call this a “quadratic leak.” - By doing evil things
punishment
- Voted for the successful block
- Cross link, the whole shard chain system is connected together.
- When, different
trading
Is assigned to different blocks, blocks in different shard chains, byBeacon chain
Responsible for themData/Communication
For exampleInvocation of contract
.
- When, different
- Responds to the validator client software to which it is connected.
- At that time, everyone can use it
Terminal equipment
downloadBeacon chain software
To become a verifier and participate in managing the 2.0 ecosystem.
- At that time, everyone can use it
- Manage verifiers.
The verifier
To participate in the role of 2.0 out of the block ecosystem, ordinary Ethereum addresses pass to the specified smart contractPledge 32 ETH
Become the validator.Fragmentation chain
, has multiple, it will manage willPackaged deals
The verifier will beRandomly assigned
Go here, generate the block, wait in line, vote the block or reject the block.EWASM
, the virtual machine system on the shard is the upgraded version of EVM. Below is the github project home page.- .
The life cycle of a block
Source code based on ethereum 1.8.11 version. Please note this premise, the title of the version is: Above metropolis chapter – Byzantium
First let’s look at the block life cycle diagram for Ethereum 1.8.11. At a glance, as shown in the figure below. One obvious point is: Ethereum mining algorithm or PoW calculation force mining. This also leads to the most serious block generation time. To increase the speed of block generation, optimizing consensus algorithm is a major point.
Optimized consensus algorithm
Changing Ethereum’s PoW algorithm has been a previously stated move by the Ethereum team. The original process plan was:
PoW –> (PoW + PoS) –> PoS
For a general explanation of PoW consensus algorithms, see this article: Consensus algorithms for Blockchain: A general introduction and a general explanation of bifurcations
For a general explanation of the PoS consensus algorithm, see this article: Blockchain consensus Algorithm: PoS and its example code implementation
Currently, the Constantinople version has been released, which itself is thought to be converted to PoS consensus, but it is still PoW.
Version 2.0 is the last version of Ethereum currently planned: Serenity. It is at this version that the Ethereum team will explicitly introduce the new consensus mechanism, with the same actors who are involved in implementing the changes mentioned in the Ethereum 2.0 Participants section of this article.
Since the Ethereum public chain started with a PoW consensus mechanism, it has been running for a long time. Unlike some of the newer public chains, which can pick and choose a better consensus algorithm from the beginning, it also uses PoW on the basis of its predecessor, the Bitcoin public chain. So now, with more dApps deployed on top of it, and considering supporting applications that require higher transaction speeds, it will have to be upgraded.
Now to upgrade, you need to consider more issues, such as:
- Keep it decentralized, because it’s one of the core features of blockchain.
- Effectively counter the threat of consensus-centralization, such as the computing power centralization PoW considers.
- Block consensus considerations such as computational power consumption of electricity resources.
- For the node camp of the old consensus mechanism, whether it will lead to the birth of hard fork chain.
- Block data nesting with the former blockchain.
- Improved throughput of block and transaction packaging.
- The speed at which blocks are validated.
- .
For the sixth point, the efficiency of successful block production directly affects the efficiency of successful transaction packaging, so the speed of successful transaction also changes with it.
2.0 Consensus process
The consensus mechanism of Ethereum 2.0, which combines the roles discussed by participants in the previous section, seems to be in line with the PoS model. Why so far? Since 2.0 hasn’t been released yet, everything is in flux until then.
A step for consensus in a block’s life flow can be broken down in the following figure.
There are two important randomness in the graph:
- Randomly assign verifiers to
Fragmentation chain
. From the set of verifiers, each part of the verifier is selected and assigned to a fragment chain. - Random proposal verifier. The proposed verifier proposes the block produced by the shard chain for other verifiers to vote on. Votes may be cast for approval or rejection.
Note: The concept of terts is not confirmed to exist in Ethereum 2.0, so it is not included in the diagram. And irreversible is an ideal state,
Finally, you can take a look at some tentative client software that will run to communicate with the beacon chain: