address feedback

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-08-07 04:09:01 +02:00
parent 467172f437
commit 884d03f7f1
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
3 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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 {