Skip to content

Commit c8842fc

Browse files
Full chain upgrades commit
1 parent ab2e169 commit c8842fc

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

pages/stack/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"components": "OP Stack components",
1111
"public-devnets": "Public devnets",
1212
"smart-contracts": "Smart contracts",
13+
"chain-upgrades": "Chain upgrades",
1314
"opcm": "OP Contracts Manager",
1415
"rollup": "Rollup",
1516
"fault-proofs": "Fault proofs",

pages/stack/chain-upgrades/_meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"superchain-ops-guide": "Upgrade contracts"
3+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
title: 'Chain upgrade guide: Using superchain-ops'
3+
description: Learn about using superchain-ops to upgrade your chain
4+
lang: en-US
5+
content_type: guide
6+
topic: op-chain-upgrades-superchain-ops
7+
personas:
8+
- protocol-developer
9+
- chain-operator
10+
categories:
11+
- protocol
12+
- chain-deployment
13+
- smart-contracts
14+
- infrastructure
15+
- superchain-contracts
16+
- system-configuration
17+
- deployment-tooling
18+
is_imported_content: 'false'
19+
---
20+
21+
# Chain upgrade guide: Using superchain-ops
22+
23+
This guide outlines the process for upgrading Optimism chains using the `superchain-ops` repository. It's intended primarily for chains that are part of the Superchain, those with the Foundation or Security Council as signers, and/or chains requiring a highly secure and manual process.
24+
25+
`superchain-ops` is a highly secure service designed for Optimism chains. It provides a structured and security-focused approach to chain upgrades. The process involves creating tasks that use predefined templates to generate the necessary upgrade transactions.
26+
27+
## Who should use `superchain-ops`
28+
29+
`superchain-ops` is primarily intended for:
30+
31+
1. **Chains in the Superchain**: For standard chains officially part of the Superchain, upgrades are typically handled through `superchain-ops`.
32+
33+
2. **Chains with Foundation or Security Council as signers**: If your chain has the Foundation multi-sig or Security Council as signers, your upgrade tasks should go through `superchain-ops`.
34+
35+
3. **Chains requiring a highly secure and manual process**: For chains that prioritize security over automation, `superchain-ops` provides an intentionally manual workflow with thorough verification steps.
36+
37+
For chains that don't fall into these categories, you'll need to generate appropriate call data for upgrades through other means or develop your own upgrade process for non-OPCM upgrades.
38+
39+
## Understanding templates and tasks
40+
41+
`superchain-ops` uses two key concepts:
42+
43+
- **Templates**: Define what the upgrade is and contain the code for specific upgrade paths (e.g., 1.8 to 2.0). Templates are version-specific and live in the (`/src/improvements/template`)[https://github.com/ethereum-optimism/superchain-ops/tree/main/src/improvements/template] directory.
44+
45+
- **Tasks**: Chain-specific implementations of templates. Multiple tasks can use the same template for different chains. Tasks are organized by network (mainnet or testnet) in the (`/src/improvements/tasks`)[https://github.com/ethereum-optimism/superchain-ops/tree/main/src/improvements/tasks] directory.
46+
47+
## General upgrade process
48+
49+
The following process outlines how to upgrade a chain using `superchain-ops`, using the 1.8 to 2.0 upgrade as an example. This same pattern applies to other OPCM-based upgrades (like 2.0 to 3.0).
50+
51+
### Step 1: Clone the `superchain-ops` repository
52+
53+
```bash
54+
git clone https://github.com/ethereum-optimism/superchain-ops.git
55+
cd superchain-ops
56+
```
57+
58+
### Step 2: Create a new task using the quick start
59+
60+
```bash
61+
cd src/improvements/
62+
just new task
63+
```
64+
65+
Follow the prompts to select the appropriate template (e.g., `opcm-upgrade-v200` for a 1.8 to 2.0 upgrade) and provide the necessary details.
66+
67+
This will create a new task directory containing a `config.toml` and `README` file. The config file will look like this:
68+
69+
```
70+
l2chains = [] # e.g. [{name = "OP Mainnet", chainId = 10}]
71+
templateName = "OPCMUpgradeV200"
72+
73+
```
74+
75+
### Step 4: Configure the task
76+
77+
Look through other tasks in the directory to find the information necessary for your upgrade. For example, when upgrading from 1.8 to 2.0, you can look at the (`src/improvements/tasks/eth/002-opcm-upgrade-v200/config.toml`)[https://github.com/ethereum-optimism/superchain-ops/blob/main/src/improvements/tasks/eth/002-opcm-upgrade-v200/config.toml] file to see that your config file should look like the following:
78+
79+
<Callout>
80+
Ensure you replace all addresses and other values in the example below
81+
</Callout>
82+
83+
```
84+
l2chains = [
85+
{name = "Unichain", chainId = 130}
86+
]
87+
88+
templateName = "OPCMUpgradeV200"
89+
90+
[opcmUpgrades]
91+
absolutePrestates = [
92+
{absolutePrestate = "0x039facea52b20c605c05efb0a33560a92de7074218998f75bcdf61e8989cb5d9", chainId = 130},
93+
]
94+
95+
[addresses]
96+
OPCM = "0x026b2F158255Beac46c1E7c6b8BbF29A4b6A7B76"
97+
# Deployed March 27, 2025: https://etherscan.io/tx/0x902ce895f70a72110d40c9a734a26380b2e27c370aae90721cdfa1ac972cfff8
98+
StandardValidatorV200 = "0xecabaeaa1d58261f1579232520c5b460ca58a164"
99+
ChildSafe1 = "0xb0c4C487C5cf6d67807Bc2008c66fa7e2cE744EC"
100+
ChildSafe2 = "0x847B5c174615B1B7fDF770882256e2D3E95b9D92"
101+
ChildSafe3 = "0xc2819DC788505Aac350142A7A707BF9D03E3Bd03"
102+
```
103+
104+
### Step 5: Simulate the task
105+
106+
Before executing the upgrade, simulate it to ensure everything is configured correctly:
107+
108+
```
109+
# Nested
110+
SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path $(pwd)/.env --justfile ../../../nested.just simulate <foundation|council|chain-governor|child-safe-1|child-safe-2|child-safe-3>
111+
# Single
112+
SIMULATE_WITHOUT_LEDGER=1 just --dotenv-path $(pwd)/.env --justfile ../../../single.just simulate
113+
```
114+
115+
This will run through the upgrade process without actually executing the transactions.
116+
117+
### Step 6: Execute or submit for review
118+
119+
For chains within the Superchain, submit a pull request to have your task reviewed. If your chain is not within the Superchain, execute the transaction yourself.
120+

0 commit comments

Comments
 (0)