Skip to content

Commit

Permalink
Drop OP stack goerli because superchain removed support
Browse files Browse the repository at this point in the history
  • Loading branch information
pcw109550 committed May 24, 2024
1 parent 7b265ee commit 984cf68
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 37 deletions.
2 changes: 1 addition & 1 deletion consensus/misc/create2deployer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestEnsureCreate2Deployer(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cfg := chain.Config{
ChainID: big.NewInt(params.OPGoerliChainID),
ChainID: big.NewInt(params.OPMainnetChainID),
Optimism: &chain.OptimismConfig{},
CanyonTime: big.NewInt(int64(canyonTime)),
}
Expand Down
2 changes: 0 additions & 2 deletions core/genesis_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,6 @@ func loadOPStackGenesisByChainName(name string) (*types.Genesis, error) {
switch opStackChainCfg.ChainID {
case params.OPMainnetChainID:
expectedHash = params.OPMainnetGenesisHash
case params.OPGoerliChainID:
expectedHash = params.OPGoerliGenesisHash
default:
return nil, fmt.Errorf("unknown stateless genesis definition for chain %d", opStackChainCfg.ChainID)
}
Expand Down
5 changes: 0 additions & 5 deletions erigon-lib/chain/networkname/network_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ const (

OPDevnetChainName = "op-devnet"
OPMainnetChainName = "op-mainnet"
OPGoerliChainName = "op-goerli"

LegacyOPDevnetChainName = "optimism-devnet"
LegacyOPMainnetChainName = "optimism-mainnet"
LegacyOPGoerliChainName = "optimism-goerli"
)

var All = []string{
Expand All @@ -34,16 +32,13 @@ var All = []string{
BorDevnetChainName,
GnosisChainName,
ChiadoChainName,
OPGoerliChainName,
OPDevnetChainName,
}

func HandleLegacyName(name string) string {
switch name {
case LegacyOPDevnetChainName:
return OPDevnetChainName
case LegacyOPGoerliChainName:
return OPGoerliChainName
case LegacyOPMainnetChainName:
return OPMainnetChainName
default:
Expand Down
5 changes: 0 additions & 5 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,13 @@ var (
ChiadoGenesisHash = libcommon.HexToHash("0xada44fd8d2ecab8b08f256af07ad3e777f17fb434f8f8e678b312f576212ba9a")

OPMainnetGenesisHash = libcommon.HexToHash("0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b")
OPGoerliGenesisHash = libcommon.HexToHash("0xc1fc15cd51159b1f1e5cbc4b82e85c1447ddfa33c52cf1d98d14fba0d6354be1")
OPDevnetGenesisHash = libcommon.HexToHash("0x1c16b5a055ff0197544b96f1375bf6be35ec478e23a95093cfe01902d821c22a")
)

var (
GnosisGenesisStateRoot = libcommon.HexToHash("0x40cf4430ecaa733787d1a65154a3b9efb560c95d9e324a23b97f0609b539133b")
ChiadoGenesisStateRoot = libcommon.HexToHash("0x9ec3eaf4e6188dfbdd6ade76eaa88289b57c63c9a2cde8d35291d5a29e143d31")
OptimismMainnetStateRoot = libcommon.HexToHash("0xeddb4c1786789419153a27c4c80ff44a2226b6eda04f7e22ce5bae892ea568eb")
OptimismGoerliStateRoot = libcommon.HexToHash("0x9e6b478a1cd331a979c39e4bddf42c676bcf5a63382f898dc441fe3fe5eb0837")
)

var (
Expand Down Expand Up @@ -285,9 +283,6 @@ func GenesisHashByChainName(chain string) *libcommon.Hash {
case networkname.OPMainnetChainName:
// cannot use genesis has from superchain registry because of pre-bedrock blocks
return &OPMainnetGenesisHash
case networkname.OPGoerliChainName:
// cannot use genesis has from superchain registry because of pre-bedrock blocks
return &OPGoerliGenesisHash
default:
if opStackChainCfg := OPStackChainConfigByName(chain); opStackChainCfg != nil {
genesisHash := libcommon.Hash(opStackChainCfg.Genesis.L2.Hash)
Expand Down
30 changes: 6 additions & 24 deletions params/superchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ import (
)

const (
OPMainnetChainID = 10
OPGoerliChainID = 420
BaseMainnetChainID = 8453
BaseGoerliChainID = 84531
baseSepoliaChainID = 84532
baseGoerliDevnetChainID = 11763071
pgnSepoliaChainID = 58008
devnetChainID = 997
chaosnetChainID = 888
OPMainnetChainID = 10
BaseMainnetChainID = 8453
baseSepoliaChainID = 84532
pgnSepoliaChainID = 58008
devnetChainID = 997
chaosnetChainID = 888
)

// OP Stack chain config
Expand Down Expand Up @@ -58,8 +55,6 @@ func OPStackChainConfigByName(name string) *superchain.ChainConfig {
func OPStackChainConfigByGenesisHash(genesisHash common.Hash) *superchain.ChainConfig {
if bytes.Equal(genesisHash.Bytes(), OPMainnetGenesisHash.Bytes()) {
return superchain.OPChains[OPMainnetChainID]
} else if bytes.Equal(genesisHash.Bytes(), OPGoerliGenesisHash.Bytes()) {
return superchain.OPChains[OPGoerliChainID]
}
for _, chainCfg := range superchain.OPChains {
if bytes.Equal(chainCfg.Genesis.L2.Hash[:], genesisHash.Bytes()) {
Expand Down Expand Up @@ -144,28 +139,15 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config

// special overrides for OP-Stack chains with pre-Regolith upgrade history
switch opStackChainCfg.ChainID {
case OPGoerliChainID:
out.LondonBlock = big.NewInt(4061224)
out.ArrowGlacierBlock = big.NewInt(4061224)
out.GrayGlacierBlock = big.NewInt(4061224)
out.MergeNetsplitBlock = big.NewInt(4061224)
out.BedrockBlock = big.NewInt(4061224)
out.RegolithTime = OptimismGoerliRegolithTime
out.Optimism.EIP1559Elasticity = 10
case OPMainnetChainID:
out.BerlinBlock = big.NewInt(3950000)
out.LondonBlock = big.NewInt(105235063)
out.ArrowGlacierBlock = big.NewInt(105235063)
out.GrayGlacierBlock = big.NewInt(105235063)
out.MergeNetsplitBlock = big.NewInt(105235063)
out.BedrockBlock = big.NewInt(105235063)
case BaseGoerliChainID:
out.RegolithTime = BaseGoerliRegolithTime
out.Optimism.EIP1559Elasticity = 10
case baseSepoliaChainID:
out.Optimism.EIP1559Elasticity = 10
case baseGoerliDevnetChainID:
out.RegolithTime = baseGoerliDevnetRegolithTime
case pgnSepoliaChainID:
out.Optimism.EIP1559Elasticity = 2
out.Optimism.EIP1559Denominator = 8
Expand Down

0 comments on commit 984cf68

Please sign in to comment.