-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sepolia] upgrade sepolia system config to max gas limit 400m (#231)
* Add scripts to upgrade sepolia system config to max gas limit 400m * Commit execution record
- Loading branch information
1 parent
e95d653
commit e253bfd
Showing
8 changed files
with
316 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
BASE_CONTRACTS_COMMIT=ed36aac52a19bdad6dee09c59e7241fe3a194160 | ||
|
||
OPTIMISM_REPO=https://github.com/ethereum-optimism/optimism.git | ||
OPTIMISM_VERSION=op-contracts/v1.5.0 | ||
OPTIMISM_CONTRACT_PATCH=patch/max-gas-limit.patch | ||
|
||
SAFE_ADDRESS=0x0fe884546476dDd290eC46318785046ef68a0BA9 | ||
PROXY_ADMIN_ADDRESS=0x0389E59Aa0a41E4A413Ae70f0008e76CAA34b1F3 | ||
SYSTEM_CONFIG_ADDRESS=0xf272670eb55e895584501d564AfEB048bEd26194 | ||
|
||
NEW_IMPLEMENTATION=0x31aad1062c25ce545c14bd9ee64dedef6c6b6fac |
This file contains 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
include ../../Makefile | ||
include ../.env | ||
include .env | ||
|
||
ifndef LEDGER_ACCOUNT | ||
override LEDGER_ACCOUNT = 1 | ||
endif | ||
|
||
# Overwriting this from top level makefile to change the branch | ||
.PHONY: checkout-op-commit | ||
checkout-op-commit: | ||
rm -rf lib/optimism | ||
mkdir -p lib/optimism | ||
cd lib/optimism; \ | ||
git init; \ | ||
git remote add origin $(OPTIMISM_REPO); \ | ||
git fetch --depth=1 origin tag $(OPTIMISM_VERSION) --no-tags; \ | ||
git checkout $(OPTIMISM_VERSION); \ | ||
git apply ../../$(OPTIMISM_CONTRACT_PATCH) | ||
|
||
|
||
.PHONY: deploy | ||
deploy: | ||
forge script --rpc-url $(L1_RPC_URL) DeploySystemConfig --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --verify --broadcast | ||
|
||
.PHONY: sign | ||
sign: | ||
$(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ | ||
forge script --rpc-url $(L1_RPC_URL) UpgradeSystemConfig \ | ||
--sig "sign()" | ||
|
||
.PHONY: run-upgrade | ||
execute: | ||
forge script --rpc-url $(L1_RPC_URL) UpgradeSystemConfig \ | ||
--sig "run()" --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --broadcast |
This file contains 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Upgrade to new system config with 400m max gas limit | ||
|
||
Base is continuing to scale and we need higher block gas limit to support the increased demand. | ||
|
||
### Steps | ||
|
||
1. pull main branch of https://github.com/base-org/contract-deployments: | ||
`git clone [email protected]:base-org/contract-deployments.git` | ||
|
||
2. ledger needs to be connected and unlocked | ||
3. deploying contracts (base team): | ||
```shell | ||
cd sepolia/2024-12-06-increase-max-gas-limit | ||
make deps | ||
make deploy | ||
``` | ||
|
||
4. sign | ||
```shell | ||
cd sepolia/2024-12-06-increase-max-gas-limit | ||
make deps # skip if already installed | ||
make sign | ||
``` | ||
|
||
5. execute: | ||
```shell | ||
cd sepolia/2024-12-06-increase-max-gas-limit | ||
make execute | ||
``` |
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[profile.default] | ||
src = 'src' | ||
out = 'out' | ||
libs = ['lib'] | ||
broadcast = 'records' | ||
fs_permissions = [{ access = "read-write", path = "./" }] | ||
optimizer = true | ||
optimizer_runs = 999999 | ||
solc_version = "0.8.15" | ||
via-ir = false | ||
remappings = [ | ||
'@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/', | ||
'@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts', | ||
'@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts', | ||
'@rari-capital/solmate/=lib/solmate/', | ||
'@base-contracts/=lib/base-contracts', | ||
'@solady/=lib/solady/src/', | ||
'src/=lib/optimism/packages/contracts-bedrock/src/', | ||
] | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
24 changes: 24 additions & 0 deletions
24
sepolia/2024-12-06-increase-max-gas-limit/patch/max-gas-limit.patch
This file contains 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/packages/contracts-bedrock/src/L1/SystemConfig.sol b/packages/contracts-bedrock/src/L1/SystemConfig.sol | ||
index 67a8353ae..ae72faf92 100644 | ||
--- a/packages/contracts-bedrock/src/L1/SystemConfig.sol | ||
+++ b/packages/contracts-bedrock/src/L1/SystemConfig.sol | ||
@@ -87,7 +87,7 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { | ||
/// @notice The maximum gas limit that can be set for L2 blocks. This limit is used to enforce that the blocks | ||
/// on L2 are not too large to process and prove. Over time, this value can be increased as various | ||
/// optimizations and improvements are made to the system at large. | ||
- uint64 internal constant MAX_GAS_LIMIT = 200_000_000; | ||
+ uint64 internal constant MAX_GAS_LIMIT = 400_000_000; | ||
|
||
/// @notice Fixed L2 gas overhead. Used as part of the L2 fee calculation. | ||
uint256 public overhead; | ||
@@ -115,8 +115,8 @@ contract SystemConfig is OwnableUpgradeable, ISemver, IGasToken { | ||
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data); | ||
|
||
/// @notice Semantic version. | ||
- /// @custom:semver 2.2.0 | ||
- string public constant version = "2.2.0"; | ||
+ /// @custom:semver 2.2.0+max-gas-limit-400M | ||
+ string public constant version = "2.2.0+max-gas-limit-400M"; | ||
|
||
/// @notice Constructs the SystemConfig contract. Cannot set | ||
/// the owner to `address(0)` due to the Ownable contract's |
135 changes: 135 additions & 0 deletions
135
...-06-increase-max-gas-limit/records/UpgradeSystemConfig.s.sol/11155111/run-1733527237.json
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
sepolia/2024-12-06-increase-max-gas-limit/script/DeploySystemConfig.s.sol
This file contains 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import {Script, console} from "forge-std/Script.sol"; | ||
|
||
import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; | ||
|
||
contract DeploySystemConfig is Script { | ||
function run() public { | ||
vm.startBroadcast(); | ||
SystemConfig systemConfigImpl = new SystemConfig(); | ||
console.log("SystemConfig implementation deployed at: ", address(systemConfigImpl)); | ||
vm.stopBroadcast(); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
sepolia/2024-12-06-increase-max-gas-limit/script/UpgradeSystemConfig.s.sol
This file contains 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import {Vm} from "forge-std/Vm.sol"; | ||
import {IMulticall3} from "forge-std/interfaces/IMulticall3.sol"; | ||
|
||
import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; | ||
import {MultisigBuilder, Simulation} from "@base-contracts/script/universal/MultisigBuilder.sol"; | ||
|
||
interface IProxyAdmin { | ||
function upgrade(address _proxy, address _implementation) external; | ||
} | ||
|
||
interface IProxy { | ||
function implementation() external view returns (address); | ||
} | ||
|
||
contract UpgradeSystemConfig is MultisigBuilder { | ||
address internal SAFE_ADDRESS = vm.envAddress("SAFE_ADDRESS"); | ||
address internal PROXY_ADMIN_ADDRESS = vm.envAddress("PROXY_ADMIN_ADDRESS"); | ||
address internal SYSTEM_CONFIG_ADDRESS = vm.envAddress("SYSTEM_CONFIG_ADDRESS"); | ||
address internal NEW_IMPLEMENTATION = vm.envAddress("NEW_IMPLEMENTATION"); | ||
|
||
function _postCheck(Vm.AccountAccess[] memory, Simulation.Payload memory) internal override { | ||
// NOTE: Bypass `proxyCallIfNotAdmin` modifier. | ||
vm.prank(PROXY_ADMIN_ADDRESS); | ||
require(IProxy(SYSTEM_CONFIG_ADDRESS).implementation() == NEW_IMPLEMENTATION); | ||
} | ||
|
||
function _buildCalls() internal view override returns (IMulticall3.Call3[] memory) { | ||
IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](3); | ||
|
||
calls[0] = IMulticall3.Call3({ | ||
target: PROXY_ADMIN_ADDRESS, | ||
allowFailure: false, | ||
// NOTE: No need to call initialize as no storage would change (only changing `MAX_GAS_LIMIT` and `version`). | ||
callData: abi.encodeCall(IProxyAdmin.upgrade, (SYSTEM_CONFIG_ADDRESS, NEW_IMPLEMENTATION)) | ||
}); | ||
|
||
return calls; | ||
} | ||
|
||
function _ownerSafe() internal view override returns (address) { | ||
return SAFE_ADDRESS; | ||
} | ||
} |