The highly anticipated Ethereum Cancun upgrade was finally completed on March 13, 2024, marking a significant hard fork upgrade for Ethereum in 2024. This upgrade primarily helped Ethereum improve network efficiency and reduce transaction fees, further driving the development of Ethereum's Layer 2 solutions.
The Cancun upgrade includes a significant update, known as EIP-4844. EIP-4844 introduces a new Blob field on transactions, which can be used to store binary data and consumes only a small amount of Gas. As it is well known, the primary gas consumption for Layer 2 solutions is in submitting transactions to Layer 1 within a specified timeframe. By utilizing the Blob field to store data, transaction fees can be significantly reduced.
Taking Optimism as an example, before the upgrade, transactions used the input field to store data: Optimism Batcher submits L2 data to L1 using the Input field.
After the upgrade, transactions use the Blob field to store data: Optimism Batcher submits L2 data to L1 using the Blob field.
In terms of results, before the upgrade, the Gas fee for submitting data each time was $330, while after the upgrade, the Gas fee for submitting data each time was only $5, resulting in a reduction of fees by 1/60.
The Cancun upgrade also includes two upgrades aimed at reducing Smart Contract Gas consumption, primarily as follows:
EIP-1153: Introduces the SLOAD opcode, allowing Smart Contracts to store temporary variables that are only valid for the current transaction and are reclaimed after transaction execution. Compared to the current Storage operations (which require writing to disk), this can reduce Gas consumption to some extent and improve Smart Contract execution efficiency.
EIP-5656: Introduces a new memory copy instruction, MCOPY
. Compared to the current MLOAD
and MSTORE
, each 256 bytes now consume 27 Gas instead of 96 Gas. These upgrades are designed to enhance the efficiency of Smart Contracts by reducing Gas consumption.
The Cancun upgrade includes EIP-4788, which allows Smart Contracts to read the Block Root of the consensus layer. The Block Root represents the hash of the consensus layer blockchain state. It enables businesses such as Stake Pool, Restake Pool, and Bridge to access the consensus layer state, reducing reliance on oracles and enhancing system security.
EIP-6780: Revamps the SELFDESTRUCT
opcode.
EIP-7516: Introduces the BLOBBASEFEE
instruction, enabling Smart Contracts to query the current Transaction Blob's Gas fee.