diff --git a/go.mod b/go.mod index 87f072106e1f..682f2d981989 100644 --- a/go.mod +++ b/go.mod @@ -226,6 +226,6 @@ require ( replace github.com/ethereum/go-ethereum v1.13.8 => github.com/ethereum-optimism/op-geth v1.101308.1-rc.1 -replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240208210534-b4480d712cb4 +replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240223212802-3cf921f7ab5c //replace github.com/ethereum/go-ethereum v1.13.5 => ../go-ethereum diff --git a/go.sum b/go.sum index 1c3f348aa0d8..f30de51da3d6 100644 --- a/go.sum +++ b/go.sum @@ -96,8 +96,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240208210534-b4480d712cb4 h1:8gYbBJBVp3/2q5nudS+6cxEF4d0gWU4ytMfa1XaKHLU= -github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240208210534-b4480d712cb4/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= +github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240223212802-3cf921f7ab5c h1:IU4ydQNQcDZTms37yPy97jinnOgQ6fTvkd5Dgzz24Dw= +github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240223212802-3cf921f7ab5c/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= diff --git a/op-node/chaincfg/chains.go b/op-node/chaincfg/chains.go index 34ded749fad0..e4416a2f66f4 100644 --- a/op-node/chaincfg/chains.go +++ b/op-node/chaincfg/chains.go @@ -54,11 +54,22 @@ func handleLegacyName(name string) string { } } +func handleBobaSuperchainName(name string) string { + switch name { + case "boba-sepolia": + return "boba-boba-sepolia" + default: + return name + } +} + // ChainByName returns a chain, from known available configurations, by name. // ChainByName returns nil when the chain name is unknown. func ChainByName(name string) *superchain.ChainConfig { // Handle legacy name aliases name = handleLegacyName(name) + // Handle boba superchain name + name = handleBobaSuperchainName(name) for _, chainCfg := range superchain.OPChains { if strings.EqualFold(chainCfg.Chain+"-"+chainCfg.Superchain, name) { return chainCfg diff --git a/op-node/chaincfg/chains_test.go b/op-node/chaincfg/chains_test.go index 65299886dbb1..f2eae8c72424 100644 --- a/op-node/chaincfg/chains_test.go +++ b/op-node/chaincfg/chains_test.go @@ -21,12 +21,11 @@ import ( // the superchain-registry is no longer deemed experimental. func TestGetRollupConfig(t *testing.T) { configsByName := map[string]rollup.Config{ - "goerli": goerliCfg, - // TODO(jky) unskip this test once superchain registry updated - // "mainnet": mainnetCfg, - "sepolia": sepoliaCfg, + "goerli": goerliCfg, + "mainnet": mainnetCfg, + "sepolia": sepoliaCfg, + "boba-sepolia": bobaSepoliaCfg, } - _ = mainnetCfg for name, expectedCfg := range configsByName { gotCfg, err := GetRollupConfig(name) @@ -138,6 +137,40 @@ var sepoliaCfg = rollup.Config{ ProtocolVersionsAddress: common.HexToAddress("0x79ADD5713B383DAa0a138d3C4780C7A1804a8090"), } +var bobaSepoliaCfg = rollup.Config{ + Genesis: rollup.Genesis{ + L1: eth.BlockID{ + Hash: common.HexToHash("0x632d8caedbfd573e09c1b49134bd5147147e0904e0f04eba15c662be0258f517"), + Number: 5109513, + }, + L2: eth.BlockID{ + Hash: common.HexToHash("0x097654c4c932c97808933b42179388f7bbcefaed3bd93fdf69157e19f1deea0e"), + Number: 511, + }, + L2Time: 1705600788, + SystemConfig: eth.SystemConfig{ + BatcherAddr: common.HexToAddress("0xf598b6388eC06945021699F0bbb23dfCFc5edbE8"), + Overhead: eth.Bytes32(common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000834")), + Scalar: eth.Bytes32(common.HexToHash("0x00000000000000000000000000000000000000000000000000000000000f4240")), + GasLimit: 30000000, + }, + }, + BlockTime: 2, + MaxSequencerDrift: 600, + SeqWindowSize: 3600, + ChannelTimeout: 300, + L1ChainID: big.NewInt(11155111), + L2ChainID: big.NewInt(28882), + BatchInboxAddress: common.HexToAddress("0xfff0000000000000000000000000000000028882"), + DepositContractAddress: common.HexToAddress("0xB079E6FA9B3eb072fEbf7F746044834eab308dB6"), + L1SystemConfigAddress: common.HexToAddress("0xfdc9bce032cef55a71b4fde9b9a2198ad1551965"), + RegolithTime: u64Ptr(1705600788), + CanyonTime: u64Ptr(1705600788), + DeltaTime: u64Ptr(1709078400), + EcotoneTime: u64Ptr(1709078400), + ProtocolVersionsAddress: common.HexToAddress("0x0000000000000000000000000000000000000000"), +} + func u64Ptr(v uint64) *uint64 { return &v } diff --git a/op-node/rollup/superchain.go b/op-node/rollup/superchain.go index 6b011395d825..a7f81f028ddc 100644 --- a/op-node/rollup/superchain.go +++ b/op-node/rollup/superchain.go @@ -131,8 +131,6 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { cfg.SeqWindowSize = 7200 } if chainID == bobaSepolia { - *cfg.CanyonTime = 1705600788 - cfg.DeltaTime = nil cfg.ProtocolVersionsAddress = common.Address{} } return cfg, nil