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
d39a7a61
Commit
d39a7a61
authored
Mar 23, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: lint
parent
ce50852a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
7 deletions
+32
-7
OptimismPortal.sol
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
+6
-1
ResourceMetering.sol
packages/contracts-bedrock/contracts/L1/ResourceMetering.sol
+2
-2
SystemConfig.sol
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
+1
-0
FuzzResourceMetering.sol
...tracts-bedrock/contracts/echidna/FuzzResourceMetering.sol
+6
-1
Constants.sol
packages/contracts-bedrock/contracts/libraries/Constants.sol
+5
-1
ResourceMetering.t.sol
...s/contracts-bedrock/contracts/test/ResourceMetering.t.sol
+12
-2
No files found.
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
View file @
d39a7a61
...
@@ -212,7 +212,12 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
...
@@ -212,7 +212,12 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
*
*
* @return ResourceMetering.ResourceConfig
* @return ResourceMetering.ResourceConfig
*/
*/
function _resourceConfig() internal view override returns (ResourceMetering.ResourceConfig memory) {
function _resourceConfig()
internal
view
override
returns (ResourceMetering.ResourceConfig memory)
{
return SYSTEM_CONFIG.resourceConfig();
return SYSTEM_CONFIG.resourceConfig();
}
}
...
...
packages/contracts-bedrock/contracts/L1/ResourceMetering.sol
View file @
d39a7a61
...
@@ -39,7 +39,8 @@ abstract contract ResourceMetering is Initializable {
...
@@ -39,7 +39,8 @@ abstract contract ResourceMetering is Initializable {
* @custom:field elasticityMultiplier Determines the target resource limit along with
* @custom:field elasticityMultiplier Determines the target resource limit along with
* the resource limit.
* the resource limit.
* @custom:field baseFeeMaxChangeDenominator Determines max change on fee per block.
* @custom:field baseFeeMaxChangeDenominator Determines max change on fee per block.
* @custom:field minimumBaseFee The min deposit base fee, it is clamped to this value.
* @custom:field minimumBaseFee The min deposit base fee, it is clamped to this
* value.
* @custom:field systemTxMaxGas The amount of gas supplied to the system
* @custom:field systemTxMaxGas The amount of gas supplied to the system
* transaction. This should be set to the same number
* transaction. This should be set to the same number
* that the op-node sets as the gas limit for the
* that the op-node sets as the gas limit for the
...
@@ -56,7 +57,6 @@ abstract contract ResourceMetering is Initializable {
...
@@ -56,7 +57,6 @@ abstract contract ResourceMetering is Initializable {
uint128 maximumBaseFee;
uint128 maximumBaseFee;
}
}
/**
/**
* @notice EIP-1559 style gas parameters.
* @notice EIP-1559 style gas parameters.
*/
*/
...
...
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
View file @
d39a7a61
...
@@ -148,6 +148,7 @@ contract SystemConfig is OwnableUpgradeable, Semver {
...
@@ -148,6 +148,7 @@ contract SystemConfig is OwnableUpgradeable, Semver {
_setResourceConfig(_config);
_setResourceConfig(_config);
require(_gasLimit >= minimumGasLimit(), "SystemConfig: gas limit too low");
require(_gasLimit >= minimumGasLimit(), "SystemConfig: gas limit too low");
}
}
/**
/**
* @notice Returns the minimum L2 gas limit that can be safely set for the system to
* @notice Returns the minimum L2 gas limit that can be safely set for the system to
* operate. The L2 gas limit must be larger than or equal to the amount of
* operate. The L2 gas limit must be larger than or equal to the amount of
...
...
packages/contracts-bedrock/contracts/echidna/FuzzResourceMetering.sol
View file @
d39a7a61
...
@@ -29,7 +29,12 @@ contract EchidnaFuzzResourceMetering is ResourceMetering, StdUtils {
...
@@ -29,7 +29,12 @@ contract EchidnaFuzzResourceMetering is ResourceMetering, StdUtils {
return _resourceConfig();
return _resourceConfig();
}
}
function _resourceConfig() internal pure override returns (ResourceMetering.ResourceConfig memory) {
function _resourceConfig()
internal
pure
override
returns (ResourceMetering.ResourceConfig memory)
{
ResourceMetering.ResourceConfig memory rcfg = Constants.DEFAULT_RESOURCE_CONFIG();
ResourceMetering.ResourceConfig memory rcfg = Constants.DEFAULT_RESOURCE_CONFIG();
return rcfg;
return rcfg;
}
}
...
...
packages/contracts-bedrock/contracts/libraries/Constants.sol
View file @
d39a7a61
...
@@ -31,7 +31,11 @@ library Constants {
...
@@ -31,7 +31,11 @@ library Constants {
* @notice Returns the default values for the ResourceConfig. These are the recommended values
* @notice Returns the default values for the ResourceConfig. These are the recommended values
* for a production network.
* for a production network.
*/
*/
function DEFAULT_RESOURCE_CONFIG() internal pure returns (ResourceMetering.ResourceConfig memory) {
function DEFAULT_RESOURCE_CONFIG()
internal
pure
returns (ResourceMetering.ResourceConfig memory)
{
ResourceMetering.ResourceConfig memory config = ResourceMetering.ResourceConfig({
ResourceMetering.ResourceConfig memory config = ResourceMetering.ResourceConfig({
maxResourceLimit: 20_000_000,
maxResourceLimit: 20_000_000,
elasticityMultiplier: 10,
elasticityMultiplier: 10,
...
...
packages/contracts-bedrock/contracts/test/ResourceMetering.t.sol
View file @
d39a7a61
...
@@ -19,7 +19,12 @@ contract MeterUser is ResourceMetering {
...
@@ -19,7 +19,12 @@ contract MeterUser is ResourceMetering {
return _resourceConfig();
return _resourceConfig();
}
}
function _resourceConfig() internal pure override returns (ResourceMetering.ResourceConfig memory) {
function _resourceConfig()
internal
pure
override
returns (ResourceMetering.ResourceConfig memory)
{
return Constants.DEFAULT_RESOURCE_CONFIG();
return Constants.DEFAULT_RESOURCE_CONFIG();
}
}
...
@@ -176,7 +181,12 @@ contract CustomMeterUser is ResourceMetering {
...
@@ -176,7 +181,12 @@ contract CustomMeterUser is ResourceMetering {
});
});
}
}
function _resourceConfig() internal pure override returns (ResourceMetering.ResourceConfig memory) {
function _resourceConfig()
internal
pure
override
returns (ResourceMetering.ResourceConfig memory)
{
return Constants.DEFAULT_RESOURCE_CONFIG();
return Constants.DEFAULT_RESOURCE_CONFIG();
}
}
...
...
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