aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-02 03:20:55 +0800
committerobscuren <geffobscura@gmail.com>2014-12-02 03:20:55 +0800
commitd33987cb44529db4f3e117d4b242b1796d41520d (patch)
tree7f5575166458481c1a7598f01294955980b0d2c9
parent6dc46d3341dc5fa25bd005f9606de258874139be (diff)
downloadgo-tangerine-d33987cb44529db4f3e117d4b242b1796d41520d.tar.gz
go-tangerine-d33987cb44529db4f3e117d4b242b1796d41520d.tar.zst
go-tangerine-d33987cb44529db4f3e117d4b242b1796d41520d.zip
Additional fees for *COPY
-rw-r--r--vm/vm_debug.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index 18d3018a0..b9c1d4bc6 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -264,6 +264,12 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
newMemSize.Div(newMemSize, u256(32))
newMemSize.Mul(newMemSize, u256(32))
+ switch op {
+ // Additional gas usage on *CODPY
+ case CALLDATACOPY, CODECOPY, EXTCODECOPY:
+ addStepGasUsage(new(big.Int).Div(newMemSize, u256(32)))
+ }
+
if newMemSize.Cmp(u256(int64(mem.Len()))) > 0 {
memGasUsage := new(big.Int).Sub(newMemSize, u256(int64(mem.Len())))
memGasUsage.Mul(GasMemory, memGasUsage)