diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-02-08 20:39:26 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-02-13 22:15:12 +0800 |
commit | 57f4e9025757254536a738bb4771712038f1e763 (patch) | |
tree | 5d2f140139f3763a7da3c20a88acff96b58ec8ad /params/gas_table.go | |
parent | f8f428cc18c5f70814d7b3937128781bac14bffd (diff) | |
download | go-tangerine-57f4e9025757254536a738bb4771712038f1e763.tar go-tangerine-57f4e9025757254536a738bb4771712038f1e763.tar.gz go-tangerine-57f4e9025757254536a738bb4771712038f1e763.tar.bz2 go-tangerine-57f4e9025757254536a738bb4771712038f1e763.tar.lz go-tangerine-57f4e9025757254536a738bb4771712038f1e763.tar.xz go-tangerine-57f4e9025757254536a738bb4771712038f1e763.tar.zst go-tangerine-57f4e9025757254536a738bb4771712038f1e763.zip |
Revert "params: core, core/vm, miner: 64bit gas instructions (#3514)"
This reverts commit 8b57c494908637a5c0e74f8f7a13b3218e026757.
Diffstat (limited to 'params/gas_table.go')
-rw-r--r-- | params/gas_table.go | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/params/gas_table.go b/params/gas_table.go index a06053904..093dacc8b 100644 --- a/params/gas_table.go +++ b/params/gas_table.go @@ -16,35 +16,41 @@ package params +import "math/big" + type GasTable struct { - ExtcodeSize uint64 - ExtcodeCopy uint64 - Balance uint64 - SLoad uint64 - Calls uint64 - Suicide uint64 + ExtcodeSize *big.Int + ExtcodeCopy *big.Int + Balance *big.Int + SLoad *big.Int + Calls *big.Int + Suicide *big.Int - ExpByte uint64 + ExpByte *big.Int // CreateBySuicide occurs when the // refunded account is one that does // not exist. This logic is similar // to call. May be left nil. Nil means // not charged. - CreateBySuicide uint64 + CreateBySuicide *big.Int } var ( // GasTableHomestead contain the gas prices for // the homestead phase. GasTableHomestead = GasTable{ - ExtcodeSize: 20, - ExtcodeCopy: 20, - Balance: 20, - SLoad: 50, - Calls: 40, - Suicide: 0, - ExpByte: 10, + ExtcodeSize: big.NewInt(20), + ExtcodeCopy: big.NewInt(20), + Balance: big.NewInt(20), + SLoad: big.NewInt(50), + Calls: big.NewInt(40), + Suicide: big.NewInt(0), + ExpByte: big.NewInt(10), + + // explicitly set to nil to indicate + // this rule does not apply to homestead. + CreateBySuicide: nil, } // GasTableHomestead contain the gas re-prices for @@ -52,26 +58,26 @@ var ( // // TODO rename to GasTableEIP150 GasTableHomesteadGasRepriceFork = GasTable{ - ExtcodeSize: 700, - ExtcodeCopy: 700, - Balance: 400, - SLoad: 200, - Calls: 700, - Suicide: 5000, - ExpByte: 10, + ExtcodeSize: big.NewInt(700), + ExtcodeCopy: big.NewInt(700), + Balance: big.NewInt(400), + SLoad: big.NewInt(200), + Calls: big.NewInt(700), + Suicide: big.NewInt(5000), + ExpByte: big.NewInt(10), - CreateBySuicide: 25000, + CreateBySuicide: big.NewInt(25000), } GasTableEIP158 = GasTable{ - ExtcodeSize: 700, - ExtcodeCopy: 700, - Balance: 400, - SLoad: 200, - Calls: 700, - Suicide: 5000, - ExpByte: 50, + ExtcodeSize: big.NewInt(700), + ExtcodeCopy: big.NewInt(700), + Balance: big.NewInt(400), + SLoad: big.NewInt(200), + Calls: big.NewInt(700), + Suicide: big.NewInt(5000), + ExpByte: big.NewInt(50), - CreateBySuicide: 25000, + CreateBySuicide: big.NewInt(25000), } ) |