Skip to content

Commit

Permalink
Merge pull request #4651 from filecoin-project/feat/prep-for-gasb
Browse files Browse the repository at this point in the history
Prep for gas balancing
  • Loading branch information
magik6k authored Oct 30, 2020
2 parents fb492d9 + d8d9291 commit f380d6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions chain/vm/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ var prices = map[abi.ChainEpoch]Pricelist{
scale: 85639,
},
},
verifyPostDiscount: true,
verifyConsensusFault: 495422,
},
}
Expand Down
5 changes: 4 additions & 1 deletion chain/vm/gas_v0.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ type pricelistV0 struct {
computeUnsealedSectorCidBase int64
verifySealBase int64
verifyPostLookup map[abi.RegisteredPoStProof]scalingCost
verifyPostDiscount bool
verifyConsensusFault int64
}

Expand Down Expand Up @@ -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{}{
Expand Down

0 comments on commit f380d6b

Please sign in to comment.