Derive gasIncrementAmount from MaxGasEIP1559 and DecayRange. (#850)

* Derive gasIncrementAmount from MaxGasEIP1559 and DecayRange.

* Update default decay range

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
pull/852/head
Abdelhamid Bakhta 5 years ago committed by GitHub
parent 636b93487b
commit 67ae915468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      config/src/main/java/org/hyperledger/besu/config/experimental/ExperimentalEIPs.java
  2. 1
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/fees/FeeMarket.java
  3. 9
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/fees/FeeMarketConfig.java

@ -69,13 +69,7 @@ public class ExperimentalEIPs {
hidden = true,
names = {"--Xeip1559-decay-range"},
arity = "1")
public static Long decayRange = 800000L;
@Option(
hidden = true,
names = {"--Xeip1559-gas-increment-amount"},
arity = "1")
public static Long gasIncrementAmount = 10L;
public static Long decayRange = 1000000L;
@Option(
hidden = true,

@ -40,7 +40,6 @@ public interface FeeMarket {
ExperimentalEIPs.targetGasUsed,
ExperimentalEIPs.slackCoefficient,
ExperimentalEIPs.decayRange,
ExperimentalEIPs.gasIncrementAmount,
ExperimentalEIPs.initialBasefee,
ExperimentalEIPs.perTxGasLimit);
}

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

Loading…
Cancel
Save