diff options
author | Martin Holst Swende <martin@swende.se> | 2019-08-05 16:01:02 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-08-05 16:01:02 +0800 |
commit | aa6005b469fdd1aa7a95f501ce87908011f43159 (patch) | |
tree | 53a14d1b2f32798bbf22b2d74d4cbf16239b86b7 /core/vm/gas.go | |
parent | a7de796840eeb267e298bcc98cdaa3a538234bef (diff) | |
download | go-tangerine-aa6005b469fdd1aa7a95f501ce87908011f43159.tar go-tangerine-aa6005b469fdd1aa7a95f501ce87908011f43159.tar.gz go-tangerine-aa6005b469fdd1aa7a95f501ce87908011f43159.tar.bz2 go-tangerine-aa6005b469fdd1aa7a95f501ce87908011f43159.tar.lz go-tangerine-aa6005b469fdd1aa7a95f501ce87908011f43159.tar.xz go-tangerine-aa6005b469fdd1aa7a95f501ce87908011f43159.tar.zst go-tangerine-aa6005b469fdd1aa7a95f501ce87908011f43159.zip |
core/vm, params: refactor chain configuration (#19735)
* params, core/vm: deprecating gastable, part 1
* core/vm, params: deprecate gastable, use both constant and dynamic gas
* core/vm, params: remove gastable, remove copypaste
* core/vm: make use of the chainrules
* interpreter: make tracing count constant+dynamic gas
* core/vm: review concerns (param/method name changes)
* core/vm: make use of chainrules more
Diffstat (limited to 'core/vm/gas.go')
-rw-r--r-- | core/vm/gas.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/vm/gas.go b/core/vm/gas.go index 022a84f24..bd8b4f104 100644 --- a/core/vm/gas.go +++ b/core/vm/gas.go @@ -18,8 +18,6 @@ package vm import ( "math/big" - - "github.com/ethereum/go-ethereum/params" ) // Gas costs @@ -34,10 +32,10 @@ const ( // calcGas returns the actual gas cost of the call. // -// The cost of gas was changed during the homestead price change HF. To allow for EIP150 -// to be implemented. The returned gas is gas - base * 63 / 64. -func callGas(gasTable params.GasTable, availableGas, base uint64, callCost *big.Int) (uint64, error) { - if gasTable.CreateBySuicide > 0 { +// The cost of gas was changed during the homestead price change HF. +// As part of EIP 150 (TangerineWhistle), the returned gas is gas - base * 63 / 64. +func callGas(isEip150 bool, availableGas, base uint64, callCost *big.Int) (uint64, error) { + if isEip150 { availableGas = availableGas - base gas := availableGas - availableGas/64 // If the bit length exceeds 64 bit we know that the newly calculated "gas" for EIP150 |