diff options
author | gary rong <garyrong0905@gmail.com> | 2018-07-24 23:06:40 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-07-24 23:06:40 +0800 |
commit | 2433349c808fad601419d1f06275bec5b6a93ec8 (patch) | |
tree | 883b11148d15fd8a191131a9aaf17731f28856d0 /params | |
parent | cab1cff11cbcd4ff60f1a149deb71ec87413b487 (diff) | |
download | go-tangerine-2433349c808fad601419d1f06275bec5b6a93ec8.tar go-tangerine-2433349c808fad601419d1f06275bec5b6a93ec8.tar.gz go-tangerine-2433349c808fad601419d1f06275bec5b6a93ec8.tar.bz2 go-tangerine-2433349c808fad601419d1f06275bec5b6a93ec8.tar.lz go-tangerine-2433349c808fad601419d1f06275bec5b6a93ec8.tar.xz go-tangerine-2433349c808fad601419d1f06275bec5b6a93ec8.tar.zst go-tangerine-2433349c808fad601419d1f06275bec5b6a93ec8.zip |
core/vm, params: implement EXTCODEHASH opcode (#17202)
* core/vm, params: implement EXTCODEHASH opcode
* core, params: tiny fixes and polish
* core: add function description
Diffstat (limited to 'params')
-rw-r--r-- | params/config.go | 2 | ||||
-rw-r--r-- | params/gas_table.go | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/params/config.go b/params/config.go index 6e6a5cb8b..b9e9bb8d6 100644 --- a/params/config.go +++ b/params/config.go @@ -211,6 +211,8 @@ func (c *ChainConfig) GasTable(num *big.Int) GasTable { return GasTableHomestead } switch { + case c.IsConstantinople(num): + return GasTableConstantinople case c.IsEIP158(num): return GasTableEIP158 case c.IsEIP150(num): diff --git a/params/gas_table.go b/params/gas_table.go index d33bebbe5..6c4a38269 100644 --- a/params/gas_table.go +++ b/params/gas_table.go @@ -20,6 +20,7 @@ package params type GasTable struct { ExtcodeSize uint64 ExtcodeCopy uint64 + ExtcodeHash uint64 Balance uint64 SLoad uint64 Calls uint64 @@ -63,7 +64,7 @@ var ( CreateBySuicide: 25000, } // GasTableEIP158 contain the gas re-prices for - // the EIP15* phase. + // the EIP155/EIP158 phase. GasTableEIP158 = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, @@ -75,4 +76,18 @@ var ( CreateBySuicide: 25000, } + // GasTableConstantinople contain the gas re-prices for + // the constantinople phase. + GasTableConstantinople = GasTable{ + ExtcodeSize: 700, + ExtcodeCopy: 700, + ExtcodeHash: 400, + Balance: 400, + SLoad: 200, + Calls: 700, + Suicide: 5000, + ExpByte: 50, + + CreateBySuicide: 25000, + } ) |