core/evm: avoid copying memory for input in calls (#20177)

* core/evm, contracts: avoid copying memory for input in calls + make ecrecover not modify input buffer

* core/vm: optimize mstore a bit

* core/vm: change Get -> GetCopy in vm memory access
This commit is contained in:
Martin Holst Swende
2019-11-04 10:31:10 +01:00
committed by Péter Szilágyi
parent 7a6d5d0cce
commit b566cfdffd
6 changed files with 84 additions and 18 deletions

View File

@ -99,7 +99,7 @@ func (mw *memoryWrapper) slice(begin, end int64) []byte {
log.Warn("Tracer accessed out of bound memory", "available", mw.memory.Len(), "offset", begin, "size", end-begin)
return nil
}
return mw.memory.Get(begin, end-begin)
return mw.memory.GetCopy(begin, end-begin)
}
// getUint returns the 32 bytes at the specified address interpreted as a uint.