Skip to content
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

[sepolia-alpha] Update scalar post ecotone #168

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sepolia-alpha/2024-05-15-update-scalars/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
OP_COMMIT=c87a469d7d679e8a4efbace56c3646b925bcc009
BASE_CONTRACTS_COMMIT=5d98dab6a4f3ba60713a17417a2df7a17d77c52f

# https://sepolia.etherscan.io/address/0x7F67DC4959cb3E532B10A99F41bDD906C46FdFdE
L1_SYSTEM_CONFIG_ADDRESS=0x7F67DC4959cb3E532B10A99F41bDD906C46FdFdE
OWNER_ADDRESS=0xAf6E0E871f38c7B653700F7CbAEDafaa2784D430

# 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
9 changes: 9 additions & 0 deletions sepolia-alpha/2024-05-15-update-scalars/Makefile
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions sepolia-alpha/2024-05-15-update-scalars/foundry.toml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"transactions": [
{
"hash": "0x1d0b032ada2f58cb9252143fa3ce92711f7e587f12f5bfd591c9580fb5af13ae",
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x7F67DC4959cb3E532B10A99F41bDD906C46FdFdE",
"function": "setGasConfig(uint256,uint256)",
"arguments": [
"0",
"452312848583266388373324160190187140051835877600158453279135721989878065482"
],
"transaction": {
"type": "0x02",
"from": "0xaf6e0e871f38c7b653700f7cbaedafaa2784d430",
"to": "0x7f67dc4959cb3e532b10a99f41bdd906c46fdfde",
"gas": "0xc851",
"value": "0x0",
"data": "0x935f029e000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000101c110000294a",
"nonce": "0x1",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0x1d0b032ada2f58cb9252143fa3ce92711f7e587f12f5bfd591c9580fb5af13ae",
"transactionIndex": "0x13",
"blockHash": "0x35417220b69ab9544562e6b34bddf348f16868dcdd08b8a160280856077733af",
"blockNumber": "0x5a4b4f",
"from": "0xAf6E0E871f38c7B653700F7CbAEDafaa2784D430",
"to": "0x7F67DC4959cb3E532B10A99F41bDD906C46FdFdE",
"cumulativeGasUsed": "0x1e08aa",
"gasUsed": "0x9107",
"contractAddress": null,
"logs": [
{
"address": "0x7F67DC4959cb3E532B10A99F41bDD906C46FdFdE",
"topics": [
"0x1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000001"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000101c110000294a",
"blockHash": "0x35417220b69ab9544562e6b34bddf348f16868dcdd08b8a160280856077733af",
"blockNumber": "0x5a4b4f",
"transactionHash": "0x1d0b032ada2f58cb9252143fa3ce92711f7e587f12f5bfd591c9580fb5af13ae",
"transactionIndex": "0x13",
"logIndex": "0x39",
"removed": false
}
],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000008000000000000040000000400000000000000000000000000000000000000040000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000010000000000000000000000000000000000000000000000008000000000",
"type": "0x2",
"effectiveGasPrice": "0x3c023e844"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1715900079,
"chain": 11155111,
"commit": "2092a8f"
}
Original file line number Diff line number Diff line change
@@ -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();
}
}