diff --git a/sepolia-alpha/2024-05-15-update-scalars/.env b/sepolia-alpha/2024-05-15-update-scalars/.env new file mode 100644 index 00000000..4a272116 --- /dev/null +++ b/sepolia-alpha/2024-05-15-update-scalars/.env @@ -0,0 +1,29 @@ +OP_COMMIT=c87a469d7d679e8a4efbace56c3646b925bcc009 +BASE_CONTRACTS_COMMIT=5d98dab6a4f3ba60713a17417a2df7a17d77c52f + +# https://sepolia.etherscan.io/address/0x7F67DC4959cb3E532B10A99F41bDD906C46FdFdE +L1_SYSTEM_CONFIG_ADDRESS=0x7F67DC4959cb3E532B10A99F41bDD906C46FdFdE +OWNER_ADDRESS=0x90128dbCee6178169BBc3CA90c18a93602A53721 + +# decode sepolia-prod setting +# > ./main --decode 452312848583266388373324160190187140051835877600158453279134021569375896653 +# base fee scalar : 1101 +# blob base fee scalar: 659851 +# v1 hex encoding : 0x010000000000000000000000000000000000000000000000000a118b0000044d +# uint value for the 'scalar' parameter in SystemConfigProxy.setGasConfig(): +# For Sepolia prod: SCALAR=452312848583266388373324160190187140051835877600158453279134021569375896653 + +# encode sepolia-alpha setting +# scalar = sepolia-prod-scalar * 1.6 * 6, blob-scalar = sepolia-prod-blob-scalar * 1.6 +# > ./main --scalar 10570 --blob-scalar 1055761 +# base fee scalar : 10570 +# blob base fee scalar: 1055761 +# v1 hex encoding : 0x01000000000000000000000000000000000000000000000000101c110000294a +# uint value for the 'scalar' parameter in SystemConfigProxy.setGasConfig(): +SCALAR=452312848583266388373324160190187140051835877600158453279135721989878065482 + + + + + + diff --git a/sepolia-alpha/2024-05-15-update-scalars/Makefile b/sepolia-alpha/2024-05-15-update-scalars/Makefile new file mode 100644 index 00000000..0f8bd6a2 --- /dev/null +++ b/sepolia-alpha/2024-05-15-update-scalars/Makefile @@ -0,0 +1,9 @@ +include ../../Makefile +include ../.env +include .env + +# Update Gas Config command + +.PHONY: update-gas-config +update-gas-config: + @forge script --rpc-url $(L1_RPC_URL) UpdateGasConfigSepolia --private-key $(PRIVATE_KEY) --broadcast \ No newline at end of file diff --git a/sepolia-alpha/2024-05-15-update-scalars/foundry.toml b/sepolia-alpha/2024-05-15-update-scalars/foundry.toml new file mode 100644 index 00000000..0be0575a --- /dev/null +++ b/sepolia-alpha/2024-05-15-update-scalars/foundry.toml @@ -0,0 +1,20 @@ +[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 = true +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/' +] + +# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file diff --git a/sepolia-alpha/2024-05-15-update-scalars/script/UpdateGasConfig.s.sol b/sepolia-alpha/2024-05-15-update-scalars/script/UpdateGasConfig.s.sol new file mode 100644 index 00000000..3e98d1ba --- /dev/null +++ b/sepolia-alpha/2024-05-15-update-scalars/script/UpdateGasConfig.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.15; + +import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; +import "forge-std/Script.sol"; + +contract UpdateGasConfigSepolia is Script { + + address internal L1_SYSTEM_CONFIG = vm.envAddress("L1_SYSTEM_CONFIG_ADDRESS"); + uint256 internal SCALAR = vm.envUint("SCALAR"); + address internal OWNER = vm.envAddress("OWNER_ADDRESS"); + + function _postCheck() internal view { + require(SystemConfig(L1_SYSTEM_CONFIG).scalar() == SCALAR); + require(SystemConfig(L1_SYSTEM_CONFIG).overhead() == 0); + } + + function run() public { + vm.startBroadcast(OWNER); + SystemConfig(L1_SYSTEM_CONFIG).setGasConfig(0, SCALAR); + _postCheck(); + vm.stopBroadcast(); + } +} \ No newline at end of file