feat(optimism): Add support for all Superchain configs and enable their usage#14562
feat(optimism): Add support for all Superchain configs and enable their usage#14562mattsse merged 18 commits intoparadigmxyz:mainfrom
Conversation
mattsse
left a comment
There was a problem hiding this comment.
is there a use case for these static chainspecs in kona?
I guess it would depend how we proceed with #14571
we likely need to separate parts of the chainspec logic, like hardfork activations and maybe fee params not necessarily genesis
so we could feature gate these to std for now probably
c7cb9d5 to
ba5a4e2
Compare
Yeah, we could use them :D fwiw, @refcell already has some rust bindings set up for the |
8dcdc0e to
45eb434
Compare
37fb642 to
ca5aefe
Compare
|
@mattsse This PR is ready for review.
|
|
Small update: Now setting fields (e.g., If you serialize and compare base-mainnet: 14442a14443,14444
> "cancunTime": 1710374401,
> "canyonTime": 1704992401,
14445a14448,14449
> "deltaTime": 1708560000,
> "ecotoneTime": 1710374401,
14448a14453,14454
> "fjordTime": 1720627201,
> "graniteTime": 1726070401,
14449a14456
> "holoceneTime": 1736445601,
14456a14464
> "eip1559DenominatorCanyon": 250,
14460a14469
> "shanghaiTime": 1704992401,base-sepolia: 15224a15225,15226
> "cancunTime": 1708534800,
> "canyonTime": 1699981200,
15227a15230,15231
> "deltaTime": 1703203200,
> "ecotoneTime": 1708534800,
15230a15235,15236
> "fjordTime": 1716998400,
> "graniteTime": 1723478400,
15231a15238
> "holoceneTime": 1732633200,
15238a15246
> "eip1559DenominatorCanyon": 250,
15242a15251
> "shanghaiTime": 1699981200,How to get this result: Checkout main, and this PR and serialize the genesis value. Then compare the results with: |
10784dc to
d46b710
Compare
|
@mattsse again ready for review I have extended this PR to have the full implementation for Superchain configs making now all chains easier to use out-of-the-box. Remarks:
Since we learned from Holesky that misconfigured settings can cause significant issues, let's take some time to get this right. |
|
Just a quick remark, I tried to do a full fresh sync for I am still investigating what is wrong here. I was able to sync to head before, and can not tell right now what has changed. Link to tx: https://unichain.blockscout.com/tx/0x6b37cec971c7f9c17d2355d737ffc0531b540b08d818d9a7c74bbf87098e7f7c Update: Waiting for the fix with: bluealloy/revm#2144 |
4a26d9a to
4bd280e
Compare
mattsse
left a comment
There was a problem hiding this comment.
okay, I finally picked this up again.
I put this off for a while because dealing with chainspecs gives me headaches, especially if this changes the way we do this, so this change is critical.
therefor I'd like to make a few changes to this
- keep all
ChainSpecstatic that we currently have, this way we can ensure that we don't accidentally break anything.
ideally we can also simplify the parsing and get rid of the additional types.
and we need some docs in the readme about how this all works.
| #![cfg_attr(not(test), warn(unused_crate_dependencies))] | ||
| #![cfg_attr(not(feature = "std"), no_std)] | ||
|
|
||
| // About the provided chain specs from `res/superchain-configs.tar`: |
There was a problem hiding this comment.
Find here some doc how it works
|
Nevermind, checking the test. Base is now missing :D |
|
@mattsse Ready to review it again (lint is failing caused by the unrelated const fn stuff) |
mattsse
left a comment
There was a problem hiding this comment.
very nice, sorry that this took so long.
I have a few ideas for followups here but for the initial integration this is great
|
|
||
| // Generate Rust code to list supported chains and a function to parse chain spec based on chain | ||
| // name | ||
| fn main() { |
There was a problem hiding this comment.
I think this solution is fine for this PR
we can make this a bit nicer if we change how the create_chain_spec! macro is invoked or by introducing our own:
so that we need a massive list of supported chains, but I think this is actually fine:
Built-in chains:
dev, optimism, optimism_sepolia, optimism-sepolia, base, base_sepolia, base-sepolia, arena-z, arena-z-testnet-sepolia, automata, base-devnet-0-sepolia-dev-0, bob, boba-sepolia, creator-chain-testnet-sepolia, cyber, cyber-sepolia, ethernity, ethernity-sepolia, funki, funki-sepolia, hashkeychain, ink, ink-sepolia, lisk, lisk-sepolia, lyra, metal, metal-sepolia, mint, mode, mode-sepolia, oplabs-devnet-0-sepolia-dev-0, orderly, pivotal-sepolia, polynomial, race, race-sepolia, redstone, settlus-mainnet, settlus-sepolia-sepolia, shape, shape-sepolia, snax, soneium, soneium-minato-sepolia, sseed, swan, swell, tbn, tbn-sepolia, unichain, unichain-sepolia, worldchain, worldchain-sepolia, xterio-eth, zora, zora-sepolia
…ir usage (paradigmxyz#14562) Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
…ir usage (paradigmxyz/reth#14562) Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
…ir usage (paradigmxyz/reth#14562) Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Add functions to read Genesis JSON from a zip file, allowing large JSON files to be removed from the repository.
Requires to work: alloy-rs/alloy#2073 to read the ChainConfig from the toml files
Added BSL-1.0 license. See here for compatibility to MIT/Apache 2.0
@mattsse: Seeking for advice how to get rid of
std:io