|
@@ -31,6 +31,9 @@ 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")
|
|
|
|
|
+
|
|
|
|
|
+ ChapelGenesisHash = common.HexToHash("0x6d3c66c5357ec91d5c43af47e234a939b22557cbb552dc45bebbceeed90fbe34")
|
|
|
|
|
+ RialtoGenesisHash = common.HexToHash("0xaa1c1e0af675e846942719466ab72822eff51ebf8462ead0897ae1240e3c0da1")
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// TrustedCheckpoints associates each known checkpoint with the genesis hash of
|
|
// TrustedCheckpoints associates each known checkpoint with the genesis hash of
|
|
@@ -210,21 +213,57 @@ var (
|
|
|
Threshold: 2,
|
|
Threshold: 2,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ ChapelChainConfig = &ChainConfig{
|
|
|
|
|
+ ChainID: big.NewInt(97),
|
|
|
|
|
+ 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),
|
|
|
|
|
+ RamanujanBlock: big.NewInt(1066095),
|
|
|
|
|
+ Parlia: &ParliaConfig{
|
|
|
|
|
+ Period: 3,
|
|
|
|
|
+ Epoch: 200,
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ RialtoChainConfig = &ChainConfig{
|
|
|
|
|
+ ChainID: big.NewInt(1417),
|
|
|
|
|
+ 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),
|
|
|
|
|
+ RamanujanBlock: big.NewInt(200987),
|
|
|
|
|
+ Parlia: &ParliaConfig{
|
|
|
|
|
+ Period: 3,
|
|
|
|
|
+ Epoch: 200,
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
|
|
// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
|
|
|
// and accepted by the Ethereum core developers into the Ethash consensus.
|
|
// and accepted by the Ethereum core developers into the Ethash consensus.
|
|
|
//
|
|
//
|
|
|
// This configuration is intentionally not using keyed fields to force anyone
|
|
// This configuration is intentionally not using keyed fields to force anyone
|
|
|
// adding flags to the config to also have to set these fields.
|
|
// 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), 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), nil, nil, nil, new(EthashConfig), nil, nil}
|
|
|
|
|
|
|
|
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
|
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
|
|
// and accepted by the Ethereum core developers into the Clique consensus.
|
|
// and accepted by the Ethereum core developers into the Clique consensus.
|
|
|
//
|
|
//
|
|
|
// This configuration is intentionally not using keyed fields to force anyone
|
|
// This configuration is intentionally not using keyed fields to force anyone
|
|
|
// adding flags to the config to also have to set these fields.
|
|
// 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), 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), 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), 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), nil, nil, nil, new(EthashConfig), nil, nil}
|
|
|
TestRules = TestChainConfig.Rules(new(big.Int))
|
|
TestRules = TestChainConfig.Rules(new(big.Int))
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -296,6 +335,7 @@ type ChainConfig struct {
|
|
|
IstanbulBlock *big.Int `json:"istanbulBlock,omitempty" toml:",omitempty"` // Istanbul switch block (nil = no fork, 0 = already on istanbul)
|
|
IstanbulBlock *big.Int `json:"istanbulBlock,omitempty" toml:",omitempty"` // Istanbul switch block (nil = no fork, 0 = already on istanbul)
|
|
|
MuirGlacierBlock *big.Int `json:"muirGlacierBlock,omitempty" toml:",omitempty"` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)
|
|
MuirGlacierBlock *big.Int `json:"muirGlacierBlock,omitempty" toml:",omitempty"` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)
|
|
|
EWASMBlock *big.Int `json:"ewasmBlock,omitempty" toml:",omitempty"` // EWASM switch block (nil = no fork, 0 = already activated)
|
|
EWASMBlock *big.Int `json:"ewasmBlock,omitempty" toml:",omitempty"` // EWASM switch block (nil = no fork, 0 = already activated)
|
|
|
|
|
+ RamanujanBlock *big.Int `json:"ramanujanBlock,omitempty" toml:",omitempty"` // ramanujanBlock switch block (nil = no fork, 0 = already activated)
|
|
|
|
|
|
|
|
// Various consensus engines
|
|
// Various consensus engines
|
|
|
Ethash *EthashConfig `json:"ethash,omitempty" toml:",omitempty"`
|
|
Ethash *EthashConfig `json:"ethash,omitempty" toml:",omitempty"`
|
|
@@ -346,7 +386,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, 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, Ramanujan: %v, Engine: %v}",
|
|
|
c.ChainID,
|
|
c.ChainID,
|
|
|
c.HomesteadBlock,
|
|
c.HomesteadBlock,
|
|
|
c.DAOForkBlock,
|
|
c.DAOForkBlock,
|
|
@@ -359,6 +399,7 @@ func (c *ChainConfig) String() string {
|
|
|
c.PetersburgBlock,
|
|
c.PetersburgBlock,
|
|
|
c.IstanbulBlock,
|
|
c.IstanbulBlock,
|
|
|
c.MuirGlacierBlock,
|
|
c.MuirGlacierBlock,
|
|
|
|
|
+ c.RamanujanBlock,
|
|
|
engine,
|
|
engine,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -398,6 +439,11 @@ func (c *ChainConfig) IsConstantinople(num *big.Int) bool {
|
|
|
return isForked(c.ConstantinopleBlock, num)
|
|
return isForked(c.ConstantinopleBlock, num)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// IsRamanujan returns whether num is either equal to the IsRamanujan fork block or greater.
|
|
|
|
|
+func (c *ChainConfig) IsRamanujan(num *big.Int) bool {
|
|
|
|
|
+ return isForked(c.RamanujanBlock, num)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
|
|
// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
|
|
|
func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
|
|
func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
|
|
|
return isForked(c.MuirGlacierBlock, num)
|
|
return isForked(c.MuirGlacierBlock, num)
|
|
@@ -456,6 +502,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
|
|
|
{"petersburgBlock", c.PetersburgBlock},
|
|
{"petersburgBlock", c.PetersburgBlock},
|
|
|
{"istanbulBlock", c.IstanbulBlock},
|
|
{"istanbulBlock", c.IstanbulBlock},
|
|
|
{"muirGlacierBlock", c.MuirGlacierBlock},
|
|
{"muirGlacierBlock", c.MuirGlacierBlock},
|
|
|
|
|
+ {"ramanujanBlock", c.RamanujanBlock},
|
|
|
} {
|
|
} {
|
|
|
if lastFork.name != "" {
|
|
if lastFork.name != "" {
|
|
|
// Next one must be higher number
|
|
// Next one must be higher number
|
|
@@ -515,6 +562,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
|
|
|
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)
|
|
|
}
|
|
}
|
|
|
|
|
+ if isForkIncompatible(c.RamanujanBlock, newcfg.RamanujanBlock, head) {
|
|
|
|
|
+ return newCompatError("ramanujan fork block", c.RamanujanBlock, newcfg.RamanujanBlock)
|
|
|
|
|
+ }
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|