From ae29d132ed0dee8b1e93df15ed8061ca43078e78 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 31 Jul 2020 21:38:23 +0200 Subject: [PATCH] Make VerifyPost cheaper Signed-off-by: Jakub Sztandera --- chain/vm/gas_v0.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chain/vm/gas_v0.go b/chain/vm/gas_v0.go index 45c6d6d9d..f13710a1b 100644 --- a/chain/vm/gas_v0.go +++ b/chain/vm/gas_v0.go @@ -197,7 +197,10 @@ func (pl *pricelistV0) OnVerifyPost(info abi.WindowPoStVerifyInfo) GasCharge { cost = pl.verifyPostLookup[abi.RegisteredPoStProof_StackedDrgWindow512MiBV1] } - return newGasCharge("OnVerifyPost", cost.flat+int64(len(info.ChallengedSectors))*cost.scale, 0). + gasUsed := cost.flat + int64(len(info.ChallengedSectors))*cost.scale + gasUsed /= 2 // XXX: this is an artificial discount + + return newGasCharge("OnVerifyPost", gasUsed, 0). WithExtra(map[string]interface{}{ "type": sectorSize, "size": len(info.ChallengedSectors),