# 以太坊 The Merge 重點摘要
#### ECN Shanghai Meetup | Lightning Talk
<br></br>
#### Hsiao-Wei Wang
#### GitHub @hwwhww | Twitter @icebearhww
#### Ethereum Foundation | Researcher
#### 2021-10-26
---
[TOC]
---
## 1. 什麼是 The Merge?
---
### 大概是這樣

- *Eth1*: 目前的 **Proof-of-Work** Chain
- *Eth2*: 目前的 **Proof-of-Stake** Beacon Chain
---
### Execution Layer (EL)
#### 目前的 PoW chain

Execution engine 即是 EVM
#### 抽出 Execution Layer 核心

PoW mining 相關的欄位將會被棄用(deprecated)
##### Image: [When Merge](https://opensea.io/collection/when-merge) by Danny Ryan
Note:
1. EVM 執行交易
2. state_root 一樣會紀錄 state account 的狀態
---
### 合併後的區塊

| | EL | CL |
| -------- | -------- | -------- |
| 主要功能 | 執行 EVM | Validator 驗證邏輯 |
| Fork choice rule | - | LMD-Ghost
| Transaction Pool | 不變 | - |
| Networking | 以 devp2p 和其他 EL 節點連線 | 以 libp2p 和其他 CL 節點連線
##### Image: [When Merge](https://opensea.io/collection/when-merge) by Danny Ryan
Note:
1. 外層的 state_root: beacon chain state
2. EL 內的 state_root: EVM account state
3. 區塊驗證者簽名在 consensus layer
4. 抽象化 execution layer
- "data block"
---
### Merge Transition

##### Image: [When Merge](https://opensea.io/collection/when-merge) by Danny Ryan
Note:
1. 上面是目前正在運行中的 PoW chain 以及
2. 下面左邊是合併前的 beacon chain
3. 合併後的 beacon chain 會包含 EL 的區塊資料
---
### APIs

- beacon node 和 execution engine 之間以 RPC call 傳送 request/response
- 各自開啟向外網路所需的接口 port
- 將擴充 web3 APIs
##### Image: [When Merge](https://opensea.io/collection/when-merge) by Danny Ryan
---
## 2. 什麼時候 The Merge Hard Fork 硬分岔?
- 目前進展:
- 2021年10月:EL-CL客戶端以初版 spec,interop 成功
- Pithos 測試鏈運行中
- 預計2022年11月會再凍結一版 spec
- 除了客戶端核心的開發與測試,也需要以太坊生態系相關 tool/infrastructure 一同升級
- **也許** 會在 2022 上半年開始進行硬分岔升級 🤞
- 第一次硬分岔目標:最小化架構修改以減少開發者 debugging 的負擔
- 後續會有 *進一步清理* 的 clean up 硬分岔,刪除不需要的資料欄位和補足新功能
- 例如:驗證者 withdrawal 提款功能
---
## 3. 作為以太坊使用者,The Merge 後使用體驗會有什麼差異?
- *Eth1 節點維護者*:由於會有 2-3 個主要 daemon 要維護,內部架構上會較複雜一些;但開發者會封裝成易於使用的容器(container)。
- *Dapp 開發者*:基本上沒有差異!唯一要注意:
- 區塊中的 `difficulty` 欄位值將變成 `0`,未來會有 EIP 用 beacon chain 上產生的亂數作為 `DIFFICULTY` opcode 的值
- *Dapp 服務提供者*:要注意權益證明的區塊鏈 finality (最終確定性) 有所不同。
- 工作量證明: 只有**機率上的**最終確定性,服務提供者自行選擇所信任的已確認區塊(多少) 數量
- 權益證明:2-epoch(~12 分鐘)可有最終確定性
---
## 了解更多
- Pithos 測試鏈
- [Guide | How to setup a validator for Ethereum staking on Pithos testnet in 10 minutes or less](https://www.coincashew.com/coins/overview-eth/guide-or-how-to-setup-a-validator-for-ethereum-staking-on-pithos-testnet-in-10-minutes-or-less)
- [EIP-3675: Upgrade consensus to Proof-of-Stake](https://eips.ethereum.org/EIPS/eip-3675)
- [The Merge Mainnet Readiness Checklist](https://github.com/ethereum/pm/blob/master/Merge/mainnet-readiness.md)
---
# Thanks!
## 🐼
<style>
.reveal {
font-size: 24px !important;
}
.reveal h1 {
font-size: 70px !important;
}
.reveal h4 {
font-size: 30px !important;
}
.reveal h5 {
font-size: 16px !important;
}
.reveal code {
color: #268bd2 !important;
}
.reveal li {
padding-top: 0.5em;
}
.reveal b, strong {
color: #d33682;
}
.reveal i, em {
color: #2aa198 !important;
}
.reveal section img {
border: 0;
box-shadow: 0 0 0px
}
</style>
{"slideOptions":{"theme":"solarized","slideNumber":true}}