Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Mar 28, 2024
1 parent 006f2cd commit d54ed07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 3 additions & 1 deletion packages/protocol/contracts/L2/LibL2Config.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ library LibL2Config {
// We need to monitor L2 state growth and lower this value when necessary.
config_.gasTargetPerL1Block = 60_000_000;
config_.basefeeAdjustmentQuotient = 8;
config_.gasExcessMinValue = 18_000_000_000;

// We pick this value to make the min base fee 0.1gwei
config_.gasExcessMinValue = 18_440_000_000;
}
}
11 changes: 1 addition & 10 deletions packages/protocol/test/L2/Lib1559Math.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@ contract TestLib1559Math is TaikoTest {
uint256 i;

baseFee = Lib1559Math.basefee(config.gasExcessMinValue, adjustmentFactor);
assertEq(baseFee, 40_253_331); // about 0.04gwei
assertEq(baseFee, 100_671_168); // about 0.1gwei
console2.log("gasExcessMinValue:", config.gasExcessMinValue);
console2.log("min base fee:", baseFee);

for (; baseFee < 1 gwei / 10; ++i) {
baseFee = Lib1559Math.basefee(config.gasTargetPerL1Block * i, adjustmentFactor);
console2.log("base fee:", i, baseFee);
}

// base fee will reach 1 gwei if gasExcess > 18540000000
console2.log("base fee will reach 0.1 gwei if gasExcess >", config.gasTargetPerL1Block * i);
assertEq(i, 309);

for (; baseFee < 1 gwei; ++i) {
baseFee = Lib1559Math.basefee(config.gasTargetPerL1Block * i, adjustmentFactor);
console2.log("base fee:", i, baseFee);
Expand Down

0 comments on commit d54ed07

Please sign in to comment.