Fix gas multi error in virtual gas
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
238174cfca
commit
f9771c67fb
@ -13,11 +13,6 @@ import (
|
|||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
GasStorageMulti = 1000
|
|
||||||
GasComputeMulti = 1
|
|
||||||
)
|
|
||||||
|
|
||||||
type GasCharge struct {
|
type GasCharge struct {
|
||||||
Name string
|
Name string
|
||||||
Extra interface{}
|
Extra interface{}
|
||||||
|
@ -539,7 +539,6 @@ func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError
|
|||||||
ComputeGas: gas.ComputeGas,
|
ComputeGas: gas.ComputeGas,
|
||||||
StorageGas: gas.StorageGas,
|
StorageGas: gas.StorageGas,
|
||||||
|
|
||||||
TotalVirtualGas: gas.VirtualCompute*GasComputeMulti + gas.VirtualStorage*GasStorageMulti,
|
|
||||||
VirtualComputeGas: gas.VirtualCompute,
|
VirtualComputeGas: gas.VirtualCompute,
|
||||||
VirtualStorageGas: gas.VirtualStorage,
|
VirtualStorageGas: gas.VirtualStorage,
|
||||||
|
|
||||||
@ -551,6 +550,8 @@ func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError
|
|||||||
if gasTrace.VirtualComputeGas == 0 {
|
if gasTrace.VirtualComputeGas == 0 {
|
||||||
gasTrace.VirtualComputeGas = gasTrace.ComputeGas
|
gasTrace.VirtualComputeGas = gasTrace.ComputeGas
|
||||||
}
|
}
|
||||||
|
gasTrace.TotalVirtualGas = gasTrace.VirtualComputeGas + gasTrace.VirtualStorageGas
|
||||||
|
|
||||||
rt.executionTrace.GasCharges = append(rt.executionTrace.GasCharges, &gasTrace)
|
rt.executionTrace.GasCharges = append(rt.executionTrace.GasCharges, &gasTrace)
|
||||||
rt.lastGasChargeTime = now
|
rt.lastGasChargeTime = now
|
||||||
rt.lastGasCharge = &gasTrace
|
rt.lastGasCharge = &gasTrace
|
||||||
|
Loading…
Reference in New Issue
Block a user