EIP-1716 Hardfork meta: Petersburg ("Hardfork Meta: Petersburg")
Final · Other · EIP status Final · created 2019-01-21
A Meta document recording the content of the Petersburg hardfork, created in 2019 to remove EIP-1283 from the Constantinople hardfork.
Why it is needed
The Constantinople hardfork included EIP-1283, which lowered the cost of modifying storage. But shortly before activation, analysis emerged showing this change could open a new attack vector: reentrancy attacks. A reentrancy attack is a technique where unexpected code gets inserted into the gap while one contract calls another, draining assets. Since Constantinople code had already been deployed across multiple clients, a separate hardfork was needed solely to remove the problematic EIP-1283. That hardfork is Petersburg. This document records its activation block and the removed item as the official record.
What changes
Today
- Constantinople included EIP-1283 (net gas metering for SSTORE)
- If EIP-1283 activated as is, a reentrancy attack vector was identified as possible
After EIP-1716
- Petersburg applies at the same block as Constantinople, disabling EIP-1283
- Constantinople and Petersburg apply together starting at mainnet block 7,280,000
Who is affected
- Client teams: The application order and priority of the two forks, Constantinople and Petersburg, had to be implemented precisely.
- Contract developer: With EIP-1283 removed, SSTORE gas costs stayed under the existing rules.
- Ordinary users: The potential reentrancy attack vector was blocked before it opened, with no separate action needed for protection.
In depth
Fork overview and aliases
The codename is Petersburg, with the aliases St. Petersfork, Peter's Fork, and Constantinople Fix. Its type is Meta and its status is Final. This fork does exactly one thing: remove EIP-1283 from Constantinople (EIP-1013).
Activation blocks
Ethereum mainnet activates at Block >= 7,280,000, the Ropsten testnet at Block >= 4,939,394, Kovan at Block >= 10,255,201, and Rinkeby at Block >= 4,321,234. The Görli testnet activates at Block >= 0, applying from genesis.
Removed EIP: 1283
The sole item removed is EIP-1283 (Net gas metering for SSTORE without dirty maps). It introduces net gas metering for SSTORE without dirty maps, but was dropped after a reentrancy attack vector was identified. The removal was agreed at All-Core-Devs call #53 in January 2019.
Priority rules relative to Constantinople
If Petersburg and Constantinople apply at the same block, Petersburg takes priority and as a result EIP-1283 is disabled. If Petersburg is defined at an earlier block than Constantinople, there is no immediate effect at the Petersburg fork point, and EIP-1283 must be disabled later when Constantinople activates. On mainnet, both forks were set to the same block (7,280,000).
Background for removal: reentrancy attack vector
The original References state that EIP-1283 had to be removed from Constantinople because of a potential reentrancy attack vector, citing an analysis post by ChainSecurity and the Ethereum Foundation's February 2019 upgrade announcement. This document's status is Final, so it is a settled record that will not change further.