mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
Information on eras and difficulty adjustments.
This commit is contained in:
parent
167f5d128b
commit
53d2032cfb
1 changed files with 19 additions and 10 deletions
|
|
@ -335,6 +335,15 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
// EGEM Era Difficulty Algo
|
// EGEM Era Difficulty Algo
|
||||||
|
//
|
||||||
|
// Launch 0 - 5000 50% Difficulty*
|
||||||
|
// Requiem Era0 5001 - 10,000,000 20% Difficulty**
|
||||||
|
// Solstice Era1 10,000,001 - 20,000,000 15% Difficulty*
|
||||||
|
// Oblivion Era2 20,000,001 + 10% Difficulty*
|
||||||
|
//
|
||||||
|
// * +/- adjustment per block
|
||||||
|
// ** Dev fee is enabled at this Era start.
|
||||||
|
//
|
||||||
|
|
||||||
func calcDifficultyEGEM(time uint64, parent *types.Header) *big.Int {
|
func calcDifficultyEGEM(time uint64, parent *types.Header) *big.Int {
|
||||||
diff := new(big.Int)
|
diff := new(big.Int)
|
||||||
|
|
@ -370,14 +379,14 @@ func calcDifficultyEGEM(time uint64, parent *types.Header) *big.Int {
|
||||||
}
|
}
|
||||||
return diff
|
return diff
|
||||||
} else if (parent.Number.Cmp(egemRewardSwitchBlockEra0) == 1) {
|
} else if (parent.Number.Cmp(egemRewardSwitchBlockEra0) == 1) {
|
||||||
if bigTime.Sub(bigTime, bigParentTime).Cmp(params.DurationLimit) < 0 {
|
if bigTime.Sub(bigTime, bigParentTime).Cmp(params.DurationLimit) < 0 {
|
||||||
diff.Add(parent.Difficulty, adjust2)
|
diff.Add(parent.Difficulty, adjust2)
|
||||||
} else {
|
} else {
|
||||||
diff.Sub(parent.Difficulty, adjust2)
|
diff.Sub(parent.Difficulty, adjust2)
|
||||||
}
|
}
|
||||||
if diff.Cmp(params.MinimumDifficulty) < 0 {
|
if diff.Cmp(params.MinimumDifficulty) < 0 {
|
||||||
diff.Set(params.MinimumDifficulty)
|
diff.Set(params.MinimumDifficulty)
|
||||||
}
|
}
|
||||||
return diff
|
return diff
|
||||||
} else {
|
} else {
|
||||||
if bigTime.Sub(bigTime, bigParentTime).Cmp(params.DurationLimit) < 0 {
|
if bigTime.Sub(bigTime, bigParentTime).Cmp(params.DurationLimit) < 0 {
|
||||||
|
|
@ -513,7 +522,7 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
|
||||||
//dev rewards
|
//dev rewards
|
||||||
state.AddBalance(devFund, d1Reward) //ridz
|
state.AddBalance(devFund, d1Reward) //ridz
|
||||||
|
|
||||||
//Era0 Reward of block and dev reward 8/1. 20% Difficulty adjustment per block
|
//Era0 Reward of block and dev reward 8/1 EGEM. 20% Difficulty adjustment per block
|
||||||
} else if (header.Number.Cmp(egemRewardSwitchBlockEra0) == 1) {
|
} else if (header.Number.Cmp(egemRewardSwitchBlockEra0) == 1) {
|
||||||
reward := new(big.Int).Set(block0Reward)
|
reward := new(big.Int).Set(block0Reward)
|
||||||
r := new(big.Int)
|
r := new(big.Int)
|
||||||
|
|
@ -531,7 +540,7 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
|
||||||
//dev rewards
|
//dev rewards
|
||||||
state.AddBalance(devFund, d0Reward) //ridz
|
state.AddBalance(devFund, d0Reward) //ridz
|
||||||
|
|
||||||
// Fair Launch upto block 5000 with a 50% Difficulty adjustment per block.
|
// Launch upto block 5000 with a 50% Difficulty adjustment per block, 8 EGEM reward.
|
||||||
} else {
|
} else {
|
||||||
reward := new(big.Int).Set(block0Reward)
|
reward := new(big.Int).Set(block0Reward)
|
||||||
r := new(big.Int)
|
r := new(big.Int)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue