EIPs Explained

EIP-606 · Final · Meta · 2017-04-23

EIP-606: Hardfork Meta: Homestead

Meta EIP that records what went into Homestead, Ethereum's first planned hard fork (block 1,150,000, March 2016): EIP-2, DELEGATECALL (EIP-7) and the devp2p changes in EIP-8.

What problem does it solve?

A hard fork bundles several protocol changes and switches them on at one block. Client teams, exchanges and node operators need one authoritative list of what changes and when. Hardfork Meta EIPs provide that list. EIP-606 is the record for Homestead, the upgrade that moved Ethereum out of its initial "Frontier" phase.

The document was written in April 2017, about a year after the fork, so it is a record made after the event rather than a plan.

How it works

The spec lists:

Item Value
Codename Homestead
Mainnet activation block 1,150,000
Morden testnet activation block 494,000
Future testnets block 0

Included proposals:

  • EIP-2, Homestead hard-fork changes.
    • Contract-creation transactions cost 53,000 base gas instead of 21,000.
    • Transaction signatures with s > secp256k1n/2 are invalid, which removes a malleability issue. The ecrecover precompile is unchanged.
    • A contract creation that runs out of gas now fails, instead of leaving an empty contract.
    • The difficulty adjustment formula changes.
  • EIP-7, DELEGATECALL. A new opcode that runs another contract's code in the caller's context, keeping msg.sender and msg.value. It is the basis of libraries and, later, proxy contracts.
  • EIP-8, devp2p forward compatibility. Networking nodes must accept handshake and discovery packets with newer version numbers and extra fields, so the peer-to-peer protocol can evolve without breaking older nodes.

Sample code

Clients describe forks as chain configuration. A Geth-style genesis config that enables Homestead from the start, as many private and test networks do:

{
  "config": {
    "chainId": 1337,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0
  }
}

On mainnet, the equivalent entry is "homesteadBlock": 1150000.

Using the opcode Homestead introduced (Solidity):

(bool ok, bytes memory ret) = impl.delegatecall(abi.encodeWithSignature("setValue(uint256)", 42));
require(ok);

Things to know

  • Homestead itself is Final and has been active for years. Every EVM chain today includes its rules by default.
  • Homestead was followed by the DAO fork (EIP-779) and Tangerine Whistle (EIP-608) in 2016.
  • Morden, the testnet named here, has since been retired.
  • Meta EIPs list changes. They do not specify them. Read the included EIPs for the exact rules.

#hardfork #meta #homestead #history

Details

Authors
Alex Beregszaszi (@axic)
Status
Final
Type
Meta
Created
2017-04-23
Requires
Required by

Machine-readable: Markdown · JSON