Skip to content

Commit 9702f3c

Browse files
authored
Improve readme (#382)
* remove reference to op-chain-ops and point out how to run op-geth and op-node * be more consistent with identifying chains * fix formatting * add step to fork repo * readme states that standard chains are stage 1
1 parent f3b3755 commit 9702f3c

File tree

1 file changed

+24
-29
lines changed

1 file changed

+24
-29
lines changed

README.md

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,50 @@ Other configuration, such as contract-permissions and `SystemConfig` parameters
1414

1515
A list of chains in the registry can be seen in the top level [`chainList.toml`](./chainList.toml) and [`chainList.json`](./chainList.json) files.
1616

17-
## Downstream packages
18-
The superchain configs are stored in a minimal form, and are embedded in downstream OP-Stack software ([`op-node`](https://github.com/ethereum-optimism/optimism) and [`op-geth`](https://github.com/ethereum-optimism/op-geth)).
17+
## Superchain Level and Rollup Stage
18+
Chains in the superchain-registry are assigned a `superchain_level` (shown in individual config files as well as the `chainList.tom/json` summaries), depending on the set of validation checks that they pass.
19+
20+
**Frontier** chains have `superchain_level = 1`.
1921

20-
Full deployment artifacts and genesis-states can be derived from the minimal form
21-
using the reference [`op-chain-ops`] tooling.
22+
**Standard** chains have `superchain_level = 2`. Because they satisfy a much stricter set of validation checks (see the [Standard Rollup Blockspace Charter](https://gov.optimism.io/t/season-6-draft-standard-rollup-charter/8135)), they also qualify as [Stage 1](https://ethereum-magicians.org/t/proposed-milestones-for-rollups-taking-off-training-wheels/11571) rollups chains.
2223

23-
[`op-chain-ops`]: https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops
24+
25+
## Downstream packages
26+
The superchain configs are stored in a minimal form, and are embedded in downstream OP-Stack software ([`op-node`](https://github.com/ethereum-optimism/optimism) and [`op-geth`](https://github.com/ethereum-optimism/op-geth)). This means that, after a chain has been added to the registry, and the dependency on the registry updates in the downstream software, it is possible to start an `op-node` instance [using the `--network` flag](https://docs.optimism.io/builders/node-operators/configuration/consensus-config#network) (and also an `op-geth` instance [using the `--op-network` tag](https://docs.optimism.io/builders/node-operators/configuration/execution-config#op-network-betaop-network)) which will successfully sync with other nodes on that network.
2427

2528
## Adding a Chain
2629

2730
The following are the steps you need to take to add a chain to the registry:
31+
### 0. Fork this repository
32+
You will be raising a Pull Request from your fork to the upstream repo.
2833

29-
### 0. Ensure your chain is listed at ethereum-lists/chains
34+
### 1. Ensure your chain is listed at ethereum-lists/chains
3035
This is to ensure your chain has a unique chain ID. Our validation suite will check your chain against https://github.com/ethereum-lists/chains.
3136

3237

33-
### 1. Install dependencies
38+
### 2. Install dependencies
3439
You will need [`jq`](https://jqlang.github.io/jq/download/) and [`foundry`](https://book.getfoundry.sh/getting-started/installation) installed, as well as Go and [`just`](https://just.systems/man/en/).
3540

36-
### 2. Set env vars
41+
### 3. Set env vars
3742

3843
To contribute a standard OP-Stack chain configuration, in addition to user-supplied metadata (chain name) the following data is required: contracts deployment, rollup config, L2 genesis. We provide a tool to scrape this information from your local [monorepo](https://github.com/ethereum-optimism/optimism) folder.
3944

4045
First, make a copy of `.env.example` named `.env`, and alter the variables to appropriate values.
4146
#### Frontier chains
42-
43-
Frontier chains are chains with customizations beyond the standard OP
44-
Stack configuration. To contribute a frontier OP-Stack chain
45-
configuration, you set the `SCR_CHAIN_TYPE=frontier` in the `.env` file.
46-
47+
To contribute a frontier OP-Stack chain configuration, you set the `SCR_CHAIN_TYPE=frontier` in the `.env` file. This will set `superchain_level = 1` in the registry's config file for this chain.
4748

4849
#### Standard chains
49-
A chain may meet the definition of a **standard** chain. Adding a standard chain is a two-step process.
50-
51-
First, the chain should be added as a frontier chain as above, but with `SCR_STANDARD_CHAIN_CANDIDATE=true` in the `.env` file.
50+
Adding a standard chain is a two-step process. First, the chain should be added as a frontier chain as above, but with `SCR_STANDARD_CHAIN_CANDIDATE=true` in the `.env` file.
5251

53-
### 3. Run script
52+
### 4. Run script
5453

5554
```shell
5655
just add-chain
5756
```
5857

5958
The remaining steps should then be followed to merge the config data into the registry -- a prerequisite for [promoting the chain](#promote-a-chain-to-standard) to a standard chain.
6059

61-
### 4. Understand output
60+
### 5. Understand output
6261
The tool will write the following data:
6362
- The main configuration source, with genesis data, and address of onchain system configuration. These are written to `superchain/configs/superchain_target/chain_short_name.yaml`.
6463
> **Note**
@@ -78,15 +77,11 @@ The format is a gzipped JSON `genesis.json` file, with either:
7877
- a `stateHash` attribute: to omit a large state (e.g. for networks with a re-genesis or migration history).
7978
Nodes can load the genesis block header, and state-sync to complete the node initialization.
8079

81-
### 5. Run tests locally
80+
### 6. Run tests locally
8281

83-
Run the following command to run the Go validation checks, for only the chain you added (replace the chain name or ID accordingly):
84-
```
85-
just validate OP_Sepolia
86-
```
87-
or
82+
Run the following command to run the Go validation checks, for only the chain you added (replace the `<chain-id>` accordingly):
8883
```
89-
just validate 11155420
84+
just validate <chain-id>
9085
```
9186

9287
> [!NOTE]
@@ -96,7 +91,7 @@ just validate 11155420
9691
9792
The [`validation_test.go`](./validation/validation_test.go) test declaration file defines which checks run on each class of chain. The parameters referenced in each check are recorded in [TOML files in the `standard` directory](./validation/standard).
9893

99-
### 6. Run codegen and check output
94+
### 7. Run codegen and check output
10095
This is a tool which will rewrite certain summary files of all the chains in the registry, including the one you are adding. The output will be checked in a continuous integration checks (it is required to pass):
10196

10297
```
@@ -106,18 +101,18 @@ just codegen
106101
> [!NOTE]
107102
> Please double check the diff to this file. This data may be consumed by external services, e.g. wallets. If anything looks incorrect, please get in touch.
108103
109-
### 7. Open Your Pull Request
104+
### 8. Open Your Pull Request
110105
When opening a PR:
111106
- Open it from a non-protected branch in your fork (e.g. avoid the `main` branch). This allows maintainers to push to your branch if needed, which streamlines the review and merge process.
112107
- Open one PR per chain you would like to add. This ensures the merge of one chain is not blocked by unexpected issues.
113108

114109
Once the PR is opened, the same automated checks from Step 4 will then run on your PR, and your PR will be reviewed in due course. Once these checks pass the PR will be merged.
115110

116111

117-
## Promote a chain to standard
112+
## Promote a chain to standard
118113
This process is only possible for chains already in the registry.
119114

120-
Run this command:
115+
Run this command (replace the `<chain-id>` accordingly):
121116
```
122117
just promote-to-standard <chain-id>
123118
```

0 commit comments

Comments
 (0)