diff --git a/chain/messagepool/selection.go b/chain/messagepool/selection.go index 27b16ae40..ed408330e 100644 --- a/chain/messagepool/selection.go +++ b/chain/messagepool/selection.go @@ -88,7 +88,7 @@ func (mp *MessagePool) selectMessages(curTs, ts *types.TipSet) ([]*types.SignedM last := len(chains) for i, chain := range chains { // does it fit in the block? - if chain.gasLimit <= gasLimit { + if chain.gasLimit <= gasLimit && chain.gasPerf > 0 { gasLimit -= chain.gasLimit result = append(result, chain.msgs...) continue @@ -127,7 +127,7 @@ tailLoop: continue } // does it fit in the bock? - if chain.gasLimit <= gasLimit { + if chain.gasLimit <= gasLimit && chain.gasPerf > 0 { gasLimit -= chain.gasLimit result = append(result, chain.msgs...) continue diff --git a/chain/types/message.go b/chain/types/message.go index e4d6f341c..eb03edd67 100644 --- a/chain/types/message.go +++ b/chain/types/message.go @@ -140,7 +140,11 @@ func (m *Message) ValidForBlockInclusion(minGas int64) error { } if m.GasFeeCap.LessThan(big.Zero()) { - return xerrors.New("'GasPrice' field cannot be negative") + return xerrors.New("'GasFeeCap' field cannot be negative") + } + + if m.GasPremium.LessThan(big.Zero()) { + return xerrors.New("'GasPremium' field cannot be negative") } if m.GasLimit > build.BlockGasLimit { diff --git a/chain/vm/burn.go b/chain/vm/burn.go index da05553d6..bad132de9 100644 --- a/chain/vm/burn.go +++ b/chain/vm/burn.go @@ -71,7 +71,7 @@ func ComputeGasOutputs(gasUsed, gasLimit int64, baseFee, feeCap, gasPremium abi. baseFeeToPay = feeCap out.MinerPenalty = big.Mul(big.Sub(baseFee, feeCap), gasUsedBig) } - out.BaseFeeBurn = big.Mul(baseFeeToPay, big.NewInt(gasUsed)) + out.BaseFeeBurn = big.Mul(baseFeeToPay, gasUsedBig) minerTip := gasPremium if big.Cmp(big.Add(baseFeeToPay, minerTip), feeCap) > 0 {