From f9771c67fbeb10bb0d1c64e6a545439731aef10e Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 11 Nov 2020 19:18:45 +0100 Subject: [PATCH] Fix gas multi error in virtual gas Signed-off-by: Jakub Sztandera --- chain/vm/gas.go | 5 ----- chain/vm/runtime.go | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/chain/vm/gas.go b/chain/vm/gas.go index 731f0c4d5..a4e40b71e 100644 --- a/chain/vm/gas.go +++ b/chain/vm/gas.go @@ -13,11 +13,6 @@ import ( "github.com/ipfs/go-cid" ) -const ( - GasStorageMulti = 1000 - GasComputeMulti = 1 -) - type GasCharge struct { Name string Extra interface{} diff --git a/chain/vm/runtime.go b/chain/vm/runtime.go index d8a950bc0..f95a23bf9 100644 --- a/chain/vm/runtime.go +++ b/chain/vm/runtime.go @@ -539,7 +539,6 @@ func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError ComputeGas: gas.ComputeGas, StorageGas: gas.StorageGas, - TotalVirtualGas: gas.VirtualCompute*GasComputeMulti + gas.VirtualStorage*GasStorageMulti, VirtualComputeGas: gas.VirtualCompute, VirtualStorageGas: gas.VirtualStorage, @@ -551,6 +550,8 @@ func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError if gasTrace.VirtualComputeGas == 0 { gasTrace.VirtualComputeGas = gasTrace.ComputeGas } + gasTrace.TotalVirtualGas = gasTrace.VirtualComputeGas + gasTrace.VirtualStorageGas + rt.executionTrace.GasCharges = append(rt.executionTrace.GasCharges, &gasTrace) rt.lastGasChargeTime = now rt.lastGasCharge = &gasTrace