forked from ethereum-optimism/superchain-ops
-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: splits the gas limit used in the RevenueShareUgradePath #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
0xDiscotech
merged 3 commits into
fix/l2-target-proxyadmin
from
refactor/split-gaslimit-revshare
Oct 9, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,24 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| /// @notice Address of the ProxyAdmin predeploy on L2. | ||
| address internal constant PROXY_ADMIN = 0x4200000000000000000000000000000000000018; | ||
|
|
||
| /// @notice Based on deployment tests, these are the average gas costs for each of the deployments: | ||
| /// - L1 Withdrawer: TBD | ||
| /// - SC Rev Share Calculator: 518,168 | ||
| /// - Fee Vaults: 757,214 | ||
| /// - Fee Splitter: 1,027,359 | ||
| /// A buffer of ~20% is applied to each value to have enough margin. | ||
|
|
||
| /// @notice The gas limit for the SC Rev Share Calculator deployment. | ||
| uint64 internal constant SC_REV_SHARE_CALCULATOR_DEPLOYMENT_GAS_LIMIT = 625_000; | ||
| /// @notice The gas limit for the L1 Withdrawer deployment. | ||
| uint64 internal constant L1_WITHDRAWER_DEPLOYMENT_GAS_LIMIT = 625_000; | ||
| /// @notice The gas limit for the Fee Vaults deployment. | ||
| uint64 internal constant FEE_VAULTS_DEPLOYMENT_GAS_LIMIT = 910_000; | ||
| /// @notice The gas limit for the Fee Splitter deployment. | ||
| uint64 internal constant FEE_SPLITTER_DEPLOYMENT_GAS_LIMIT = 1_235_000; | ||
| /// @notice The gas limit for the upgrade calls on L2. | ||
| uint64 internal constant UPGRADE_GAS_LIMIT = 500_000; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: Update this number when we have more precise information, probably can be the half or less. https://linear.app/defi-wonderland/issue/OPT-1210/update-l1withdrawer-deployment-cost-when-we-know-the-value |
||
|
|
||
| /// @notice Used to validate calls made to the OptimismPortal. | ||
| mapping(bytes32 => uint8) internal _callsToPortal; | ||
|
|
||
|
|
@@ -93,9 +111,6 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| /// @notice Config value indicating if the chain is opting in to use FeeSplitter | ||
| bool public optInRevenueShare; | ||
|
|
||
| /// @notice Config value indicating the gas limit for L2 calls | ||
| uint64 public deploymentGasLimit; | ||
|
|
||
| /// @notice The address the OperatorFeeVault implementation is deployed to. | ||
| address internal _operatorFeeVaultPrecalculatedAddress; | ||
| /// @notice The calldata sent to the OptimismPortal to deploy the OperatorFeeVault. | ||
|
|
@@ -166,12 +181,6 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| saltSeed = _toml.readString(".saltSeed"); | ||
| require(bytes(saltSeed).length != 0, "saltSeed must be set in the config"); | ||
|
|
||
| uint256 _deploymentGasLimitRaw = _toml.readUint(".deploymentGasLimit"); | ||
| require(_deploymentGasLimitRaw > 0, "deploymentGasLimit must be set in config"); | ||
| require(_deploymentGasLimitRaw <= type(uint64).max, "deploymentGasLimit must be less than uint64.max"); | ||
|
|
||
| deploymentGasLimit = uint64(_deploymentGasLimitRaw); | ||
|
|
||
| optInRevenueShare = _toml.readBool(".optInRevenueShare"); | ||
|
|
||
| if (!optInRevenueShare) { | ||
|
|
@@ -271,7 +280,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| _incrementCallsToPortal( | ||
| abi.encodeCall( | ||
| IOptimismPortal2.depositTransaction, | ||
| (address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _l1WithdrawerCalldata) | ||
| (address(CREATE2_DEPLOYER), 0, L1_WITHDRAWER_DEPLOYMENT_GAS_LIMIT, false, _l1WithdrawerCalldata) | ||
| ) | ||
| ); | ||
|
|
||
|
|
@@ -297,7 +306,13 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| _incrementCallsToPortal( | ||
| abi.encodeCall( | ||
| IOptimismPortal2.depositTransaction, | ||
| (address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _scRevShareCalculatorCalldata) | ||
| ( | ||
| address(CREATE2_DEPLOYER), | ||
| 0, | ||
| SC_REV_SHARE_CALCULATOR_DEPLOYMENT_GAS_LIMIT, | ||
| false, | ||
| _scRevShareCalculatorCalldata | ||
| ) | ||
| ) | ||
| ); | ||
| } | ||
|
|
@@ -321,7 +336,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| _incrementCallsToPortal( | ||
| abi.encodeCall( | ||
| IOptimismPortal2.depositTransaction, | ||
| (address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _operatorFeeVaultCalldata) | ||
| (address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _operatorFeeVaultCalldata) | ||
| ) | ||
| ); | ||
| _incrementCallsToPortal( | ||
|
|
@@ -330,7 +345,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| ( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgrade, | ||
|
|
@@ -358,7 +373,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| _incrementCallsToPortal( | ||
| abi.encodeCall( | ||
| IOptimismPortal2.depositTransaction, | ||
| (address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _sequencerFeeVaultCalldata) | ||
| (address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _sequencerFeeVaultCalldata) | ||
| ) | ||
| ); | ||
| _incrementCallsToPortal( | ||
|
|
@@ -367,7 +382,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| ( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgrade, | ||
|
|
@@ -391,7 +406,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| _incrementCallsToPortal( | ||
| abi.encodeCall( | ||
| IOptimismPortal2.depositTransaction, | ||
| (address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _baseFeeVaultCalldata) | ||
| (address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _baseFeeVaultCalldata) | ||
| ) | ||
| ); | ||
| _incrementCallsToPortal( | ||
|
|
@@ -400,7 +415,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| ( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgrade, (payable(BASE_FEE_VAULT), address(_baseFeeVaultPrecalculatedAddress)) | ||
|
|
@@ -423,7 +438,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| _incrementCallsToPortal( | ||
| abi.encodeCall( | ||
| IOptimismPortal2.depositTransaction, | ||
| (address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _l1FeeVaultCalldata) | ||
| (address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _l1FeeVaultCalldata) | ||
| ) | ||
| ); | ||
| _incrementCallsToPortal( | ||
|
|
@@ -432,7 +447,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| ( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgrade, (payable(L1_FEE_VAULT), address(_l1FeeVaultPrecalculatedAddress)) | ||
|
|
@@ -453,7 +468,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| _incrementCallsToPortal( | ||
| abi.encodeCall( | ||
| IOptimismPortal2.depositTransaction, | ||
| (address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _feeSplitterCalldata) | ||
| (address(CREATE2_DEPLOYER), 0, FEE_SPLITTER_DEPLOYMENT_GAS_LIMIT, false, _feeSplitterCalldata) | ||
| ) | ||
| ); | ||
| _incrementCallsToPortal( | ||
|
|
@@ -462,7 +477,7 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| ( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgradeAndCall, | ||
|
|
@@ -492,12 +507,16 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| if (optInRevenueShare) { | ||
| // Deploy L1 Withdrawer | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _l1WithdrawerCalldata | ||
| address(CREATE2_DEPLOYER), 0, L1_WITHDRAWER_DEPLOYMENT_GAS_LIMIT, false, _l1WithdrawerCalldata | ||
| ); | ||
|
|
||
| // Deploy SC Rev Share Calculator | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _scRevShareCalculatorCalldata | ||
| address(CREATE2_DEPLOYER), | ||
| 0, | ||
| SC_REV_SHARE_CALCULATOR_DEPLOYMENT_GAS_LIMIT, | ||
| false, | ||
| _scRevShareCalculatorCalldata | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -531,12 +550,12 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| // Deploy the fee vaults | ||
| // Deploy the operator fee vault | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _operatorFeeVaultCalldata | ||
| address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _operatorFeeVaultCalldata | ||
| ); | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgrade, (payable(OPERATOR_FEE_VAULT), address(_operatorFeeVaultPrecalculatedAddress)) | ||
|
|
@@ -545,12 +564,12 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
|
|
||
| // Deploy the sequencer fee vault | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _sequencerFeeVaultCalldata | ||
| address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _sequencerFeeVaultCalldata | ||
| ); | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgrade, (payable(SEQUENCER_FEE_VAULT), address(_sequencerFeeVaultPrecalculatedAddress)) | ||
|
|
@@ -559,24 +578,24 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
|
|
||
| // Deploy the base fee vault | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _baseFeeVaultCalldata | ||
| address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _baseFeeVaultCalldata | ||
| ); | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall(IProxyAdmin.upgrade, (payable(BASE_FEE_VAULT), address(_baseFeeVaultPrecalculatedAddress))) | ||
| ); | ||
|
|
||
| // Deploy the l1 fee vault | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _l1FeeVaultCalldata | ||
| address(CREATE2_DEPLOYER), 0, FEE_VAULTS_DEPLOYMENT_GAS_LIMIT, false, _l1FeeVaultCalldata | ||
| ); | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall(IProxyAdmin.upgrade, (payable(L1_FEE_VAULT), address(_l1FeeVaultPrecalculatedAddress))) | ||
| ); | ||
|
|
@@ -586,13 +605,13 @@ contract RevenueShareV100UpgradePath is SimpleTaskBase { | |
| function _deployFeeSplitter() private { | ||
| // Deploy Fee Splitter | ||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(CREATE2_DEPLOYER), 0, deploymentGasLimit, false, _feeSplitterCalldata | ||
| address(CREATE2_DEPLOYER), 0, FEE_SPLITTER_DEPLOYMENT_GAS_LIMIT, false, _feeSplitterCalldata | ||
| ); | ||
|
|
||
| IOptimismPortal2(payable(portal)).depositTransaction( | ||
| address(PROXY_ADMIN), | ||
| 0, | ||
| deploymentGasLimit, | ||
| UPGRADE_GAS_LIMIT, | ||
| false, | ||
| abi.encodeCall( | ||
| IProxyAdmin.upgradeAndCall, | ||
|
|
||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Update L1Withdrawer cost https://linear.app/defi-wonderland/issue/OPT-1210/update-l1withdrawer-deployment-cost-when-we-know-the-value