Ethereum Shanghai upgrade for geeks: unpacking the tech side
The highly anticipated ethereum Shanghai upgrade is scheduled for activation today, April 12th, following a swift consensus reached during the 157th AllCoreDevs Execution Layer meeting.
What are the execution changes brought by Shanghai?
This move comes after a smooth Goerli testnet transition and aligns with the Ethereum Foundation’s March 28 blog post providing some details. The Shanghai upgrade follows the transition to proof-of-stake. It brings new functionalities to both the execution and consensus layers of the ethereum (ETH) blockchain while also allowing validators to withdraw their stake from the Beacon Chain back to the execution layer.
The upgrade includes changes in the execution layer (Shanghai), consensus layer (Capella), and the Engine application programming interface. Key execution layer changes include EIP-3651 (warm COINBASE), EIP-3855 (PUSH0 instruction), EIP-3860 (limit and meter init code), EIP-4895 (beacon chain push withdrawals as operations), and EIP-6049 (deprecate SELFDESTRUCT).
EIP-3651, Warm COINBASE, optimizes gas costs for direct COINBASE payments on Ethereum by initializing the COINBASE address as warm at the start of transaction execution. This encourages the use of ETH as the primary payment method and maintains compatibility without introducing security concerns.
In the context of ethereum and other blockchain networks, “coinbase” refers to the address that receives the block reward and transaction fees due to mining or validating new blocks. Essentially, the coinbase address is the destination where newly minted cryptocurrency and collected fees are sent to compensate miners or validators for their work in maintaining the network and confirming transactions.
PUSH0 instruction (EIP-3855)
EIP-3855 introduces the PUSH0 instruction, which pushes the constant value 0 onto the stack, optimizing gas usage and reducing contract code size. This proposal aims to decrease the risk of contracts misusing various instructions for optimization and reduce the need for DUP instructions for duplicating zeroes.
Limit and meter init code (EIP-3860)
EIP-3860 proposes a maximum size limit for initcode and applies an extra gas cost for every 32-byte chunk in Ethereum. This ensures fair charging, minimizes risks, and simplifies EVM engines with explicit limits.
Beacon chain push withdrawals (EIP-4895)
EIP-4895 introduces a system-level “operation” for validator withdrawals from the beacon chain to the EVM. This “push”-based approach processes withdrawals in the execution layer as they are dequeued from the consensus layer. By creating a separate operation type, EIP-4895 simplifies testing and security. There are no associated gas costs for the withdrawal type, as the consensus layer enforces a maximum number of withdrawals to keep operational costs negligible.
Deprecation of self-destruct (EIP-6049)
EIP-6049 aims to deprecate the SELFDESTRUCT opcode in ethereum by discouraging its use and warning developers about potential future changes. The proposal suggests updating the documentation to inform developers about the likelihood of a breaking change, without requiring alterations to ethereum clients.
The Capella upgrade introduces full and partial withdrawals for validators, BLS_TO_EXECUTION_CHANGE messages, and independent state and block historical accumulators. More information on Capella can be found in the v1.3.0-rc.5 specifications.
Staked ETH unlock
With these upgrades, over 18 million staked ether will be unlocked, enabling users to withdraw their staked ETH for the first time. Although there are concerns that this could lead to a mass-selling event, numerous experts voice confidence that long-term holders will continue to stake in recent CNBC and crypto YouTubers EllioTrades and Virtual Bacon believe that long-term believers will continue staking.
The Shanghai upgrade is anticipated to boost trust among stakers and increase the staking ratio from 15% to at least 40% of the total supply. Liquid staking platforms, such as Lido Finance (LDO), are expected to benefit from this development.
Overall, the crypto community remains optimistic about the future of ethereum and the potential impact of the Shanghai upgrade on staking and market dynamics.
Still, it remains to be seen how the market will react when the next fear phase comes and ethereum can not count on the stabilizing presence of over 18 million ETH that can not be sold or moved. As of press time, this is equivalent to about $33.7 billion worth of capital in the staking contract.