@ -31,7 +31,7 @@ var (
RopstenGenesisHash = common . HexToHash ( "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d" )
RopstenGenesisHash = common . HexToHash ( "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d" )
RinkebyGenesisHash = common . HexToHash ( "0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177" )
RinkebyGenesisHash = common . HexToHash ( "0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177" )
GoerliGenesisHash = common . HexToHash ( "0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a" )
GoerliGenesisHash = common . HexToHash ( "0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a" )
YoloV3 GenesisHash = common . HexToHash ( "0xf1f2876e8500c77afcc03228757b39477eceffccf645b734967fe3c7e16967b7 " )
Baikal GenesisHash = common . HexToHash ( "0xa0bc5d43c72a990cedeb59d305702602b34c3ee8585e77d03c7a4fa64d79636e " )
)
)
// TrustedCheckpoints associates each known checkpoint with the genesis hash of
// TrustedCheckpoints associates each known checkpoint with the genesis hash of
@ -217,9 +217,8 @@ var (
Threshold : 2 ,
Threshold : 2 ,
}
}
// YoloV3ChainConfig contains the chain parameters to run a node on the YOLOv3 test network.
BaikalChainConfig = & ChainConfig {
YoloV3ChainConfig = & ChainConfig {
ChainID : big . NewInt ( 1642 ) ,
ChainID : new ( big . Int ) . SetBytes ( [ ] byte ( "yolov3x" ) ) ,
HomesteadBlock : big . NewInt ( 0 ) ,
HomesteadBlock : big . NewInt ( 0 ) ,
DAOForkBlock : nil ,
DAOForkBlock : nil ,
DAOForkSupport : true ,
DAOForkSupport : true ,
@ -231,10 +230,10 @@ var (
PetersburgBlock : big . NewInt ( 0 ) ,
PetersburgBlock : big . NewInt ( 0 ) ,
IstanbulBlock : big . NewInt ( 0 ) ,
IstanbulBlock : big . NewInt ( 0 ) ,
MuirGlacierBlock : nil ,
MuirGlacierBlock : nil ,
BerlinBlock : nil , // Don't enable Berlin directly, we're YOLOing it
BerlinBlock : big . NewInt ( 0 ) ,
YoloV3 Block: big . NewInt ( 0 ) ,
London Block: big . NewInt ( 0 ) ,
Clique : & CliqueConfig {
Clique : & CliqueConfig {
Period : 15 ,
Period : 30 ,
Epoch : 30000 ,
Epoch : 30000 ,
} ,
} ,
}
}
@ -331,8 +330,8 @@ type ChainConfig struct {
IstanbulBlock * big . Int ` json:"istanbulBlock,omitempty" ` // Istanbul switch block (nil = no fork, 0 = already on istanbul)
IstanbulBlock * big . Int ` json:"istanbulBlock,omitempty" ` // Istanbul switch block (nil = no fork, 0 = already on istanbul)
MuirGlacierBlock * big . Int ` json:"muirGlacierBlock,omitempty" ` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)
MuirGlacierBlock * big . Int ` json:"muirGlacierBlock,omitempty" ` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)
BerlinBlock * big . Int ` json:"berlinBlock,omitempty" ` // Berlin switch block (nil = no fork, 0 = already on berlin)
BerlinBlock * big . Int ` json:"berlinBlock,omitempty" ` // Berlin switch block (nil = no fork, 0 = already on berlin)
LondonBlock * big . Int ` json:"londonBlock,omitempty" ` // London switch block (nil = no fork, 0 = already on london)
YoloV3Block * big . Int ` json:"yoloV3Block,omitempty" ` // YOLO v3: Gas repricings TODO @holiman add EIP references
EWASMBlock * big . Int ` json:"ewasmBlock,omitempty" ` // EWASM switch block (nil = no fork, 0 = already activated)
EWASMBlock * big . Int ` json:"ewasmBlock,omitempty" ` // EWASM switch block (nil = no fork, 0 = already activated)
CatalystBlock * big . Int ` json:"catalystBlock,omitempty" ` // Catalyst switch block (nil = no fork, 0 = already on catalyst)
CatalystBlock * big . Int ` json:"catalystBlock,omitempty" ` // Catalyst switch block (nil = no fork, 0 = already on catalyst)
@ -371,7 +370,7 @@ func (c *ChainConfig) String() string {
default :
default :
engine = "unknown"
engine = "unknown"
}
}
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, Berlin: %v, YOLO v3 : %v, Engine: %v}" ,
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, Berlin: %v, London : %v, Engine: %v}" ,
c . ChainID ,
c . ChainID ,
c . HomesteadBlock ,
c . HomesteadBlock ,
c . DAOForkBlock ,
c . DAOForkBlock ,
@ -385,7 +384,7 @@ func (c *ChainConfig) String() string {
c . IstanbulBlock ,
c . IstanbulBlock ,
c . MuirGlacierBlock ,
c . MuirGlacierBlock ,
c . BerlinBlock ,
c . BerlinBlock ,
c . YoloV3 Block,
c . London Block,
engine ,
engine ,
)
)
}
}
@ -444,7 +443,12 @@ func (c *ChainConfig) IsIstanbul(num *big.Int) bool {
// IsBerlin returns whether num is either equal to the Berlin fork block or greater.
// IsBerlin returns whether num is either equal to the Berlin fork block or greater.
func ( c * ChainConfig ) IsBerlin ( num * big . Int ) bool {
func ( c * ChainConfig ) IsBerlin ( num * big . Int ) bool {
return isForked ( c . BerlinBlock , num ) || isForked ( c . YoloV3Block , num )
return isForked ( c . BerlinBlock , num )
}
// IsLondon returns whether num is either equal to the London fork block or greater.
func ( c * ChainConfig ) IsLondon ( num * big . Int ) bool {
return isForked ( c . LondonBlock , num )
}
}
// IsCatalyst returns whether num is either equal to the Merge fork block or greater.
// IsCatalyst returns whether num is either equal to the Merge fork block or greater.
@ -496,6 +500,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
{ name : "istanbulBlock" , block : c . IstanbulBlock } ,
{ name : "istanbulBlock" , block : c . IstanbulBlock } ,
{ name : "muirGlacierBlock" , block : c . MuirGlacierBlock , optional : true } ,
{ name : "muirGlacierBlock" , block : c . MuirGlacierBlock , optional : true } ,
{ name : "berlinBlock" , block : c . BerlinBlock } ,
{ name : "berlinBlock" , block : c . BerlinBlock } ,
{ name : "londonBlock" , block : c . LondonBlock } ,
} {
} {
if lastFork . name != "" {
if lastFork . name != "" {
// Next one must be higher number
// Next one must be higher number
@ -562,8 +567,8 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
if isForkIncompatible ( c . BerlinBlock , newcfg . BerlinBlock , head ) {
if isForkIncompatible ( c . BerlinBlock , newcfg . BerlinBlock , head ) {
return newCompatError ( "Berlin fork block" , c . BerlinBlock , newcfg . BerlinBlock )
return newCompatError ( "Berlin fork block" , c . BerlinBlock , newcfg . BerlinBlock )
}
}
if isForkIncompatible ( c . YoloV3 Block, newcfg . YoloV3 Block, head ) {
if isForkIncompatible ( c . London Block, newcfg . London Block, head ) {
return newCompatError ( "YOLOv3 fork block" , c . YoloV3 Block, newcfg . YoloV3 Block)
return newCompatError ( "London fork block" , c . London Block, newcfg . London Block)
}
}
if isForkIncompatible ( c . EWASMBlock , newcfg . EWASMBlock , head ) {
if isForkIncompatible ( c . EWASMBlock , newcfg . EWASMBlock , head ) {
return newCompatError ( "ewasm fork block" , c . EWASMBlock , newcfg . EWASMBlock )
return newCompatError ( "ewasm fork block" , c . EWASMBlock , newcfg . EWASMBlock )
@ -635,7 +640,7 @@ type Rules struct {
ChainID * big . Int
ChainID * big . Int
IsHomestead , IsEIP150 , IsEIP155 , IsEIP158 bool
IsHomestead , IsEIP150 , IsEIP155 , IsEIP158 bool
IsByzantium , IsConstantinople , IsPetersburg , IsIstanbul bool
IsByzantium , IsConstantinople , IsPetersburg , IsIstanbul bool
IsBerlin , IsCatalyst bool
IsBerlin , IsLondon , Is Catalyst bool
}
}
// Rules ensures c's ChainID is not nil.
// Rules ensures c's ChainID is not nil.
@ -655,6 +660,7 @@ func (c *ChainConfig) Rules(num *big.Int) Rules {
IsPetersburg : c . IsPetersburg ( num ) ,
IsPetersburg : c . IsPetersburg ( num ) ,
IsIstanbul : c . IsIstanbul ( num ) ,
IsIstanbul : c . IsIstanbul ( num ) ,
IsBerlin : c . IsBerlin ( num ) ,
IsBerlin : c . IsBerlin ( num ) ,
IsLondon : c . IsLondon ( num ) ,
IsCatalyst : c . IsCatalyst ( num ) ,
IsCatalyst : c . IsCatalyst ( num ) ,
}
}
}
}