|
|
@@ -33,7 +33,7 @@ var (
|
|
|
GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a")
|
|
|
|
|
|
CoreGenesisHash = common.HexToHash("0x0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b")
|
|
|
- BuffaloGenesisHash = common.HexToHash("0x6d3c66c5357ec91d5c43af47e234a939b22557cbb552dc45bebbceeed90fbe34")
|
|
|
+ BuffaloGenesisHash = common.HexToHash("0xd90508c51efd64e75363cdf51114d9f2a90a79e6cd0f78f3c3038b47695c034a")
|
|
|
RialtoGenesisHash = common.HexToHash("0x005dc005bddd1967de6187c1c23be801eb7abdd80cebcc24f341b727b70311d6")
|
|
|
YoloV3GenesisHash = common.HexToHash("0xf1f2876e8500c77afcc03228757b39477eceffccf645b734967fe3c7e16967b7")
|
|
|
)
|
|
|
@@ -248,9 +248,11 @@ var (
|
|
|
PetersburgBlock: big.NewInt(0),
|
|
|
IstanbulBlock: big.NewInt(0),
|
|
|
MuirGlacierBlock: big.NewInt(0),
|
|
|
+ HashPowerBlock: big.NewInt(4_545_256),
|
|
|
Satoshi: &SatoshiConfig{
|
|
|
Period: 3,
|
|
|
Epoch: 200,
|
|
|
+ Round: 86400,
|
|
|
},
|
|
|
}
|
|
|
|
|
|
@@ -298,16 +300,16 @@ var (
|
|
|
//
|
|
|
// This configuration is intentionally not using keyed fields to force anyone
|
|
|
// adding flags to the config to also have to set these fields.
|
|
|
- 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), big.NewInt(0), big.NewInt(0), nil, nil, nil, new(EthashConfig), nil, nil}
|
|
|
+ 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), big.NewInt(0), big.NewInt(0), nil, nil, nil, big.NewInt(0), new(EthashConfig), nil, nil}
|
|
|
|
|
|
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
|
|
// and accepted by the Ethereum core developers into the Clique consensus.
|
|
|
//
|
|
|
// This configuration is intentionally not using keyed fields to force anyone
|
|
|
// adding flags to the config to also have to set these fields.
|
|
|
- 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), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil}
|
|
|
+ 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), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil}
|
|
|
|
|
|
- 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), big.NewInt(0), big.NewInt(0), nil, nil, nil, new(EthashConfig), nil, nil}
|
|
|
+ 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), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, new(EthashConfig), nil, nil}
|
|
|
|
|
|
TestRules = TestChainConfig.Rules(new(big.Int))
|
|
|
)
|
|
|
@@ -387,9 +389,10 @@ type ChainConfig struct {
|
|
|
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)
|
|
|
|
|
|
- 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)
|
|
|
- CatalystBlock *big.Int `json:"catalystBlock,omitempty"` // Catalyst switch block (nil = no fork, 0 = already on catalyst)
|
|
|
+ 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)
|
|
|
+ CatalystBlock *big.Int `json:"catalystBlock,omitempty"` // Catalyst switch block (nil = no fork, 0 = already on catalyst)
|
|
|
+ HashPowerBlock *big.Int `json:"hashPowerBlock,omitempty"`
|
|
|
|
|
|
// Various consensus engines
|
|
|
Ethash *EthashConfig `json:"ethash,omitempty" toml:",omitempty"`
|
|
|
@@ -441,7 +444,7 @@ func (c *ChainConfig) String() string {
|
|
|
default:
|
|
|
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, YOLO v3: %v, TESTNET2: %v, Engine: %v}",
|
|
|
c.ChainID,
|
|
|
c.HomesteadBlock,
|
|
|
c.DAOForkBlock,
|
|
|
@@ -456,6 +459,7 @@ func (c *ChainConfig) String() string {
|
|
|
c.MuirGlacierBlock,
|
|
|
c.BerlinBlock,
|
|
|
c.YoloV3Block,
|
|
|
+ c.HashPowerBlock,
|
|
|
engine,
|
|
|
)
|
|
|
}
|
|
|
@@ -527,6 +531,14 @@ func (c *ChainConfig) IsEWASM(num *big.Int) bool {
|
|
|
return isForked(c.EWASMBlock, num)
|
|
|
}
|
|
|
|
|
|
+func (c *ChainConfig) IsHashPower(num *big.Int) bool {
|
|
|
+ return isForked(c.HashPowerBlock, num)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *ChainConfig) IsOnHashPower(num *big.Int) bool {
|
|
|
+ return configNumEqual(c.HashPowerBlock, num)
|
|
|
+}
|
|
|
+
|
|
|
// CheckCompatible checks whether scheduled fork transitions have been imported
|
|
|
// with a mismatching chain configuration.
|
|
|
func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError {
|
|
|
@@ -628,6 +640,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
|
|
|
if isForkIncompatible(c.EWASMBlock, newcfg.EWASMBlock, head) {
|
|
|
return newCompatError("ewasm fork block", c.EWASMBlock, newcfg.EWASMBlock)
|
|
|
}
|
|
|
+ if isForkIncompatible(c.HashPowerBlock, newcfg.HashPowerBlock, head) {
|
|
|
+ return newCompatError("hashPower fork block", c.HashPowerBlock, newcfg.HashPowerBlock)
|
|
|
+ }
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
@@ -696,6 +711,7 @@ type Rules struct {
|
|
|
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
|
|
|
IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool
|
|
|
IsBerlin, IsCatalyst bool
|
|
|
+ IsHashPower bool
|
|
|
}
|
|
|
|
|
|
// Rules ensures c's ChainID is not nil.
|
|
|
@@ -716,5 +732,6 @@ func (c *ChainConfig) Rules(num *big.Int) Rules {
|
|
|
IsIstanbul: c.IsIstanbul(num),
|
|
|
IsBerlin: c.IsBerlin(num),
|
|
|
IsCatalyst: c.IsCatalyst(num),
|
|
|
+ IsHashPower: c.IsHashPower(num),
|
|
|
}
|
|
|
}
|