Skip to content

Commit

Permalink
update the params for tip13
Browse files Browse the repository at this point in the history
  • Loading branch information
iceming123 committed Jan 3, 2023
1 parent b72994b commit dd56d56
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions consensus/minerva/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -1401,10 +1401,10 @@ func getRewardCoin(height *big.Int) *big.Int {
}

// decay 20% per years from the fork fast height.
// 244 epochs in one year (365/1.5=243.3).
// 250 epochs in one year (365*86400/(5*25000)=252).
// origin: the new epoch for the fork point
func getRewardCoin2(height, origin uint64) *big.Int {
const count_epoch_in_one_year = 244
const count_epoch_in_one_year = 250
cur := types.GetEpochFromHeight(height)
if cur.EpochID < origin {
return big.NewInt(0)
Expand Down
6 changes: 4 additions & 2 deletions consensus/minerva/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func TestTime(t *testing.T) {
}
func Test03(t *testing.T) {
origin, height := uint64(0), uint64(0)
year := new(big.Int).Mul(big.NewInt(244), big.NewInt(25000))
year := new(big.Int).Mul(big.NewInt(250), big.NewInt(25000))
for i := 0; i < 100; i++ {
coin := getRewardCoin2(height, origin)
cur := types.GetEpochFromHeight(height)
Expand All @@ -286,9 +286,11 @@ func Test03(t *testing.T) {
}
}
func Test04(t *testing.T) {
num := big.NewInt(60000)
num := big.NewInt(211600)
base := getRewardCoin(num)
fmt.Println("base", base, toTrueCoin(base))

fmt.Println("init", params.INITNewRewardCoinForPos, toTrueCoin(params.INITNewRewardCoinForPos))
}
func Test05(t *testing.T) {
prikey, _ := crypto.HexToECDSA("")
Expand Down
2 changes: 1 addition & 1 deletion params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var (
TIP10: &BlockConfig{FastNumber: big.NewInt(6520000), CID: big.NewInt(302)},
TIP11: &BlockConfig{FastNumber: big.NewInt(8996000)},
TIP12: &BlockConfig{FastNumber: big.NewInt(14538000)},
TIP13: &BlockConfig{FastNumber: big.NewInt(-1), SnailNumber: new(big.Int).Set(StopSnailMiner)},
TIP13: &BlockConfig{FastNumber: big.NewInt(23820000), SnailNumber: big.NewInt(199600)},
}

// MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network.
Expand Down
3 changes: 1 addition & 2 deletions params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ var (
MaximumCommitteeNumber = big.NewInt(50)
ProposalCommitteeNumber = 20
MinimumCommitteeNumber = 4
StopSnailMiner = big.NewInt(2000000)
)

var (
Expand All @@ -195,5 +194,5 @@ var (
DposForkPoint uint64 = 0
ElectionMinLimitForStaking = new(big.Int).Mul(big.NewInt(20000), big.NewInt(1e18))
// calc from the TIP13 by manual
INITNewRewardCoinForPos = new(big.Int).Mul(big.NewInt(1000), big.NewInt(1e18))
INITNewRewardCoinForPos = new(big.Int).Mul(big.NewInt(4096), big.NewInt(1e16))
)
6 changes: 3 additions & 3 deletions params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
)

const (
VersionMajor = 2 // Major version component of the current release
VersionMinor = 1 // Minor version component of the current release
VersionPatch = 4 // Patch version component of the current release
VersionMajor = 3 // Major version component of the current release
VersionMinor = 0 // Minor version component of the current release
VersionPatch = 0 // Patch version component of the current release
VersionMeta = "stable" // Version metadata to append to the version string
)

Expand Down

0 comments on commit dd56d56

Please sign in to comment.