---
title: "為 Ethereum 的 Berlin 硬分叉做準備"
description: "了解 Alchemy 如何為 Berlin 硬分叉做準備，以及身為 Alchemy 使用者的你需要做哪些準備。"
---

# 為 Ethereum 的 Berlin 硬分叉做準備

本週三，2021 年 4 月 14 日，Ethereum 基金會的 [Berlin 硬分叉](https://blog.ethereum.org/2021/03/08/ethereum-berlin-upgrade-announcement/) 升級預定在主網區塊 12,244,000 生效。

此次系統性升級將導入四項 Ethereum Improvement Proposals（EIPs），分別是 [2565](https://eips.ethereum.org/EIPS/eip-2565)、[2718](https://eips.ethereum.org/EIPS/eip-2718)、[2929](https://eips.ethereum.org/EIPS/eip-2929) 和 [2930](https://eips.ethereum.org/EIPS/eip-2930)，這些是邁向 Ethereum 2.0 更大藍圖的一部分。

### 這對我來說代表什麼？

如果你使用 [Alchemy](https://dashboard.alchemy.com/signup?referral=affiliate:aed2ba93-969a-4812-ab81-27928b15db31) 作為 Ethereum 節點供應商，你不需要做任何事！

身為領先的區塊鏈開發者平台，我們的工作就是處理所有複雜的 Ethereum 基礎設施，讓你可以專注在建構應用程式，而不是運行、維護和升級節點。

我們的團隊已經為這次升級準備數個月了——包括版本說明審查、回歸測試、藍綠部署等等（[還有更多](https://medium.com/alchemy-api/dont-get-forked-best-practices-for-handling-constantinople-and-ethereum-client-upgrades-e0d6b5dd8e9c)）——所以這次升級發生時，你的過渡會很順暢。

如果你_沒有_使用 Alchemy，那麼將你的節點更新到相容 Berlin 的版本就非常重要，否則在區塊 12,244,000 之後，它將無法與網路其他部分相容。

在 Ethereum 基金會的[升級公告](https://blog.ethereum.org/2021/03/08/ethereum-berlin-upgrade-announcement/)中，他們列出了與 Berlin 升級相容的客戶端版本。我們也在下方整理出來方便你參考。

<EmbeddedTable
  table={{
    columns: [
      { key: "1", width: 200, title: "Client", dataType: "object" },
      { key: "2", width: 200, title: "Version Number", dataType: "object" },
    ],
    data: [
      {
        "1": { title: "<p>go-ethereum (geth)</p>", tooltip: "", icon: "" },
        "2": { title: "<p>1.10.1</p>", tooltip: "", icon: "" },
        id: 0,
      },
      {
        "1": { title: "<p>OpenEthereum (f.k.a. Parity)</p>", tooltip: "", icon: "" },
        "2": { title: "<p>3.2.0</p>", tooltip: "", icon: "" },
        id: 1,
      },
      {
        "1": { title: "<p>Nethermind</p>", tooltip: "", icon: "" },
        "2": { title: "<p>1.10.31</p>", tooltip: "", icon: "" },
        id: 2,
      },
      {
        "1": { title: "<p>Besu</p>", tooltip: "", icon: "" },
        "2": { title: "<p>21.1.1 21.1.2</p>", tooltip: "", icon: "" },
        id: 3,
      },
      {
        "1": { title: "<p>EthereumJS VM</p>", tooltip: "", icon: "" },
        "2": { title: "<p>v5.2.0</p>", tooltip: "", icon: "" },
        id: 4,
      },
    ],
  }}
/>

‍

### 有沒有什麼最佳實務需要考慮？

問得好。強烈建議你看看[這篇部落格文章](https://medium.com/alchemy-api/dont-get-forked-best-practices-for-handling-constantinople-and-ethereum-client-upgrades-e0d6b5dd8e9c)，這是我們在 Constantinople 硬分叉期間撰寫的最佳實務。

特別針對 Berlin 硬分叉，確保你的交易相容於 [EIP-155](https://eips.ethereum.org/EIPS/eip-155) 以防範重放攻擊，這點很重要。在 Berlin 升級之後，[geth](https://www.alchemy.com/overviews/what-is-a-geth-node-and-how-to-run-one) 客戶端預設會強制執行 EIP-155 相容性，這代表如果你的交易不符合此 EIP，將會失敗。

在撰寫本文時，Alchemy 仍然支援 EIP-155 之前的未受保護交易（我們會在此變成強制要求之前，給予使用者充分的警告），但養成格式化 EIP-155 相容請求的習慣是很好的做法。

### 如果我不參與這次升級會怎麼樣？

這是個壞主意。升級發生後，你的客戶端會保持同步在分叉前的區塊鏈上。因此，你會卡在一個已棄用的鏈上，無法轉移 ether 或與升級後的 Ethereum 網路互動。

### 這次升級中有哪些新的 EIP？

以下是 Ethereum 基金會對每個 EIP 的簡短說明：

- [EIP-2565: ModExp Gas Cost](https://eips.ethereum.org/EIPS/eip-2565) 降低了[模冪運算](https://eips.ethereum.org/EIPS/eip-198)（ModExp 0x00..05）預編譯的成本，使其成本與其他操作相近。
- [EIP-2718: Typed Transaction Envelope](https://eips.ethereum.org/EIPS/eip-2718) 引入一種新的交易類型，作為一個信封（envelope），以更容易支援多種交易類型。
- [EIP-2929: Gas cost increases for state access opcodes](https://eips.ethereum.org/EIPS/eip-2929) 提高了 SLOAD、CALL、BALANCE、EXT 和 SELFEDESTRUCT 在一次交易中首次使用時的 gas 成本，首次呼叫之後的 gas 成本則固定不變。
- [EIP-2930: Optional access lists](https://eips.ethereum.org/EIPS/eip-2930) 新增一種交易類型，其中包含一份存取清單（access list），也就是該交易計畫存取的地址與儲存鍵列表。這可以緩解 EIP-2929 帶來的部分 gas 成本增加。

### 再也不用擔心硬分叉……

如果你正在做 Ethereum 專案，不想處理維護節點的額外負擔，[免費註冊 Alchemy](https://dashboard.alchemy.com/signup?referral=affiliate:aed2ba93-969a-4812-ab81-27928b15db31)！Alchemy 提供最快、最具擴展性且最可靠的 Ethereum 基礎設施即服務，讓你可以專注在打造自己的產品。在幕後，我們建構了革命性的全新基礎設施，正在為所有領先的 NFT 開發者平台、大部分的 DeFi 等提供支援！想了解更多，請造訪 [alchemy.com](https://dashboard.alchemy.com/signup?referral=affiliate:aed2ba93-969a-4812-ab81-27928b15db31)。
