Skip to content

Commit f84f299

Browse files
authored
Merge pull request #34 from Ether1Project/1.6.0_NewHorizon
Etho Protocol NewHorizon Hard-Fork
2 parents 8855cf2 + c2f6373 commit f84f299

File tree

6 files changed

+41
-20
lines changed

6 files changed

+41
-20
lines changed

cmd/utils/flags.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,6 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
868868
urls = params.RinkebyBootnodes
869869
case ctx.GlobalBool(GoerliFlag.Name):
870870
urls = params.GoerliBootnodes
871-
case ctx.GlobalBool(HyperCubeFlag.Name):
872-
urls = params.HyperCubeBootnodes
873871
case cfg.BootstrapNodes != nil:
874872
return // already set, don't apply defaults.
875873
}

consensus/ethash/consensus.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ var (
7373
calcDifficultyByzantium = makeDifficultyCalculator(big.NewInt(3000000))
7474

7575
calcDifficultyRobinHood = makeDifficultyCalculator(big.NewInt(100000000))
76+
77+
calcDifficultyNewHorizon = makeDifficultyCalculator(nil)
7678
)
7779

7880
// Various error messages to mark blocks invalid. These should be private to
@@ -336,6 +338,10 @@ func (ethash *Ethash) CalcDifficulty(chain consensus.ChainHeaderReader, time uin
336338
func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int {
337339
next := new(big.Int).Add(parent.Number, big1)
338340
switch {
341+
case config.IsNewHorizon(next):
342+
// Change minimum difficulty
343+
params.MinimumDifficulty = big.NewInt(131072)
344+
return calcDifficultyNewHorizon(time, parent)
339345
case config.IsCatalyst(next):
340346
return big.NewInt(1)
341347
case config.IsLondon(next):
@@ -773,7 +779,11 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
773779
}
774780
state.AddBalance(header.Coinbase, reward)
775781
// Development Fund Address
776-
state.AddBalance(common.HexToAddress("0xE2c8cbEc30c8513888F7A95171eA836f8802d981"), developmentReward)
782+
if (header.Number.Int64() < 8300000) {
783+
state.AddBalance(common.HexToAddress("0xE2c8cbEc30c8513888F7A95171eA836f8802d981"), developmentReward)
784+
} else {
785+
state.AddBalance(common.HexToAddress("0xBA57dFe21F78F921F53B83fFE1958Bbab50F6b46"), developmentReward)
786+
}
777787
// Masternode Fund address
778788
state.AddBalance(common.HexToAddress("0xE19363Ffb51C62bEECd6783A2c9C5bfF5D4679ac"), masternodeReward)
779789
}

node/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const logo = `
5656
,,,,,, ,,,,,,,,,
5757
,,,,, ,,,,,,,,
5858
,,,, ,,,,,,
59-
,, ,,,, Atlas v1.5.3
59+
,, ,,,, NewHorizon v1.6.0
6060
,,
6161
,
6262
`

params/bootnodes.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,14 @@ var MainnetBootnodes = []string{
5858
"enode://b9cc36cb5ec88973a02163e69fee6ba0e30c880151e3118dbcb906430cbd26bab42e15d3f0d3ed0fe2621cea29d3a61ee6d1954eabddbb50e43326071ab0ac0c@63.141.228.219:44444",
5959
// Dylie's Bootnode
6060
"enode://ff3669514ad3a68e2e8aaee40d7a9fd8723ee0a7cb4492dc18c89a13f0d9b77b9fd0be950de1c45a9afd8f8cfbd4b4f13d215454fa2c18c654c54984a705483f@5.189.157.250:30305",
61+
// Add. Nodes.
62+
"enode://6d87b0c9bd9086ba005939171c62682ac76c069453ed74d6ff201216c86c04b2b9c6b6d498617d5f1babdde68a4dd7a080956dde41eec6cd4e97c0c7120e7e78@72.137.255.181:30312",
63+
"enode://3b2557e6b90c77c3d97858495cc334fb32910c7ec485d5d604dbfcdcfa47e2b0f354eb9b400841360c7be83099fcc429b3d4eaf27fe9f2cd8ac978b076509f6e@72.137.255.181:30300",
64+
"enode://5434a1c3b7dc9a8c050efd7c23293e8ebad6efdf13e9776b914bea358e879220c9274e54d49694cba4d05fdda38010d566be469b7ee0af637c7cd8d0059ee460@185.217.125.51:30305",
6165
// explorer
6266
"enode://cc71b430112d59e5527378ffac15e7e08d596732f4324239b1f43992883ed7cad70ee4223732879b3f5b2c736011375fd496a48b04fec186a512b82145744630@161.97.164.158:30305",
63-
// explorer2
64-
"enode://e8cff14eef402da18aa8e25a0f73d8bdf73b6beec952186be0670863a5036b1fe43204160bd251d17cb1c918acc86035ae3d9bc8af6339a3d409c2b31cc5ef68@194.163.129.70:30305",
65-
66-
}
67-
68-
var HyperCubeBootnodes = []string{
69-
"enode://411763141c2881a6d4f5e388deb2d271bc9550378ea0ada3df996966e86e5816cda9fb6c038e06a082ce90a1026f392be57a1293bcee2e749200b54f3bed2a2e@51.15.192.191:30305", // CuBeZero public node
70-
"enode://2b51379e575ad8d1a76d3e9e36b8e6d68c3c4a1ea639b2952f3ff1443c15a592b364f09a3e426e8836c42bcd7b88ed48d39f2abc080f349b077fb5e3e443a8e1@72.137.255.181:30306", // etho.black 1
71-
"enode://e6ed7c9cf13577fa28cb478607fd9321cb5373633ba6dfafb0fd200311135449b32098d53d12d0403da75808757f47573fef34b94b889b1041a217f168c7fdba@72.137.255.179:56136", // etho.black 2
67+
// explorer2
68+
"enode://e8cff14eef402da18aa8e25a0f73d8bdf73b6beec952186be0670863a5036b1fe43204160bd251d17cb1c918acc86035ae3d9bc8af6339a3d409c2b31cc5ef68@194.163.129.70:30305",
7269
}
7370

7471
// RopstenBootnodes are the enode URLs of the P2P bootstrap nodes running on the

params/config.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ var (
7575
PetersburgBlock: big.NewInt(8_000_000),
7676
IstanbulBlock: big.NewInt(8_000_000),
7777
MuirGlacierBlock: big.NewInt(8_000_000),
78+
NewHorizonBlock: big.NewInt(8_300_000),
7879
BerlinBlock: nil,
7980
LondonBlock: nil,
8081
Ethash: new(EthashConfig),
@@ -148,6 +149,7 @@ var (
148149
PetersburgBlock: big.NewInt(4_939_394),
149150
IstanbulBlock: big.NewInt(6_485_846),
150151
MuirGlacierBlock: big.NewInt(7_117_117),
152+
NewHorizonBlock: big.NewInt(8_250_000),
151153
BerlinBlock: big.NewInt(9_812_189),
152154
LondonBlock: big.NewInt(10_499_401),
153155
Ethash: new(EthashConfig),
@@ -190,6 +192,7 @@ var (
190192
PetersburgBlock: nil,
191193
IstanbulBlock: nil,
192194
MuirGlacierBlock: nil,
195+
NewHorizonBlock: nil,
193196
BerlinBlock: big.NewInt(8_290_928),
194197
LondonBlock: big.NewInt(8_897_988),
195198
Clique: &CliqueConfig{
@@ -232,6 +235,7 @@ var (
232235
PetersburgBlock: big.NewInt(0),
233236
IstanbulBlock: big.NewInt(1_561_651),
234237
MuirGlacierBlock: nil,
238+
NewHorizonBlock: nil,
235239
BerlinBlock: big.NewInt(4_460_644),
236240
LondonBlock: big.NewInt(5_062_605),
237241
Clique: &CliqueConfig{
@@ -266,16 +270,16 @@ var (
266270
//
267271
// This configuration is intentionally not using keyed fields to force anyone
268272
// adding flags to the config to also have to set these fields.
269-
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}
273+
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, nil, new(EthashConfig), nil}
270274

271275
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
272276
// and accepted by the Ethereum core developers into the Clique consensus.
273277
//
274278
// This configuration is intentionally not using keyed fields to force anyone
275279
// adding flags to the config to also have to set these fields.
276-
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}}
280+
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, nil, &CliqueConfig{Period: 0, Epoch: 30000}}
277281

278-
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}
282+
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, nil, new(EthashConfig), nil}
279283
TestRules = TestChainConfig.Rules(new(big.Int))
280284
)
281285

