Adapt virtual gas
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
f130cd6fca
commit
238174cfca
@ -208,7 +208,8 @@ func (pl *pricelistV0) OnVerifyPost(info proof2.WindowPoStVerifyInfo) GasCharge
|
|||||||
gasUsed /= 2 // XXX: this is an artificial discount
|
gasUsed /= 2 // XXX: this is an artificial discount
|
||||||
}
|
}
|
||||||
|
|
||||||
return newGasCharge("OnVerifyPost", gasUsed, 0).WithVirtual(117680921+43780len(info.ChallengedSectors), 0)
|
return newGasCharge("OnVerifyPost", gasUsed, 0).
|
||||||
|
WithVirtual(117680921+43780*int64(len(info.ChallengedSectors)), 0).
|
||||||
WithExtra(map[string]interface{}{
|
WithExtra(map[string]interface{}{
|
||||||
"type": sectorSize,
|
"type": sectorSize,
|
||||||
"size": len(info.ChallengedSectors),
|
"size": len(info.ChallengedSectors),
|
||||||
|
@ -545,6 +545,12 @@ func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError
|
|||||||
|
|
||||||
Callers: callers[:cout],
|
Callers: callers[:cout],
|
||||||
}
|
}
|
||||||
|
if gasTrace.VirtualStorageGas == 0 {
|
||||||
|
gasTrace.VirtualStorageGas = gasTrace.StorageGas
|
||||||
|
}
|
||||||
|
if gasTrace.VirtualComputeGas == 0 {
|
||||||
|
gasTrace.VirtualComputeGas = gasTrace.ComputeGas
|
||||||
|
}
|
||||||
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