diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2017-11-29 03:05:49 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-11-29 03:05:49 +0800 |
commit | be12392fbad9f4a861130a347e6bcf07a5c34974 (patch) | |
tree | 266aa5788b2dd154509a5de7eecdf24db0c95fc6 /core/vm/evm.go | |
parent | 8f35e3086cbea24839c5435b1cebe85a438b42d3 (diff) | |
download | go-tangerine-be12392fbad9f4a861130a347e6bcf07a5c34974.tar go-tangerine-be12392fbad9f4a861130a347e6bcf07a5c34974.tar.gz go-tangerine-be12392fbad9f4a861130a347e6bcf07a5c34974.tar.bz2 go-tangerine-be12392fbad9f4a861130a347e6bcf07a5c34974.tar.lz go-tangerine-be12392fbad9f4a861130a347e6bcf07a5c34974.tar.xz go-tangerine-be12392fbad9f4a861130a347e6bcf07a5c34974.tar.zst go-tangerine-be12392fbad9f4a861130a347e6bcf07a5c34974.zip |
core/vm: track 63/64 call gas off stack (#15563)
* core/vm: track 63/64 call gas off stack
Gas calculations in gasCall* relayed the available gas for calls by
replacing it on the stack. This lead to inconsistent traces, which we
papered over by copying the pre-execution stack in trace mode.
This change relays available gas using a temporary variable, off the
stack, and allows removing the weird copy.
* core/vm: remove stackCopy
* core/vm: pop call gas into pool
* core/vm: to -> addr
Diffstat (limited to 'core/vm/evm.go')
-rw-r--r-- | core/vm/evm.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/vm/evm.go b/core/vm/evm.go index 093c7d4c1..344435f73 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -104,6 +104,10 @@ type EVM struct { // abort is used to abort the EVM calling operations // NOTE: must be set atomically abort int32 + // callGasTemp holds the gas available for the current call. This is needed because the + // available gas is calculated in gasCall* according to the 63/64 rule and later + // applied in opCall*. + callGasTemp uint64 } // NewEVM retutrns a new EVM . The returned EVM is not thread safe and should |