Fix gas multi error in virtual gas

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-11-11 19:18:45 +01:00
parent 238174cfca
commit f9771c67fb
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 2 additions and 6 deletions

View File

@ -13,11 +13,6 @@ import (
"github.com/ipfs/go-cid"
)
const (
GasStorageMulti = 1000
GasComputeMulti = 1
)
type GasCharge struct {
Name string
Extra interface{}

View File

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