Skip to content

Commit dd56d56

Browse files
author
iceming123
committed
update the params for tip13
1 parent b72994b commit dd56d56

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

consensus/minerva/consensus.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,10 @@ func getRewardCoin(height *big.Int) *big.Int {
14011401
}
14021402

14031403
// decay 20% per years from the fork fast height.
1404-
// 244 epochs in one year (365/1.5=243.3).
1404+
// 250 epochs in one year (365*86400/(5*25000)=252).
14051405
// origin: the new epoch for the fork point
14061406
func getRewardCoin2(height, origin uint64) *big.Int {
1407-
const count_epoch_in_one_year = 244
1407+
const count_epoch_in_one_year = 250
14081408
cur := types.GetEpochFromHeight(height)
14091409
if cur.EpochID < origin {
14101410
return big.NewInt(0)

consensus/minerva/consensus_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func TestTime(t *testing.T) {
277277
}
278278
func Test03(t *testing.T) {
279279
origin, height := uint64(0), uint64(0)
280-
year := new(big.Int).Mul(big.NewInt(244), big.NewInt(25000))
280+
year := new(big.Int).Mul(big.NewInt(250), big.NewInt(25000))
281281
for i := 0; i < 100; i++ {
282282
coin := getRewardCoin2(height, origin)
283283
cur := types.GetEpochFromHeight(height)
@@ -286,9 +286,11 @@ func Test03(t *testing.T) {
286286
}
287287
}
288288
func Test04(t *testing.T) {
289-
num := big.NewInt(60000)
289+
num := big.NewInt(211600)
290290
base := getRewardCoin(num)
291291
fmt.Println("base", base, toTrueCoin(base))
292+
293+
fmt.Println("init", params.INITNewRewardCoinForPos, toTrueCoin(params.INITNewRewardCoinForPos))
292294
}
293295
func Test05(t *testing.T) {
294296
prikey, _ := crypto.HexToECDSA("")

params/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var (
6464
TIP10: &BlockConfig{FastNumber: big.NewInt(6520000), CID: big.NewInt(302)},
6565
TIP11: &BlockConfig{FastNumber: big.NewInt(8996000)},
6666
TIP12: &BlockConfig{FastNumber: big.NewInt(14538000)},
67-
TIP13: &BlockConfig{FastNumber: big.NewInt(-1), SnailNumber: new(big.Int).Set(StopSnailMiner)},
67+
TIP13: &BlockConfig{FastNumber: big.NewInt(23820000), SnailNumber: big.NewInt(199600)},
6868
}
6969

7070
// MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network.

params/protocol_params.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ var (
183183
MaximumCommitteeNumber = big.NewInt(50)
184184
ProposalCommitteeNumber = 20
185185
MinimumCommitteeNumber = 4
186-
StopSnailMiner = big.NewInt(2000000)
187186
)
188187

189188
var (
@@ -195,5 +194,5 @@ var (
195194
DposForkPoint uint64 = 0
196195
ElectionMinLimitForStaking = new(big.Int).Mul(big.NewInt(20000), big.NewInt(1e18))
197196
// calc from the TIP13 by manual
198-
INITNewRewardCoinForPos = new(big.Int).Mul(big.NewInt(1000), big.NewInt(1e18))
197+
INITNewRewardCoinForPos = new(big.Int).Mul(big.NewInt(4096), big.NewInt(1e16))
199198
)

params/version.go

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

2323
const (
24-
VersionMajor = 2 // Major version component of the current release
25-
VersionMinor = 1 // Minor version component of the current release
26-
VersionPatch = 4 // Patch version component of the current release
24+
VersionMajor = 3 // Major version component of the current release
25+
VersionMinor = 0 // Minor version component of the current release
26+
VersionPatch = 0 // Patch version component of the current release
2727
VersionMeta = "stable" // Version metadata to append to the version string
2828
)
2929

0 commit comments

Comments
 (0)