Make VerifyPost cheaper

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-07-31 21:38:23 +02:00
parent 6d21255678
commit ae29d132ed
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -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),