Add new gas prices for SLOAD/BALANCE/EXTCODEHASH for Istanbul (EIP1884)

This commit is contained in:
Alex Beregszaszi 2019-11-07 12:56:28 +00:00
parent 71a310a2ea
commit 21312f52f2

View File

@ -53,7 +53,12 @@ namespace GasCosts
} }
inline unsigned balanceGas(langutil::EVMVersion _evmVersion) inline unsigned balanceGas(langutil::EVMVersion _evmVersion)
{ {
return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 400 : 20; if (_evmVersion >= langutil::EVMVersion::istanbul())
return 700;
else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle())
return 400;
else
return 20;
} }
static unsigned const expGas = 10; static unsigned const expGas = 10;
inline unsigned expByteGas(langutil::EVMVersion _evmVersion) inline unsigned expByteGas(langutil::EVMVersion _evmVersion)
@ -64,7 +69,12 @@ namespace GasCosts
static unsigned const keccak256WordGas = 6; static unsigned const keccak256WordGas = 6;
inline unsigned sloadGas(langutil::EVMVersion _evmVersion) inline unsigned sloadGas(langutil::EVMVersion _evmVersion)
{ {
return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 200 : 50; if (_evmVersion >= langutil::EVMVersion::istanbul())
return 800;
else if (_evmVersion >= langutil::EVMVersion::tangerineWhistle())
return 200;
else
return 50;
} }
static unsigned const sstoreSetGas = 20000; static unsigned const sstoreSetGas = 20000;
static unsigned const sstoreResetGas = 5000; static unsigned const sstoreResetGas = 5000;