ethereum-optimism / superchain-registry

An index of chains which serves as the source of truth for who’s in the Superchain Ecosystem
MIT License
74 stars 77 forks source link

Generate / include rollup stage for each chain #332

Closed tessr closed 2 months ago

tessr commented 3 months ago

Problem and context

One of the things that we'd like to display for chains is their rollup stage (Stage 0, Stage 1, etc). We anticipate that this will be one of the most frequent questions that end users and infra partners will have about different OP Chains, and we'd like to make the answer obvious for every chain in the Registry. This will also be important for future work on Registry frontends.

This is a small expansion of scope for the initial Superchain Registry launch, but it's a sufficiently common question that we'd like to prioritize it.

To be Stage 1, a chain must:

All others are Stage 0. (As of June 2024, anyway.)

Fault roofs status can be read from the contract version, but we want to make this blindingly obvious and display a flag or human-readable string so that Superchain Registry consumers (both humans and SCR frontends) can easily determine a chain's status.

Proposed solution

Generate this info when a chain is added to the Superchain Registry and include in the chain's config file:

name: OP-Mainnet
chain_id: 10
public_rpc: https://mainnet.optimism.io
sequencer_rpc: https://mainnet-sequencer.optimism.io
explorer: https://explorer.optimism.io

superchain_level: 2
superchain_time: 0 # Missing hardfork times are inherited from superchain.yaml
contracts_version_tag: "op-contracts/v1.4.0" # Fault Proofs https://github.com/ethereum-optimism/optimism/releases/tag/op-contracts%2Fv1.4.0

rollup_stage: 1

We'd also need to make sure that this is listed for each chain in the generated files (chainList.json, chainList.toml), since this is where most folks would go to read this information:

  {
    "name": "OP-Mainnet",
    "identifier": "mainnet/op",
    "chainId": 10,
    "rpc": [
      "https://mainnet.optimism.io"
    ],
    "explorers": [
      "https://explorer.optimism.io"
    ],
    "superchainLevel": 2,
    *"rollupStage": 1,*
    "parent": {
      "type": "L2",
      "chain": "mainnet"
    }
  },

Note: I don't have an opinion on when/how the Stage info is generated, but I do think we should display it both in the config file and in the generated chain list files.

geoknee commented 2 months ago

@tessr I believe we discussed that rollup stage = 1 might in the end be equivalent to "standard chain". Can you confirm? If so, shall we just point this out in the readme?

geoknee commented 2 months ago

From call today, this is true, so we can just update the readme.