Skip to content

Commit

Permalink
Merge pull request #5992 from filecoin-project/asr/lt/gas-paych-special
Browse files Browse the repository at this point in the history
fix: gas estimation: do not special case paych collects
  • Loading branch information
simlecode authored May 30, 2023
2 parents c2c2290 + 606aa91 commit 6f43df3
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pkg/messagepool/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
builtin2 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/exitcode"

"github.com/filecoin-project/venus/pkg/constants"
Expand Down Expand Up @@ -342,18 +341,6 @@ func (mp *MessagePool) evalMessageGasLimit(ctx context.Context, msgIn *types.Mes
}
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 := mp.sm.ParentState(ctx, ts)
if err == nil {
act, found, err := st.GetActor(ctx, msg.To)
if err == nil && found && builtin.IsPaymentChannelActor(act.Code) && msgIn.Method == builtin2.MethodsPaych.Collect {
// add the refunded gas for DestroyActor back into the gas used
ret += 76e3
}
}

return ret, nil
}

Expand Down

0 comments on commit 6f43df3

Please sign in to comment.