From d8d92914022060d41d0bd789495a1c0e5717eb21 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Thu, 29 Oct 2020 20:34:48 +0100 Subject: [PATCH] Prep for gas balancing Signed-off-by: Jakub Sztandera --- chain/vm/gas.go | 1 + chain/vm/gas_v0.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/chain/vm/gas.go b/chain/vm/gas.go index cbe5bab13..95551f153 100644 --- a/chain/vm/gas.go +++ b/chain/vm/gas.go @@ -126,6 +126,7 @@ var prices = map[abi.ChainEpoch]Pricelist{ scale: 85639, }, }, + verifyPostDiscount: true, verifyConsensusFault: 495422, }, } diff --git a/chain/vm/gas_v0.go b/chain/vm/gas_v0.go index 7a7fb364d..e4028039b 100644 --- a/chain/vm/gas_v0.go +++ b/chain/vm/gas_v0.go @@ -90,6 +90,7 @@ type pricelistV0 struct { computeUnsealedSectorCidBase int64 verifySealBase int64 verifyPostLookup map[abi.RegisteredPoStProof]scalingCost + verifyPostDiscount bool verifyConsensusFault int64 } @@ -201,7 +202,9 @@ func (pl *pricelistV0) OnVerifyPost(info proof2.WindowPoStVerifyInfo) GasCharge } gasUsed := cost.flat + int64(len(info.ChallengedSectors))*cost.scale - gasUsed /= 2 // XXX: this is an artificial discount + if pl.verifyPostDiscount { + gasUsed /= 2 // XXX: this is an artificial discount + } return newGasCharge("OnVerifyPost", gasUsed, 0). WithExtra(map[string]interface{}{