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
This commit is contained in:
Felix Lange
2017-11-28 20:05:49 +01:00
committed by Péter Szilágyi
parent 8f35e3086c
commit be12392fba
4 changed files with 55 additions and 99 deletions

View File

@ -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