address feedback
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
467172f437
commit
884d03f7f1
@ -88,7 +88,7 @@ func (mp *MessagePool) selectMessages(curTs, ts *types.TipSet) ([]*types.SignedM
|
|||||||
last := len(chains)
|
last := len(chains)
|
||||||
for i, chain := range chains {
|
for i, chain := range chains {
|
||||||
// does it fit in the block?
|
// does it fit in the block?
|
||||||
if chain.gasLimit <= gasLimit {
|
if chain.gasLimit <= gasLimit && chain.gasPerf > 0 {
|
||||||
gasLimit -= chain.gasLimit
|
gasLimit -= chain.gasLimit
|
||||||
result = append(result, chain.msgs...)
|
result = append(result, chain.msgs...)
|
||||||
continue
|
continue
|
||||||
@ -127,7 +127,7 @@ tailLoop:
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// does it fit in the bock?
|
// does it fit in the bock?
|
||||||
if chain.gasLimit <= gasLimit {
|
if chain.gasLimit <= gasLimit && chain.gasPerf > 0 {
|
||||||
gasLimit -= chain.gasLimit
|
gasLimit -= chain.gasLimit
|
||||||
result = append(result, chain.msgs...)
|
result = append(result, chain.msgs...)
|
||||||
continue
|
continue
|
||||||
|
@ -140,7 +140,11 @@ func (m *Message) ValidForBlockInclusion(minGas int64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if m.GasFeeCap.LessThan(big.Zero()) {
|
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 {
|
if m.GasLimit > build.BlockGasLimit {
|
||||||
|
@ -71,7 +71,7 @@ func ComputeGasOutputs(gasUsed, gasLimit int64, baseFee, feeCap, gasPremium abi.
|
|||||||
baseFeeToPay = feeCap
|
baseFeeToPay = feeCap
|
||||||
out.MinerPenalty = big.Mul(big.Sub(baseFee, feeCap), gasUsedBig)
|
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
|
minerTip := gasPremium
|
||||||
if big.Cmp(big.Add(baseFeeToPay, minerTip), feeCap) > 0 {
|
if big.Cmp(big.Add(baseFeeToPay, minerTip), feeCap) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user