diff --git a/chain/types/message.go b/chain/types/message.go index a2b7c391c27..edd003e326d 100644 --- a/chain/types/message.go +++ b/chain/types/message.go @@ -141,7 +141,7 @@ func (m *Message) ValidForBlockInclusion(minGas int64) error { return xerrors.New("'Value' field cannot be greater than total filecoin supply") } - if m.GasPrice.LessThan(big.Zero()) { + if m.GasFeeCap.LessThan(big.Zero()) { return xerrors.New("'GasPrice' field cannot be negative") } diff --git a/node/impl/full/mpool.go b/node/impl/full/mpool.go index df4428801dd..d4400359d83 100644 --- a/node/impl/full/mpool.go +++ b/node/impl/full/mpool.go @@ -9,6 +9,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/messagepool" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" @@ -118,6 +119,12 @@ func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message) (*t } msg.GasPrice = gasPrice } + if msg.GasPremium == types.EmptyInt || types.BigCmp(msg.GasPremium, types.NewInt(0)) == 0 { + msg.GasPremium = types.NewInt(100) + } + if msg.GasFeeCap == types.EmptyInt || types.BigCmp(msg.GasFeeCap, types.NewInt(0)) == 0 { + msg.GasFeeCap = types.NewInt(10 * build.InitialBaseFee) + } return a.Mpool.PushWithNonce(ctx, msg.From, func(from address.Address, nonce uint64) (*types.SignedMessage, error) { msg.Nonce = nonce