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

Add bindings for SR2.0 #466

Open
wants to merge 3 commits into
base: optimism
Choose a base branch
from
Open

Add bindings for SR2.0 #466

wants to merge 3 commits into from

Conversation

mslipper
Copy link
Contributor

@mslipper mslipper commented Jan 15, 2025

Adds bindings to the Superchain Registry 2.0 to OP Geth. The SR's data files are copied into a ZIP file via the sync-superchain.sh script. They are then mounted as an in-memory virtual file system and are read on-demand.

The structs representing each chain config are defined in this package.

@mslipper mslipper requested a review from a team as a code owner January 15, 2025 23:33
@mslipper mslipper requested a review from protolambda January 15, 2025 23:33
@mslipper mslipper force-pushed the feat/sr-2.0 branch 3 times, most recently from e556276 to 29b1045 Compare January 15, 2025 23:58
Copy link
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach to load the chain configs from locally embedded data. Having a script to sync a new SCR revision is a nice way to decouple this repo from the SCR.

I propose that we store the chain configs in a file tree with a zip file per chain, and then lazy-load only those chains whose config is actually used. You're already lazy loading the whole config with a sync.Cond, so this pattern would just take this one step further and avoid loading 99% of data that's usually irrelevant.

sync-superchain.sh Outdated Show resolved Hide resolved
sync-superchain.sh Outdated Show resolved Hide resolved
superchain/superchain-configs.zip Outdated Show resolved Hide resolved
ProxyAdmin *common.Address `toml:"ProxyAdmin,omitempty" json:"ProxyAdmin,omitempty"`
SuperchainConfig *common.Address `toml:"SuperchainConfig,omitempty" json:"SuperchainConfig,omitempty"`
AnchorStateRegistryProxy *common.Address `toml:"AnchorStateRegistryProxy,omitempty" json:"AnchorStateRegistryProxy,omitempty"`
DelayedWETHProxy *common.Address `toml:"DelayedWETHProxy,omitempty" json:"DelayedWETHProxy,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also already add a PermissionedDelayedWETHProxy here, I think @Inphi wanted to add this to the SR.

sync-superchain.sh Show resolved Hide resolved
Comment on lines +25 to +29
Optimism *OptimismConfig `toml:"optimism,omitempty" json:"optimism,omitempty"`

AltDA *AltDAConfig `toml:"alt_da,omitempty" json:"alt_da,omitempty"`

Genesis GenesisConfig `toml:"genesis" json:"genesis"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do these 3 fields get a json spec, but not the others?

sync-superchain.sh Outdated Show resolved Hide resolved
@mslipper mslipper force-pushed the feat/sr-2.0 branch 5 times, most recently from f40c47f to e393e03 Compare January 16, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants