Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
4a01d275
Commit
4a01d275
authored
Apr 13, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: lint system config
parent
e3516b38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
SystemConfig.sol
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
+5
-2
OptimismPortal.t.sol
...ges/contracts-bedrock/contracts/test/OptimismPortal.t.sol
+3
-3
No files found.
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
View file @
4a01d275
...
@@ -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(
...
...
packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol
View file @
4a01d275
...
@@ -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));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment