128

本次硬分叉是使用 EIP150 中提到的是按 (1) 还是 (2) 来实行?

dodo333 · 于 发布 · 最后由 xuxin5108回复 · 599 次阅读
  • 5 large
  • 1014 large
  • 279 large
    xuxin5108

    根据EIP150中的1-c进行
    Specification (version 1)

    If block.number >= FORK_BLKNUM, then:

    Increase the gas cost of EXTCODESIZE to 700
    Increase the base gas cost of EXTCODECOPY to 700
    Increase the gas cost of BALANCE to 400
    Increase the gas cost of SLOAD to 200
    Increase the gas cost of CALL, DELEGATECALL, CALLCODE to 700
    Increase the gas cost of SUICIDE to 5000
    Increase the recommended gas limit target to 5.5 million
    If a call asks for more gas than the maximum allowed amount, do not return an OOG error; instead, call with the maximum allowed amount of gas (this is equivalent to a version of #90)
    That is, substitute:

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

    With:

            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 = compustate.gas - extra_gas
            submsg_gas = gas + opcodes.GSTIPEND * (value > 0)

    Specification (version 1c)

    All of the above, and:

    If SUICIDE hits a newly created account, it triggers an additional gas cost of 25000 (similar to CALLs)