Shapella hard fork
Shanghai (execution) + Capella (consensus) · Mainnet 2023-04-12
Staked ETH and rewards became withdrawable.
What changed
- Validators
- Staked ETH could be withdrawn for the first time. There are two kinds of withdrawals. Rewards above 32 ETH are deposited automatically and periodically to the withdrawal address without any request. To stop validating and receive your principal as well, you request an exit. Withdrawals are processed directly by the protocol rather than as ordinary transactions, so they cost no gas. However, validators whose withdrawal credentials used the old scheme (BLS, 0x00) first had to send a message changing them to an execution layer address (0x01).
- Users
- Users who do not stake directly see no change on screen. However, the uncertainty about when staked ETH could be unlocked is gone, so staking directly, without going through an exchange or a liquid staking token, became a realistic alternative. There was concern that opening withdrawals would trigger a mass exodus, but in practice the total amount of staked ETH kept growing even after withdrawals.
- Wallet & app developers
- The smart contract development environment changed slightly. A dedicated instruction for pushing 0 onto the stack, PUSH0, was added, so code that handles zero values compiles to use less gas. The cost of accessing the block producer address (COINBASE) dropped, which made the pattern of sending fees directly to block builders cheaper. On the other hand, the initialization code (initcode) used to deploy a contract now has a size limit and a gas charge proportional to its size, so deployment transactions that are too large are rejected. Contracts that are already deployed are unaffected, and to use PUSH0 you must set the compiler's EVM version to shanghai or later.
- L2
- Nothing changed directly for L2 operation itself. However, contracts compiled to use PUSH0 failed to deploy on L2s and other EVM chains that had not yet adopted Shanghai. Teams deploying the same code to several chains had to set the compiler's EVM version separately for each chain for a while, and major L2s later gained PUSH0 support through their own upgrades.