|
|
@ -18,26 +18,27 @@ public class FeeMarketConfig implements FeeMarket { |
|
|
|
private final long basefeeMaxChangeDenominator; |
|
|
|
private final long basefeeMaxChangeDenominator; |
|
|
|
private final long targetGasUsed; |
|
|
|
private final long targetGasUsed; |
|
|
|
private final long decayRange; |
|
|
|
private final long decayRange; |
|
|
|
private final long gasIncrementAmount; |
|
|
|
|
|
|
|
private final long initialBasefee; |
|
|
|
private final long initialBasefee; |
|
|
|
private final long perTxGaslimit; |
|
|
|
private final long perTxGaslimit; |
|
|
|
private final long slackCoefficient; |
|
|
|
private final long slackCoefficient; |
|
|
|
|
|
|
|
private final long maxGas; |
|
|
|
|
|
|
|
private final long gasIncrementAmount; |
|
|
|
|
|
|
|
|
|
|
|
public FeeMarketConfig( |
|
|
|
public FeeMarketConfig( |
|
|
|
final long basefeeMaxChangeDenominator, |
|
|
|
final long basefeeMaxChangeDenominator, |
|
|
|
final long targetGasUsed, |
|
|
|
final long targetGasUsed, |
|
|
|
final long slackCoefficient, |
|
|
|
final long slackCoefficient, |
|
|
|
final long decayRange, |
|
|
|
final long decayRange, |
|
|
|
final long gasIncrementAmount, |
|
|
|
|
|
|
|
final long initialBasefee, |
|
|
|
final long initialBasefee, |
|
|
|
final long perTxGaslimit) { |
|
|
|
final long perTxGaslimit) { |
|
|
|
this.basefeeMaxChangeDenominator = basefeeMaxChangeDenominator; |
|
|
|
this.basefeeMaxChangeDenominator = basefeeMaxChangeDenominator; |
|
|
|
this.targetGasUsed = targetGasUsed; |
|
|
|
this.targetGasUsed = targetGasUsed; |
|
|
|
this.slackCoefficient = slackCoefficient; |
|
|
|
this.slackCoefficient = slackCoefficient; |
|
|
|
this.decayRange = decayRange; |
|
|
|
this.decayRange = decayRange; |
|
|
|
this.gasIncrementAmount = gasIncrementAmount; |
|
|
|
|
|
|
|
this.initialBasefee = initialBasefee; |
|
|
|
this.initialBasefee = initialBasefee; |
|
|
|
this.perTxGaslimit = perTxGaslimit; |
|
|
|
this.perTxGaslimit = perTxGaslimit; |
|
|
|
|
|
|
|
this.maxGas = slackCoefficient * targetGasUsed; |
|
|
|
|
|
|
|
this.gasIncrementAmount = this.maxGas / 2 / this.decayRange; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -52,7 +53,7 @@ public class FeeMarketConfig implements FeeMarket { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public long getMaxGas() { |
|
|
|
public long getMaxGas() { |
|
|
|
return slackCoefficient * targetGasUsed; |
|
|
|
return maxGas; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|