@@ -353,6 +357,7 @@ type ChainConfig struct {
353357
PetersburgBlock *big.Int `json:"petersburgBlock,omitempty"` // Petersburg switch block (nil = same as Constantinople)
354358
IstanbulBlock *big.Int `json:"istanbulBlock,omitempty"` // Istanbul switch block (nil = no fork, 0 = already on istanbul)
355359
MuirGlacierBlock *big.Int `json:"muirGlacierBlock,omitempty"` // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)
360+
NewHorizonBlock *big.Int `json:"newHorizonBlock,omitempty"` // NewHorizon switch block (nil = no fork, 0 = already activated)
356361
BerlinBlock *big.Int `json:"berlinBlock,omitempty"` // Berlin switch block (nil = no fork, 0 = already on berlin)
357362
LondonBlock *big.Int `json:"londonBlock,omitempty"` // London switch block (nil = no fork, 0 = already on london)
358363

@@ -407,6 +412,7 @@ func (c *ChainConfig) String() string {
407412
c.PetersburgBlock,
408413
c.IstanbulBlock,
409414
c.MuirGlacierBlock,
415+
c.NewHorizonBlock,
410416
c.BerlinBlock,
411417
c.LondonBlock,
412418
engine,
@@ -458,6 +464,11 @@ func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
458464
return isForked(c.MuirGlacierBlock, num)
459465
}
460466

467+
// IsNewHorizon returns whether num is either equal to the NewHorizon fork block or greater.
468+
func (c *ChainConfig) IsNewHorizon(num *big.Int) bool {
469+
return isForked(c.NewHorizonBlock, num)
470+
}
471+
461472
// IsPetersburg returns whether num is either
462473
// - equal to or greater than the PetersburgBlock fork block,
463474
// - OR is nil, and Constantinople is active
@@ -524,6 +535,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
524535
{name: "petersburgBlock", block: c.PetersburgBlock},
525536
{name: "istanbulBlock", block: c.IstanbulBlock},
526537
{name: "muirGlacierBlock", block: c.MuirGlacierBlock, optional: true},
538+
{name: "newHorizonBlock", block: c.NewHorizonBlock},
527539
{name: "berlinBlock", block: c.BerlinBlock},
528540
{name: "londonBlock", block: c.LondonBlock},
529541
} {
@@ -576,6 +588,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
576588
if isForkIncompatible(c.RobinHoodBlock, newcfg.RobinHoodBlock, head) {
577589
return newCompatError("RobinHood fork block", c.RobinHoodBlock, newcfg.RobinHoodBlock)
578590
}
591+
if isForkIncompatible(c.NewHorizonBlock, newcfg.NewHorizonBlock, head) {
592+
return newCompatError("NewHorizon fork block", c.NewHorizonBlock, newcfg.NewHorizonBlock)
593+
}
579594
if isForkIncompatible(c.ConstantinopleBlock, newcfg.ConstantinopleBlock, head) {
580595
return newCompatError("Constantinople fork block", c.ConstantinopleBlock, newcfg.ConstantinopleBlock)
581596
}
@@ -665,7 +680,7 @@ type Rules struct {
665680
ChainID *big.Int
666681
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
667682
IsByzantium, IsConstantinople, IsPetersburg, IsRobinHood, IsIstanbul, IsMuirGlacier bool
668-
IsBerlin, IsLondon, IsCatalyst bool
683+
IsBerlin, IsLondon, IsCatalyst, IsNewHorizon bool
669684
}
670685

671686
// Rules ensures c's ChainID is not nil.
@@ -685,6 +700,7 @@ func (c *ChainConfig) Rules(num *big.Int) Rules {
685700
IsConstantinople: c.IsConstantinople(num),
686701
IsPetersburg: c.IsPetersburg(num),
687702
IsIstanbul: c.IsIstanbul(num),
703+
IsNewHorizon: c.IsNewHorizon(num),
688704
IsBerlin: c.IsBerlin(num),
689705
IsLondon: c.IsLondon(num),
690706
IsCatalyst: c.IsCatalyst(num),

params/version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import (
2222

2323
const (
2424
VersionMajor = 1 // Major version component of the current release
25-
VersionMinor = 5 // Minor version component of the current release
26-
VersionPatch = 3 // Patch version component of the current release
27-
VersionMeta = "EthoProtocol--Atlas" // Version metadata to append to the version string
25+
VersionMinor = 6 // Minor version component of the current release
26+
VersionPatch = 0 // Patch version component of the current release
27+
VersionMeta = "EthoProtocol--NewHorizon" // Version metadata to append to the version string
2828
)
2929

3030
// Version holds the textual version string.

0 commit comments

Comments
 (0)