3232 RinkebyGenesisHash = common .HexToHash ("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177" )
3333 GoerliGenesisHash = common .HexToHash ("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a" )
3434
35+ BSCGenesisHash = common .HexToHash ("0x0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b" )
3536 ChapelGenesisHash = common .HexToHash ("0x6d3c66c5357ec91d5c43af47e234a939b22557cbb552dc45bebbceeed90fbe34" )
36- RialtoGenesisHash = common .HexToHash ("0xaa1c1e0af675e846942719466ab72822eff51ebf8462ead0897ae1240e3c0da1 " )
37+ RialtoGenesisHash = common .HexToHash ("0x005dc005bddd1967de6187c1c23be801eb7abdd80cebcc24f341b727b70311d6 " )
3738)
3839
3940// TrustedCheckpoints associates each known checkpoint with the genesis hash of
@@ -213,6 +214,26 @@ var (
213214 Threshold : 2 ,
214215 }
215216
217+ BSCChainConfig = & ChainConfig {
218+ ChainID : big .NewInt (56 ),
219+ HomesteadBlock : big .NewInt (0 ),
220+ EIP150Block : big .NewInt (0 ),
221+ EIP155Block : big .NewInt (0 ),
222+ EIP158Block : big .NewInt (0 ),
223+ ByzantiumBlock : big .NewInt (0 ),
224+ ConstantinopleBlock : big .NewInt (0 ),
225+ PetersburgBlock : big .NewInt (0 ),
226+ IstanbulBlock : big .NewInt (0 ),
227+ MuirGlacierBlock : big .NewInt (0 ),
228+ RamanujanBlock : big .NewInt (0 ),
229+ NielsBlock : big .NewInt (0 ),
230+ MirrorSyncBlock : big .NewInt (0 ),
231+ Parlia : & ParliaConfig {
232+ Period : 3 ,
233+ Epoch : 200 ,
234+ },
235+ }
236+
216237 ChapelChainConfig = & ChainConfig {
217238 ChainID : big .NewInt (97 ),
218239 HomesteadBlock : big .NewInt (0 ),
@@ -226,6 +247,7 @@ var (
226247 MuirGlacierBlock : big .NewInt (0 ),
227248 RamanujanBlock : big .NewInt (1010000 ),
228249 NielsBlock : big .NewInt (1014369 ),
250+ MirrorSyncBlock : big .NewInt (5582500 ),
229251 Parlia : & ParliaConfig {
230252 Period : 3 ,
231253 Epoch : 200 ,
@@ -245,6 +267,7 @@ var (
245267 MuirGlacierBlock : big .NewInt (0 ),
246268 RamanujanBlock : big .NewInt (400 ),
247269 NielsBlock : big .NewInt (0 ),
270+ MirrorSyncBlock : big .NewInt (400 ),
248271 Parlia : & ParliaConfig {
249272 Period : 3 ,
250273 Epoch : 200 ,
@@ -256,16 +279,16 @@ var (
256279 //
257280 // This configuration is intentionally not using keyed fields to force anyone
258281 // adding flags to the config to also have to set these fields.
259- AllEthashProtocolChanges = & ChainConfig {big .NewInt (1337 ), big .NewInt (0 ), nil , false , big .NewInt (0 ), common.Hash {}, big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), nil , nil , nil , nil , new (EthashConfig ), nil , nil }
282+ AllEthashProtocolChanges = & ChainConfig {big .NewInt (1337 ), big .NewInt (0 ), nil , false , big .NewInt (0 ), common.Hash {}, big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), nil , nil , nil , nil , nil , new (EthashConfig ), nil , nil }
260283
261284 // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
262285 // and accepted by the Ethereum core developers into the Clique consensus.
263286 //
264287 // This configuration is intentionally not using keyed fields to force anyone
265288 // adding flags to the config to also have to set these fields.
266- AllCliqueProtocolChanges = & ChainConfig {big .NewInt (1337 ), big .NewInt (0 ), nil , false , big .NewInt (0 ), common.Hash {}, big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), nil , nil , nil , nil , nil , & CliqueConfig {Period : 0 , Epoch : 30000 }, nil }
289+ AllCliqueProtocolChanges = & ChainConfig {big .NewInt (1337 ), big .NewInt (0 ), nil , false , big .NewInt (0 ), common.Hash {}, big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), nil , nil , nil , nil , nil , nil , & CliqueConfig {Period : 0 , Epoch : 30000 }, nil }
267290
268- TestChainConfig = & ChainConfig {big .NewInt (1 ), big .NewInt (0 ), nil , false , big .NewInt (0 ), common.Hash {}, big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), nil , nil , nil , nil , new (EthashConfig ), nil , nil }
291+ TestChainConfig = & ChainConfig {big .NewInt (1 ), big .NewInt (0 ), nil , false , big .NewInt (0 ), common.Hash {}, big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), big .NewInt (0 ), nil , nil , nil , nil , nil , new (EthashConfig ), nil , nil }
269292 TestRules = TestChainConfig .Rules (new (big.Int ))
270293)
271294
@@ -339,6 +362,7 @@ type ChainConfig struct {
339362 EWASMBlock * big.Int `json:"ewasmBlock,omitempty" toml:",omitempty"` // EWASM switch block (nil = no fork, 0 = already activated)
340363 RamanujanBlock * big.Int `json:"ramanujanBlock,omitempty" toml:",omitempty"` // ramanujanBlock switch block (nil = no fork, 0 = already activated)
341364 NielsBlock * big.Int `json:"nielsBlock,omitempty" toml:",omitempty"` // nielsBlock switch block (nil = no fork, 0 = already activated)
365+ MirrorSyncBlock * big.Int `json:"mirrorSyncBlock,omitempty" toml:",omitempty"` // mirrorSyncBlock switch block (nil = no fork, 0 = already activated)
342366
343367 // Various consensus engines
344368 Ethash * EthashConfig `json:"ethash,omitempty" toml:",omitempty"`
@@ -389,7 +413,7 @@ func (c *ChainConfig) String() string {
389413 default :
390414 engine = "unknown"
391415 }
392- return fmt .Sprintf ("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, Engine: %v}" ,
416+ return fmt .Sprintf ("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Engine: %v}" ,
393417 c .ChainID ,
394418 c .HomesteadBlock ,
395419 c .DAOForkBlock ,
@@ -404,6 +428,7 @@ func (c *ChainConfig) String() string {
404428 c .MuirGlacierBlock ,
405429 c .RamanujanBlock ,
406430 c .NielsBlock ,
431+ c .MirrorSyncBlock ,
407432 engine ,
408433 )
409434}
@@ -463,6 +488,17 @@ func (c *ChainConfig) IsOnNiels(num *big.Int) bool {
463488 return configNumEqual (c .NielsBlock , num )
464489}
465490
491+ // IsMirrorSync returns whether num is either equal to the MirrorSync fork block or greater.
492+ func (c * ChainConfig ) IsMirrorSync (num * big.Int ) bool {
493+ return isForked (c .MirrorSyncBlock , num )
494+ }
495+
496+ // IsOnMirrorSync returns whether num is equal to the MirrorSync fork block
497+ func (c * ChainConfig ) IsOnMirrorSync (num * big.Int ) bool {
498+ return configNumEqual (c .MirrorSyncBlock , num )
499+ }
500+
501+
466502// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
467503func (c * ChainConfig ) IsMuirGlacier (num * big.Int ) bool {
468504 return isForked (c .MuirGlacierBlock , num )
@@ -522,6 +558,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
522558 {"istanbulBlock" , c .IstanbulBlock },
523559 {"muirGlacierBlock" , c .MuirGlacierBlock },
524560 {"ramanujanBlock" , c .RamanujanBlock },
561+ {"mirrorSyncBlock" , c .MirrorSyncBlock },
525562 } {
526563 if lastFork .name != "" {
527564 // Next one must be higher number
@@ -584,6 +621,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
584621 if isForkIncompatible (c .RamanujanBlock , newcfg .RamanujanBlock , head ) {
585622 return newCompatError ("ramanujan fork block" , c .RamanujanBlock , newcfg .RamanujanBlock )
586623 }
624+ if isForkIncompatible (c .MirrorSyncBlock , newcfg .MirrorSyncBlock , head ) {
625+ return newCompatError ("mirrorSync fork block" , c .MirrorSyncBlock , newcfg .MirrorSyncBlock )
626+ }
587627 return nil
588628}
589629
0 commit comments