Skip to content

Commit

Permalink
Merge pull request #73 from bobanetwork/add-boba-sepolia
Browse files Browse the repository at this point in the history
Add Boba Sepolia configuration
  • Loading branch information
boyuan-chen authored Jan 11, 2024
2 parents 1c3c8c3 + 00923f2 commit 353ebab
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/allocs/boba_sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
13 changes: 13 additions & 0 deletions core/genesis_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,17 @@ func OptimismGoerliGenesisBlock() *types.Genesis {
}
}

func BobaSepoliaGenesisBlock() *types.Genesis {
return &types.Genesis{
Config: params.BobaSepoliaChainConfig,
Difficulty: big.NewInt(1),
Mixhash: libcommon.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),
ExtraData: hexutil.MustDecode("0x000000000000000000000000000000000000000000000000000000000000000000000398232e2064f896018496b4b44b3d62751f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 11000000,
Alloc: readPrealloc("allocs/boba_sepolia.json"),
}
}

// Pre-calculated version of:
//
// DevnetSignPrivateKey = crypto.HexToECDSA(sha256.Sum256([]byte("erigon devnet key")))
Expand Down Expand Up @@ -718,6 +729,8 @@ func GenesisBlockByChainName(chain string) *types.Genesis {
return OptimismMainnetGenesisBlock()
case networkname.OptimismGoerliChainName:
return OptimismGoerliGenesisBlock()
case networkname.BobaSepoliaChainName:
return BobaSepoliaGenesisBlock()
default:
return nil
}
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 @@ -14,6 +14,7 @@ const (
ChiadoChainName = "chiado"
OptimismMainnetChainName = "optimism-mainnet"
OptimismGoerliChainName = "optimism-goerli"
BobaSepoliaChainName = "boba-sepolia"
)

var All = []string{
Expand All @@ -28,4 +29,5 @@ var All = []string{
ChiadoChainName,
OptimismMainnetChainName,
OptimismGoerliChainName,
BobaSepoliaChainName,
}
26 changes: 26 additions & 0 deletions params/chainspecs/boba-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"ChainName": "boba-sepolia",
"chainId": 28882,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"berlinBlock": 511,
"londonBlock": 511,
"arrowGlacierBlock": 511,
"grayGlacierBlock": 511,
"mergeNetsplitBlock": 511,
"bedrockBlock": 511,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"optimism": {
"eip1559Elasticity": 6,
"eip1559Denominator": 50
}
}
7 changes: 7 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var (
ChiadoGenesisHash = libcommon.HexToHash("0xada44fd8d2ecab8b08f256af07ad3e777f17fb434f8f8e678b312f576212ba9a")
OptimismMainnetGenesisHash = libcommon.HexToHash("0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b")
OptimismGoerliGenesisHash = libcommon.HexToHash("0xc1fc15cd51159b1f1e5cbc4b82e85c1447ddfa33c52cf1d98d14fba0d6354be1")
BobaSepoliaGenesisHash = libcommon.HexToHash("0x8c571a8c282dcba86a5f47b823defbf108999e8375982d339122b9e7264993b1")
)

var (
Expand Down Expand Up @@ -141,6 +142,8 @@ var (

OptimismGoerliChainConfig = readChainSpec("chainspecs/optimism-goerli.json")

BobaSepoliaChainConfig = readChainSpec("chainspecs/boba-sepolia.json")

TestChainConfig = &chain.Config{
ChainID: big.NewInt(1337),
Consensus: chain.EtHashConsensus,
Expand Down Expand Up @@ -245,6 +248,8 @@ func ChainConfigByChainName(chain string) *chain.Config {
return OptimismMainnetChainConfig
case networkname.OptimismGoerliChainName:
return OptimismGoerliChainConfig
case networkname.BobaSepoliaChainName:
return BobaSepoliaChainConfig
default:
return nil
}
Expand Down Expand Up @@ -274,6 +279,8 @@ func GenesisHashByChainName(chain string) *libcommon.Hash {
return &OptimismMainnetGenesisHash
case networkname.OptimismGoerliChainName:
return &OptimismGoerliGenesisHash
case networkname.BobaSepoliaChainName:
return &BobaSepoliaGenesisHash
default:
return nil
}
Expand Down
2 changes: 2 additions & 0 deletions turbo/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ func NewNodConfigUrfave(ctx *cli.Context, logger log.Logger) *nodecfg.Config {
}
case networkname.OptimismGoerliChainName:
logger.Info("Starting Erigon on Optimism Görli testnet...")
case networkname.BobaSepoliaChainName:
logger.Info("Starting Erigon on Boba Sepolia testnet...")
default:
logger.Info("Starting Erigon on", "devnet", chain)
}
Expand Down

0 comments on commit 353ebab

Please sign in to comment.