EIP 150: Gas cost changes for IO-heavy operations Source

Author Vitalik Buterin Final Standards Track Core 2016-09-24

Parameters

FORK_BLKNUM CHAIN_ID CHAIN_NAME
2,463,000 1 Main net

Specification

If block.number >= FORK_BLKNUM, then:

• Increase the gas cost of EXTCODESIZE to 700 (from 20).
• Increase the base gas cost of EXTCODECOPY to 700 (from 20).
• Increase the gas cost of BALANCE to 400 (from 20).
• Increase the gas cost of SLOAD to 200 (from 50).
• Increase the gas cost of CALL, DELEGATECALL, CALLCODE to 700 (from 40).
• Increase the gas cost of SELFDESTRUCT to 5000 (from 0).
• If SELFDESTRUCT hits a newly created account, it triggers an additional gas cost of 25000 (similar to CALLs).
• Increase the recommended gas limit target to 5.5 million.
• Define “all but one 64th” of N as N - floor(N / 64).
• If a call asks for more gas than the maximum allowed amount (i.e. the total amount of gas remaining in the parent after subtracting the gas cost of the call and memory expansion), do not return an OOG error; instead, if a call asks for more gas than all but one 64th of the maximum allowed amount, call with all but one 64th of the maximum allowed amount of gas (this is equivalent to a version of EIP-901 plus EIP-1142). CREATE only provides all but one 64th of the parent gas to the child call.

That is, substitute:

extra_gas = (not ext.account_exists(to)) * opcodes.GCALLNEWACCOUNT + \
(value > 0) * opcodes.GCALLVALUETRANSFER
if compustate.gas < gas + extra_gas:
return vm_exception('OUT OF GAS', needed=gas+extra_gas)
submsg_gas = gas + opcodes.GSTIPEND * (value > 0)

With:

def max_call_gas(gas):
return gas - (gas // 64)

extra_gas = (not ext.account_exists(to)) * opcodes.GCALLNEWACCOUNT + \
(value > 0) * opcodes.GCALLVALUETRANSFER
if compustate.gas < extra_gas:
return vm_exception('OUT OF GAS', needed=extra_gas)
if compustate.gas < gas + extra_gas:
gas = min(gas, max_call_gas(compustate.gas - extra_gas))
submsg_gas = gas + opcodes.GSTIPEND * (value > 0)