Adjust virtual gas

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-11-11 18:59:48 +01:00
parent 336aa95ab5
commit f130cd6fca
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 4 additions and 4 deletions

View File

@ -133,13 +133,13 @@ func (pl *pricelistV0) OnMethodInvocation(value abi.TokenAmount, methodNum abi.M
// OnIpldGet returns the gas used for storing an object // OnIpldGet returns the gas used for storing an object
func (pl *pricelistV0) OnIpldGet() GasCharge { func (pl *pricelistV0) OnIpldGet() GasCharge {
return newGasCharge("OnIpldGet", pl.ipldGetBase, 0) return newGasCharge("OnIpldGet", pl.ipldGetBase, 0).WithVirtual(114617, 0)
} }
// OnIpldPut returns the gas used for storing an object // OnIpldPut returns the gas used for storing an object
func (pl *pricelistV0) OnIpldPut(dataSize int) GasCharge { func (pl *pricelistV0) OnIpldPut(dataSize int) GasCharge {
return newGasCharge("OnIpldPut", pl.ipldPutBase, int64(dataSize)*pl.ipldPutPerByte*pl.storageGasMulti). return newGasCharge("OnIpldPut", pl.ipldPutBase, int64(dataSize)*pl.ipldPutPerByte*pl.storageGasMulti).
WithExtra(dataSize) WithExtra(dataSize).WithVirtual(400000, int64(dataSize)*1300)
} }
// OnCreateActor returns the gas used for creating an actor // OnCreateActor returns the gas used for creating an actor
@ -208,7 +208,7 @@ 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). return newGasCharge("OnVerifyPost", gasUsed, 0).WithVirtual(117680921+43780len(info.ChallengedSectors), 0)
WithExtra(map[string]interface{}{ WithExtra(map[string]interface{}{
"type": sectorSize, "type": sectorSize,
"size": len(info.ChallengedSectors), "size": len(info.ChallengedSectors),

View File

@ -50,7 +50,7 @@ func (m *Message) ValueReceived() abi.TokenAmount {
} }
// EnableGasTracing, if true, outputs gas tracing in execution traces. // EnableGasTracing, if true, outputs gas tracing in execution traces.
var EnableGasTracing = false var EnableGasTracing = true
type Runtime struct { type Runtime struct {
rt2.Message rt2.Message