Commit 4a01d275 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: lint system config

parent e3516b38
...@@ -269,8 +269,11 @@ contract SystemConfig is OwnableUpgradeable, Semver { ...@@ -269,8 +269,11 @@ contract SystemConfig is OwnableUpgradeable, Semver {
_config.minimumBaseFee <= _config.maximumBaseFee, _config.minimumBaseFee <= _config.maximumBaseFee,
"SystemConfig: min base fee must be less than max base" "SystemConfig: min base fee must be less than max base"
); );
// Base fee change denominator must be greater than 0. // Base fee change denominator must be greater than 1.
require(_config.baseFeeMaxChangeDenominator > 1, "SystemConfig: denominator must be larger than 1"); require(
_config.baseFeeMaxChangeDenominator > 1,
"SystemConfig: denominator must be larger than 1"
);
// Max resource limit plus system tx gas must be less than or equal to the L2 gas limit. // Max resource limit plus system tx gas must be less than or equal to the L2 gas limit.
// The gas limit must be increased before these values can be increased. // The gas limit must be increased before these values can be increased.
require( require(
......
...@@ -1092,7 +1092,6 @@ contract OptimismPortalUpgradeable_Test is Portal_Initializer { ...@@ -1092,7 +1092,6 @@ contract OptimismPortalUpgradeable_Test is Portal_Initializer {
* broken by changing the config. * broken by changing the config.
*/ */
contract OptimismPortalResourceFuzz_Test is Portal_Initializer { contract OptimismPortalResourceFuzz_Test is Portal_Initializer {
/** /**
* @dev The max gas limit observed throughout this test. Setting this too high can cause * @dev The max gas limit observed throughout this test. Setting this too high can cause
* the test to take too long to run. * the test to take too long to run.
...@@ -1118,7 +1117,7 @@ contract OptimismPortalResourceFuzz_Test is Portal_Initializer { ...@@ -1118,7 +1117,7 @@ contract OptimismPortalResourceFuzz_Test is Portal_Initializer {
uint64 gasLimit = systemConfig.gasLimit(); uint64 gasLimit = systemConfig.gasLimit();
// Bound resource config // Bound resource config
_maxResourceLimit = uint32(bound(_maxResourceLimit, 21000, MAX_GAS_LIMIT / 8)); _maxResourceLimit = uint32(bound(_maxResourceLimit, 21000, MAX_GAS_LIMIT / 8));
_gasLimit = uint64(bound( _gasLimit, 21000, _maxResourceLimit)); _gasLimit = uint64(bound(_gasLimit, 21000, _maxResourceLimit));
_prevBaseFee = uint128(bound(_prevBaseFee, 0, 5 gwei)); _prevBaseFee = uint128(bound(_prevBaseFee, 0, 5 gwei));
// Prevent values that would cause reverts // Prevent values that would cause reverts
vm.assume(gasLimit >= _gasLimit); vm.assume(gasLimit >= _gasLimit);
...@@ -1127,7 +1126,8 @@ contract OptimismPortalResourceFuzz_Test is Portal_Initializer { ...@@ -1127,7 +1126,8 @@ contract OptimismPortalResourceFuzz_Test is Portal_Initializer {
vm.assume(uint256(_maxResourceLimit) + uint256(_systemTxMaxGas) <= gasLimit); vm.assume(uint256(_maxResourceLimit) + uint256(_systemTxMaxGas) <= gasLimit);
vm.assume(_elasticityMultiplier > 0); vm.assume(_elasticityMultiplier > 0);
vm.assume( vm.assume(
((_maxResourceLimit / _elasticityMultiplier) * _elasticityMultiplier) == _maxResourceLimit ((_maxResourceLimit / _elasticityMultiplier) * _elasticityMultiplier) ==
_maxResourceLimit
); );
_prevBoughtGas = uint64(bound(_prevBoughtGas, 0, _maxResourceLimit - _gasLimit)); _prevBoughtGas = uint64(bound(_prevBoughtGas, 0, _maxResourceLimit - _gasLimit));
_blockDiff = uint8(bound(_blockDiff, 0, 3)); _blockDiff = uint8(bound(_blockDiff, 0, 3));
......
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