Skip to content

Commit

Permalink
fix target gas calc in block production
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Nelson <[email protected]>
  • Loading branch information
non-fungible-nelson authored Jan 18, 2024
1 parent 5a3ed75 commit 5896d04
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ public class FrontierTargetingGasLimitCalculator extends AbstractGasLimitSpecifi
private final long maxConstantAdjustmentIncrement;

public FrontierTargetingGasLimitCalculator() {
this(DEFAULT_MAX_CONSTANT_ADMUSTMENT_INCREMENT, DEFAULT_MIN_GAS_LIMIT, DEFAULT_MAX_GAS_LIMIT);
this(DEFAULT_MIN_GAS_LIMIT, DEFAULT_MAX_GAS_LIMIT);
}

public FrontierTargetingGasLimitCalculator(
final long maxConstantAdjustmentIncrement, final long minGasLimit, final long maxGasLimit) {
final long minGasLimit, final long maxGasLimit) {
super(minGasLimit, maxGasLimit);
this.maxConstantAdjustmentIncrement = maxConstantAdjustmentIncrement;
}

@Override
Expand All @@ -56,7 +55,7 @@ public long nextGasLimit(

private long adjustAmount(final long currentGasLimit) {
final long maxProportionalAdjustmentLimit = Math.max(deltaBound(currentGasLimit) - 1, 0);
return Math.min(maxConstantAdjustmentIncrement, maxProportionalAdjustmentLimit);
return maxProportionalAdjustmentLimit;
}

protected long safeAddAtMost(final long gasLimit) {
Expand Down

0 comments on commit 5896d04

Please sign in to comment.