Skip to content

Commit e58e32b

Browse files
holimanBelfordZ
authored andcommitted
Automatically merged updates to draft EIP(s) 1884 (ethereum#2175)
Hi, I'm a bot! This change was automatically merged because: - It only modifies existing Draft or Last Call EIP(s) - The PR was approved or written by at least one author of each modified EIP - The build is passing
1 parent bade302 commit e58e32b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

EIPS/eip-1884.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ At block `N`,
3636

3737
- The `SLOAD` (`0x54`) operation changes from `200` to `800` gas,
3838
- The `BALANCE` (`0x31`) operation changes from `400` to `700` gas,
39+
- The `EXTCODEHASH` (`0x3F`) operation changes from `400` to `700` gas,
3940
- A new opcode, `SELFBALANCE` is introduced at `0x46`.
4041
- `SELFBALANCE` pops `0` arguments off the stack,
4142
- `SELFBALANCE` pushes the `balance` of the current address to the stack,
@@ -91,6 +92,15 @@ opcodes: `EXTBALANCE(address)` and `SELFBALANCE`, and have two different prices.
9192
* As for why it is priced at `5` (`GasFastStep`) instead of `2` (`GasQuickStep`), like other similar operations: the EVM execution engine still needs a lookup into the (cached) trie, and `balance`, unlike `gasPrice` or `timeStamp`, is not constant during the execution, so it has a bit more inherent overhead.
9293

9394

95+
### `EXTCODEHASH`
96+
97+
`EXTCODEHASH` was introduced in Constantinople, with [EIP 1052](https://eips.ethereum.org/EIPS/eip-1052). It was priced at `400` with the reasoning:
98+
99+
> The gas cost is the same as the gas cost for the `BALANCE` opcode because the execution of the `EXTCODEHASH` requires the same account lookup as in `BALANCE`.
100+
101+
Ergo, if we increase `BALANCE`, we should also increase `EXTCODEHASH`
102+
103+
94104
## Backwards Compatibility
95105

96106
The changes require a hardfork. The changes have the following consequences:

0 commit comments

Comments
 (0)