Skip to content

Commit

Permalink
Merge pull request #1721 from WeiLoy/feature-mainnet-launch
Browse files Browse the repository at this point in the history
Adjust the P value of the binomial distribution
  • Loading branch information
benbaley authored Mar 11, 2021
2 parents 62b9a90 + 7d678c0 commit 06196d0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions x/xcom/common_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ const (
IncreaseIssuanceRatioLowerLimit = 0

// When electing consensus nodes, it is used to calculate the P value of the binomial distribution
ElectionBaseL1 = 6000
ElectionBaseL2 = 10000
ElectionBaseL3 = 60000
ElectionBase = 30
)

var (
Expand Down Expand Up @@ -819,11 +817,5 @@ func EconomicString() string {
// Calculate the P value of the binomial distribution
// Parameter: The total weight of the election
func CalcP(totalWeight float64, sqrtWeight float64) float64 {
if totalWeight < float64(1000000000) {
return float64(ElectionBaseL1) / sqrtWeight
} else if totalWeight < float64(10000000000) {
return float64(ElectionBaseL2) / sqrtWeight
} else {
return float64(ElectionBaseL3) / sqrtWeight
}
return float64(ElectionBase) / sqrtWeight
}

0 comments on commit 06196d0

Please sign in to comment.