Skip to content

Commit

Permalink
feat(op-geth): add combo chain config
Browse files Browse the repository at this point in the history
  • Loading branch information
redhdx authored and 2020xibao committed Feb 17, 2025
1 parent 41f5969 commit 5ff0d64
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g
// on top of an existing private network genesis block). In that case, only
// apply the overrides.
if genesis == nil && stored != params.MainnetGenesisHash && stored != params.OPBNBMainNetGenesisHash &&
stored != params.OPBNBTestNetGenesisHash && stored != params.OPBNBQANetGenesisHash {
stored != params.OPBNBTestNetGenesisHash && stored != params.OPBNBQANetGenesisHash &&
stored != params.ComboMainNetGenesisHash && stored != params.ComboTestNetGenesisHash {
newcfg = storedcfg
applyOverrides(newcfg)
}
Expand Down Expand Up @@ -449,6 +450,10 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.OPBNBTestNetConfig
case ghash == params.OPBNBQANetGenesisHash:
return params.OPBNBQANetConfig
case ghash == params.ComboMainNetGenesisHash:
return params.ComboMainNetConfig
case ghash == params.ComboTestNetGenesisHash:
return params.ComboTestNetConfig
default:
return params.AllEthashProtocolChanges
}
Expand Down
70 changes: 70 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ var (
OPBNBMainNetGenesisHash = common.HexToHash("0x4dd61178c8b0f01670c231597e7bcb368e84545acd46d940a896d6a791dd6df4")
OPBNBTestNetGenesisHash = common.HexToHash("0x51fa57729dfb1c27542c21b06cb72a0459c57440ceb43a465dae1307cd04fe80")
OPBNBQANetGenesisHash = common.HexToHash("0x73eaf214333f29eed23c4902fdc17889b3e379372e52a42567d0069e1b10cdb0")
ComboMainNetGenesisHash = common.HexToHash("0x92fcf9e91a4cdd7ffc7e67207e77dfba049bacf1ede5c5917a40f9537e05f4bc")
ComboTestNetGenesisHash = common.HexToHash("0x51d565869cb1c6d7e577848ccd1f93918b99427c1cc3fed9dca628d0cffcefbb")
)

const (
Expand Down Expand Up @@ -282,6 +284,74 @@ var (
WrightTime: newUint64(0),
FjordTime: newUint64(1724392800), // Aug-23-2024 06:00 AM +UTC
}
// ComboMainNetConfig is the chain parameters to run a node on the combo main network.
ComboMainNetConfig = &ChainConfig{
ChainID: big.NewInt(9980),
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ArrowGlacierBlock: big.NewInt(0),
GrayGlacierBlock: big.NewInt(0),
MergeNetsplitBlock: big.NewInt(0),
BedrockBlock: big.NewInt(0),
RegolithTime: newUint64(0),
TerminalTotalDifficulty: big.NewInt(0),
TerminalTotalDifficultyPassed: true,
Optimism: &OptimismConfig{
EIP1559Elasticity: 2,
EIP1559Denominator: 8,
EIP1559DenominatorCanyon: 8,
},
Fermat: big.NewInt(0),
ShanghaiTime: newUint64(1719814200), // July-01-2024 06:10 AM +UTC
CanyonTime: newUint64(1719814200), // July-01-2024 06:10 AM +UTC
// Delta: the Delta upgrade does not affect the execution-layer, and is thus not configurable in the chain config.
CancunTime: newUint64(1719815400), // July-01-2024 06:30 AM +UTC
EcotoneTime: newUint64(1719815400), // July-01-2024 06:30 AM +UTC
HaberTime: newUint64(1719816000), // July-01-2024 06:40 AM +UTC
}
// ComboTestNetConfig is the chain parameters to run a node on the combo testnet network.
ComboTestNetConfig = &ChainConfig{
ChainID: big.NewInt(1715),
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ArrowGlacierBlock: big.NewInt(0),
GrayGlacierBlock: big.NewInt(0),
MergeNetsplitBlock: big.NewInt(0),
BedrockBlock: big.NewInt(0),
RegolithTime: newUint64(0),
TerminalTotalDifficulty: big.NewInt(0),
TerminalTotalDifficultyPassed: true,
Optimism: &OptimismConfig{
EIP1559Elasticity: 2,
EIP1559Denominator: 8,
EIP1559DenominatorCanyon: 8,
},
Fermat: big.NewInt(0),
ShanghaiTime: newUint64(1719209400), // June-24-2024 06:10 AM +UTC
CanyonTime: newUint64(1719209400), // June-24-2024 06:10 AM +UTC
// Delta: the Delta upgrade does not affect the execution-layer, and is thus not configurable in the chain config.
CancunTime: newUint64(1719210600), // June-24-2024 06:30 AM +UTC
EcotoneTime: newUint64(1719210600), // June-24-2024 06:30 AM +UTC
HaberTime: newUint64(1719211200), // June-24-2024 06:40 AM +UTC
}

// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
// and accepted by the Ethereum core developers into the Ethash consensus.
Expand Down

0 comments on commit 5ff0d64

Please sign in to comment.