Skip to content

Commit

Permalink
fix ehtGasPrice is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
agnusmor committed Jan 5, 2024
1 parent a2c67a9 commit 15b79fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pool/effectivegasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (e *EffectiveGasPrice) CalculateBreakEvenGasPrice(rawTx []byte, txGasPrice
return new(big.Int).SetUint64(e.cfg.EthTransferGasPrice), nil
} else if e.cfg.EthTransferL1GasPriceFactor != 0 {
ethGasPrice := uint64(float64(l1GasPrice) * e.cfg.EthTransferL1GasPriceFactor)
if ethGasPrice == 0 {
ethGasPrice = 1
}
return new(big.Int).SetUint64(ethGasPrice), nil
}
}
Expand Down Expand Up @@ -109,7 +112,7 @@ func (e *EffectiveGasPrice) CalculateEffectiveGasPrice(rawTx []byte, txGasPrice
ratioPriority = new(big.Float).Quo(bfTxGasPrice, bfL2GasPrice)
}

log.Infof("bfL2GasPrice: %d, bfTxGasPrice: %d, ratioPriority: %d", bfL2GasPrice, bfTxGasPrice, ratioPriority)
log.Infof("breakEvenGasPrice: %d, bfL2GasPrice: %d, bfTxGasPrice: %d, ratioPriority: %d", breakEvenGasPrice, bfL2GasPrice, bfTxGasPrice, ratioPriority)

bfEffectiveGasPrice := new(big.Float).Mul(new(big.Float).SetInt(breakEvenGasPrice), ratioPriority)

Expand Down

0 comments on commit 15b79fb

Please sign in to comment.