diff --git a/src/Common/LondonTransaction.php b/src/Common/LondonTransaction.php index 8d301b3..605bfd1 100644 --- a/src/Common/LondonTransaction.php +++ b/src/Common/LondonTransaction.php @@ -298,6 +298,7 @@ public function setGasFeeTip(OOGmp $gasFeeTip): static public function useRpcEstimatesWithBump(AbstractRPC $rpc, ?Address $from, int $bumpGasPercentage, int $bumpFeePercentage): static { $gas = ($rpc->ethEstimateGas($this, $from) * ($bumpFeePercentage + 100)) / 100; + $gas = (int)ceil($gas); $base = Functions::getPessimisticBlockBaseFee($rpc->ethGetBlockByNumber(), 3, EIP1559Config::sepolia() /* using sepolia as only difference for this config is start block, which is 0. This function is expected to be called on London transaction for London-enabled chains, regardless of starting block */ diff --git a/src/Utils/Functions.php b/src/Utils/Functions.php index 080195f..a07fd59 100644 --- a/src/Utils/Functions.php +++ b/src/Utils/Functions.php @@ -167,7 +167,7 @@ public static function getNextBlockBaseFee(Block $previous, EIP1559Config $confi return new OOGmp(EIP1559Config::INITIAL_BASE_FEE); } - $parentGasTarget = $previous->gasLimit / EIP1559Config::ELASTICITY_MULTIPLIER; + $parentGasTarget = (int)floor($previous->gasLimit / EIP1559Config::ELASTICITY_MULTIPLIER); if($parentGasTarget == $previous->gasUsed) { return $previous->baseFeePerGas; }