Commit aa675751 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #4955 from ethereum-optimism/jm/fix-dbl-div

fix(ctb): Use multiplication of divisors for more precision
parents 7b7a26c3 f9a0e80d
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -92,8 +92,7 @@ abstract contract ResourceMetering is Initializable {
// spam the L2 system. Fee scheme is very similar to EIP-1559 with minor changes.
int256 gasUsedDelta = int256(uint256(params.prevBoughtGas)) - TARGET_RESOURCE_LIMIT;
int256 baseFeeDelta = (int256(uint256(params.prevBaseFee)) * gasUsedDelta) /
TARGET_RESOURCE_LIMIT /
BASE_FEE_MAX_CHANGE_DENOMINATOR;
(TARGET_RESOURCE_LIMIT * BASE_FEE_MAX_CHANGE_DENOMINATOR);
// Update base fee by adding the base fee delta and clamp the resulting value between
// min and max.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment