Merge pull request #2093 from filecoin-project/asr/clarify

Clarify expected block win when below minimum power threshold
This commit is contained in:
Łukasz Magiera 2020-06-22 22:32:08 +02:00 committed by GitHub
commit 9f3145aec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"context" "context"
"fmt" "fmt"
"github.com/filecoin-project/specs-actors/actors/builtin/power"
"sort" "sort"
"time" "time"
@ -119,6 +120,9 @@ var infoCmd = &cli.Command{
faultyPercentage) faultyPercentage)
} }
if pow.MinerPower.RawBytePower.LessThan(power.ConsensusMinerMinPower) {
fmt.Print("Below minimum power threshold, no blocks will be won")
} else {
expWinChance := float64(types.BigMul(qpercI, types.NewInt(build.BlocksPerEpoch)).Int64()) / 1000000 expWinChance := float64(types.BigMul(qpercI, types.NewInt(build.BlocksPerEpoch)).Int64()) / 1000000
if expWinChance > 0 { if expWinChance > 0 {
if expWinChance > 1 { if expWinChance > 1 {
@ -130,6 +134,7 @@ var infoCmd = &cli.Command{
fmt.Print("Expected block win rate: ") fmt.Print("Expected block win rate: ")
color.Blue("%.4f/day (every %s)", winPerDay, winRate.Truncate(time.Second)) color.Blue("%.4f/day (every %s)", winPerDay, winRate.Truncate(time.Second))
} }
}
fmt.Println() fmt.Println()