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 boba mainnet #92

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/genesis_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@ func loadOPStackGenesisByChainName(name string) (*types.Genesis, error) {
expectedHash = params.OPMainnetGenesisHash
case params.OPGoerliChainID:
expectedHash = params.OPGoerliGenesisHash
case params.BobaMainnetChainID:
expectedHash = params.BobaMainnetGenesisHash
case params.BobaSepoliaChainID:
expectedHash = params.BobaSepoliaGenesisHash
default:
Expand Down
2 changes: 2 additions & 0 deletions erigon-lib/chain/networkname/network_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
OPGoerliChainName = "op-goerli"
OPSepoliaChainName = "op-sepolia"

BobaMainnetChainName = "boba-mainnet"
BobaSepoliaChainName = "boba-sepolia"

LegacyOPMainnetChainName = "optimism-mainnet"
Expand All @@ -41,6 +42,7 @@ var All = []string{
OPSepoliaChainName,
OPGoerliChainName,

BobaMainnetChainName,
BobaSepoliaChainName,
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,4 @@ replace github.com/ledgerwatch/erigon-lib => ./erigon-lib

replace github.com/tendermint/tendermint => github.com/bnb-chain/tendermint v0.31.12

replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240315201409-1ecd6fec327e
replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240417003925-0d5b52881f48
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo=
github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240315201409-1ecd6fec327e h1:GdD5nhXwsA9sPAEEL//phSgwlWGo2vWFsN7XeTTQ78k=
github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240315201409-1ecd6fec327e/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0=
github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240417003925-0d5b52881f48 h1:nQRsX8jVFcJm+ujIsjvArLAgRLb1CrE6Hww0Y9yES1E=
github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240417003925-0d5b52881f48/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo=
github.com/bradfitz/iter v0.0.0-20190303215204-33e6a9893b0c/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo=
Expand Down
4 changes: 4 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ var (
OPGoerliGenesisHash = libcommon.HexToHash("0xc1fc15cd51159b1f1e5cbc4b82e85c1447ddfa33c52cf1d98d14fba0d6354be1")
OPSepoliaGenesisHash = libcommon.HexToHash("0x102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d")

BobaMainnetGenesisHash = libcommon.HexToHash("0xdcd9e6a8f9973eaa62da2874959cb152faeb4fd6929177bd6335a1a16074ef9c")
BobaSepoliaGenesisHash = libcommon.HexToHash("0xc6171953a6a376ece6e33149686044f24f58a387ce2636a54e391d330b2326b5")
)

Expand Down Expand Up @@ -301,6 +302,9 @@ func GenesisHashByChainName(chain string) *libcommon.Hash {
return &OPGoerliGenesisHash
case networkname.OPSepoliaChainName:
return &OPSepoliaGenesisHash
case networkname.BobaMainnetChainName:
// cannot use genesis hash from superchain registry because of pre-bedrock blocks
return &BobaMainnetGenesisHash
case networkname.BobaSepoliaChainName:
// cannot use genesis hash from superchain registry because of pre-bedrock blocks
return &BobaSepoliaGenesisHash
Expand Down
16 changes: 16 additions & 0 deletions params/superchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
pgnSepoliaChainID = 58008
devnetChainID = 997
chaosnetChainID = 888
BobaMainnetChainID = 288
BobaSepoliaChainID = 28882
)

Expand All @@ -37,6 +38,8 @@ var (
devnetRegolithTime = big.NewInt(1677984480)
// August 16, 2023 @ 3:34:22 am UTC
chaosnetRegolithTime = big.NewInt(1692156862)
// Apr Apr 16 2024 21:27:59 UTC 2024
BobaMainnetRegolithTime = big.NewInt(1713302879)
// January 18, 2024 @ 5:59:48 pm UTC
BobaSepoliaRegolithTime = big.NewInt(1705600788)
)
Expand Down Expand Up @@ -190,6 +193,19 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config
out.Optimism.EIP1559Elasticity = 6
out.Optimism.EIP1559Denominator = 50
out.Optimism.EIP1559DenominatorCanyon = 250
case BobaMainnetChainID:
out.BerlinBlock = big.NewInt(1149019)
out.LondonBlock = big.NewInt(1149019)
out.ArrowGlacierBlock = big.NewInt(1149019)
out.GrayGlacierBlock = big.NewInt(1149019)
out.MergeNetsplitBlock = big.NewInt(1149019)
out.BedrockBlock = big.NewInt(1149019)
out.RegolithTime = BobaMainnetRegolithTime
out.ShanghaiTime = BobaMainnetRegolithTime
out.CanyonTime = BobaMainnetRegolithTime
out.Optimism.EIP1559Elasticity = 6
out.Optimism.EIP1559Denominator = 50
out.Optimism.EIP1559DenominatorCanyon = 250
}

return out
Expand Down
Loading