Merge pull request #10549 from filecoin-project/asr/gas-paych-special

fix: gas estimation: don't special case paych collects
This commit is contained in:
Łukasz Magiera 2023-03-23 15:15:05 +01:00 committed by GitHub
commit ce17546a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -372,18 +372,6 @@ func gasEstimateGasLimit(
} }
ret = (ret * int64(transitionalMulti*1024)) >> 10 ret = (ret * int64(transitionalMulti*1024)) >> 10
// Special case for PaymentChannel collect, which is deleting actor
// We ignore errors in this special case since they CAN occur,
// and we just want to detect existing payment channel actors
st, err := smgr.ParentState(ts)
if err == nil {
act, err := st.GetActor(msg.To)
if err == nil && lbuiltin.IsPaymentChannelActor(act.Code) && msgIn.Method == builtin.MethodsPaych.Collect {
// add the refunded gas for DestroyActor back into the gas used
ret += 76e3
}
}
return ret, nil return ret, nil
} }