Ethereum Berlin Hard Fork: Features and its Effects

Anubha  |  Apr 14, 2021

Ethereum is to undergo a code upgrade in few hours. Termed as Berlin hard fork, it is scheduled for Apr 14th. It would go live on Ethereum mainnet at block number 12,244,000. The changes are adopted on the main network after trials on the testnets in March this year. This update follows previous upgrades Istanbul and Muir Glacier.

To upgrade, Ethereum node operators and miners have to download the latest version of whichever Ethereum client they use. Other users and holders of ethers or any ERC tokens do not need to do anything.

A hard fork is a change to the underlying protocol of the blockchain. Berlin hard fork includes four improvements proposed: EIP- 2565, 2929, 2718, and 2930. These will adjust some gas prices in Ethereum to improve network performance and extra measures against denial of service attacks. These changes would prepare the network for its subsequent London upgrade.

EIPs Included

EIP-2565: ModExp Gas Cost

Reduces the gas cost of ModExp precompile. Currently, it is overpriced, making use of this precompile in operations inefficient and expensive. ModExp, Modular exponentiation is a foundational arithmetic operation for many cryptographic functions including signatures, VDFs, SNARKs, accumulators, and more. The price adjustments would encourage developers to use these cryptographic functions enabling improved security and stronger randomness.

EIP-2929: Gas Cost Increases For State Access Opcodes

This increases the gas cost for SLOAD, *CALL, BALANCE, EXT* and SELFDESTRUCT opcodes when they are used for the first time in a transaction. These storage accessing opcodes are currently underpriced. Historically, these opcodes have been used by malicious actors in creating IO-heavy transactions for attacks, ex. 2016 Shanghai DoS attack, which increases the malicious transaction execution time.

The EIP increases the costs of these opcodes by a factor of ~3, reducing the worst-case processing time to ~7-27 seconds. Even with this change, the IO overhead of accessing storage using opcodes would remain substantial, but it will definitely make it costlier to use them in an attack.

Another benefit of this would be that it also performs most of the work needed to make stateless witness sizes in Ethereum acceptable. It decreases the witness size, thus enabling a single desktop to generate witnesses on time. These could be used in further reducing proving times in case of STARK or SNARK witnesses, reducing the delay, and hence improving the user experience of stateless clients that rely on such witnesses.

EIP-2718: Typed Transaction Envelope

This change defines a new transaction type that is an envelope for future transaction types. By introducing an envelope transaction type, it is only needed to ensure the backward compatibility with existing transactions and from then on there is just the need to solve a much simpler problem of ensuring there is no numbering conflict between TransactionTypes.

EIP-2930: Optional Access Lists

The EIP adds a transaction type that contains an access list, a list of addresses, and storage keys that the transaction plans to access. Accesses outside the list are possible but become more expensive.

What Lies Ahead Berlin

Though Eth 2.0 is the ultimate aim, before that, a controversial EIP-1559 is expected to be implemented in the London upgrade. It has been scheduled for July 2021. EIP-1559 is an update aimed at addressing the high volatility in gas prices. It was introduced by co-founder Vitalik Buterin to change the existing fee model of Ethereum. It proposes to burn a portion of the fee earned by miners to regulate gas prices and make ether deflationary.  Despite concerns from some mining pools, the developers will be going ahead with it.

Related News