core/vm, params: implement EIP2200, SSTORE optimizations (#19964)

* core/vm, params: implement EIP2200, SSTORE optimizations

* core/vm, params: switch EIP2200 to Wei's version
This commit is contained in:
Péter Szilágyi
2019-08-19 14:39:38 +03:00
committed by GitHub
parent 9dfca5df4b
commit 3bb9b49afb
4 changed files with 142 additions and 1 deletions

View File

@ -27,6 +27,8 @@ import (
// defined jump tables are not polluted.
func EnableEIP(eipNum int, jt *JumpTable) error {
switch eipNum {
case 2200:
enable2200(jt)
case 1884:
enable1884(jt)
case 1344:
@ -83,3 +85,8 @@ func opChainID(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memo
stack.push(chainId)
return nil, nil
}
// enable2200 applies EIP-2200 (Rebalance net-metered SSTORE)
func enable2200(jt *JumpTable) {
jt[SSTORE].dynamicGas = gasSStoreEIP2200
}