Skip to content

Commit

Permalink
Merge pull request ethereum#155 from etclabscore/fix/eip2200-sload-co…
Browse files Browse the repository at this point in the history
…nstantgas

vm,vars: install SLOAD constantGas to eip2200
  • Loading branch information
meowsbits authored Jul 27, 2020
2 parents 8b4e8e7 + 6e969c4 commit 04c5320
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/vm/eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func opChainID(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([

// enable2200 applies EIP-2200 (Rebalance net-metered SSTORE)
func enable2200(jt *JumpTable) {
// TODO(meowsbits): audit this
jt[SLOAD].constantGas = vars.SloadGasEIP2200
jt[SSTORE].dynamicGas = gasSStoreEIP2200
}

Expand Down
10 changes: 5 additions & 5 deletions params/vars/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ var (
ExtcodeSizeGasEIP150 uint64 = 700 // Cost of EXTCODESIZE after EIP 150 (Tangerine)
SloadGasFrontier uint64 = 50
SloadGasEIP150 uint64 = 200
SloadGasEIP1884 uint64 = 800 // Cost of SLOAD after EIP 1884 (part of Istanbul)
SloadGasEIP2200 uint64 = 800 // Cost of SLOAD after EIP 2200 (part of Istanbul)
ExtcodeHashGasConstantinople uint64 = 400 // Cost of EXTCODEHASH (introduced in Constantinople)
ExtcodeHashGasEIP1884 uint64 = 700 // Cost of EXTCODEHASH after EIP 1884 (part in Istanbul)
SelfdestructGasEIP150 uint64 = 5000 // Cost of SELFDESTRUCT post EIP 150 (Tangerine)
SloadGasEIP1884 uint64 = 800 // Cost of SLOAD after EIP 1884 (part of Istanbul)
SloadGasEIP2200 uint64 = SloadGasEIP1884 // Cost of SLOAD after EIP 2200 (part of Istanbul).
ExtcodeHashGasConstantinople uint64 = 400 // Cost of EXTCODEHASH (introduced in Constantinople)
ExtcodeHashGasEIP1884 uint64 = 700 // Cost of EXTCODEHASH after EIP 1884 (part in Istanbul)
SelfdestructGasEIP150 uint64 = 5000 // Cost of SELFDESTRUCT post EIP 150 (Tangerine)

// EXP has a dynamic portion depending on the size of the exponent
ExpByteFrontier uint64 = 10 // was set to 10 in Frontier
Expand Down

0 comments on commit 04c5320

Please sign in to comment.