aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vm_debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'vm/vm_debug.go')
-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)