Gas Costs After the Berlin Hard Fork

·

The Berlin hard fork, implemented on April 14, introduced four EIPs. Two of them—EIP-2929 and EIP-2930—impact gas costs for transactions. This article explains how certain gas costs were calculated before Berlin, how EIP-2929 changes them, and how to use access lists introduced by EIP-2930.

Key Takeaways


Pre-Berlin Gas Costs

SLOAD Before Berlin

SSTORE Before Berlin


Post-EIP-2929 Gas Costs

Accessed Addresses and Storage Keys

Updated Gas Costs

OpcodePre-BerlinPost-Berlin (Not Accessed)Post-Berlin (Accessed)
SLOAD8002,100100
SSTORE (0→1)20,00022,10020,000
SSTORE (1→2)5,0005,0002,900
CALL7002,600100

EIP-2930: Access List Transactions

How Access Lists Work

Optimizing with eth_createAccessList


FAQs

1. Will access lists always reduce gas costs?

No. Overhead for adding addresses/keys may offset savings.

2. How does Berlin affect existing contracts?

Contracts relying on hardcoded gas values may break. Access lists can mitigate this.

3. Is the called contract’s address automatically accessed?

Yes. tx.to is added to accessed_addresses by default.

4. What’s the main purpose of access lists?

To prevent contract breaks due to EIP-2929’s higher gas costs.


Conclusion

👉 Explore more Ethereum upgrades

References: EIP-2929, EIP-2930, EIP-2200.