Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gas: overestimate around the Hygge upgrade #10333

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions node/impl/full/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,15 @@ func gasEstimateGasLimit(

transitionalMulti := 1.0
// Overestimate gas around the upgrade
if ts.Height() <= build.UpgradeSkyrHeight && (build.UpgradeSkyrHeight-ts.Height() <= 20) {
transitionalMulti = 2.0

if ts.Height() <= build.UpgradeHyggeHeight && (build.UpgradeHyggeHeight-ts.Height() <= 20) {
func() {

// Bare transfers get about 3x more expensive: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0057.md#product-considerations
if msgIn.Method == builtin.MethodSend {
transitionalMulti = 3.0
return
}

st, err := smgr.ParentState(ts)
if err != nil {
return
Expand All @@ -342,26 +347,27 @@ func gasEstimateGasLimit(

if lbuiltin.IsStorageMinerActor(act.Code) {
switch msgIn.Method {
case 5:
transitionalMulti = 3.954
case 3:
transitionalMulti = 1.92
case 4:
transitionalMulti = 1.72
case 6:
transitionalMulti = 4.095
transitionalMulti = 1.06
case 7:
// skip, stay at 2.0
// transitionalMulti = 1.289
case 11:
transitionalMulti = 17.8758
transitionalMulti = 1.2
case 16:
transitionalMulti = 2.1704
case 25:
transitionalMulti = 3.1177
transitionalMulti = 1.19
case 18:
transitionalMulti = 1.73
case 23:
transitionalMulti = 1.73
case 26:
transitionalMulti = 2.3322
transitionalMulti = 1.15
case 27:
transitionalMulti = 1.18
default:
}
}

// skip storage market, 80th percentie for everything ~1.9, leave it at 2.0
}()
}
ret = (ret * int64(transitionalMulti*1024)) >> 10
Expand Down